aboutsummaryrefslogtreecommitdiff
path: root/model/sys/simple_interrupt_generator_regs.sail
blob: 80efb139b281d7ebcf64e62fbb5ce2cf4d47dbee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// =======================================================================================
// This Sail RISC-V architecture model, comprising all files and
// directories except where otherwise noted is subject the BSD
// two-clause license in the LICENSE file.
//
// SPDX-License-Identifier: BSD-2-Clause
// =======================================================================================

// The last value written to the Simple Interrupt Generator.
private register sig_meip : bits(1) = 0b0
private register sig_seip : bits(1) = 0b0

function external_interrupts_pending() -> Minterrupts =
  [Mk_Minterrupts(zeros()) with
    MEI = sig_meip,
    // SEIP is read-only zero if the hart does not support supervisor mode.
    SEI = if currentlyEnabled(Ext_S) then sig_seip else 0b0,
  ]