IRQ
lines0x20
5 things must happen to make this work correctly:
0x20
ea
register (r29
)There a 4 new registers in Nios II related to this
Register | Bit Information |
---|---|
crtl0 : status register |
|
crtl1 : estatus register |
|
crtl3 : ienable register |
|
crtl3 : ienable register |
ctl0
: control/status registerHolds flags to indicate the current state of the processor. Enabling interrupts globally in the processor is done by setting the appropriate bit in this register
0
: Processor Interrupt Enable (PIE)
1
: User/Supervisor bit
1
, we are in user mode0
, we are in supervisor modectli
registers (crtl0
, crtl1
, …)
rdctl
wrctl
r24
(et
) and r29
(ea
)PIE
bit in crt0
/status register do this (only if in supervisor mode):movi r8, 0b01 ; PIE bit = 1 (enabled)
; U/S = 0 (Supervisor)
wrct1 ctl0, r8 ; crtl0 <- r8
ctl1
: estatus