Figure 4:
FE310-G003 Interrupt Architecture Block Diagram.
If the global interrupt-enable
mstatus.MIE
is clear, then no interrupts will be taken. If
mstatus.MIE
is set, then pending-enabled interrupts at a higher interrupt level will preempt cur-
rent execution and run the interrupt handler for the higher interrupt level.
When an interrupt or synchronous exception is taken, the privilege mode is modified to reflect
the new privilege mode. The global interrupt-enable bit of the handler’s privilege mode is
cleared.
When an interrupt occurs:
• The value of
mstatus.MIE
is copied into
mcause.MPIE
, and then
mstatus.MIE
is cleared,
effectively disabling interrupts.
• The privilege mode prior to the interrupt is encoded in
mstatus.MPP
.
• The current
pc
is copied into the
mepc
register, and then
pc
is set to the value specified by
mtvec
as defined by the
mtvec.MODE
described in Table 18.
At this point, control is handed over to software in the interrupt handler with interrupts disabled.
Interrupts can be re-enabled by explicitly setting
mstatus.MIE
or by executing an
MRET
instruc-
tion to exit the handler. When an MRET instruction is executed, the following occurs:
• The privilege mode is set to the value encoded in
mstatus.MPP
.
• The global interrupt enable,
mstatus.MIE
, is set to the value of
mcause.MPIE
.
• The
pc
is set to the value of
mepc
.
Chapter 8 Interrupts
FE310-G003 Manual
© SiFive, Inc.
Page 37
Содержание FE310-G003
Страница 1: ...SiFive FE310 G003 Manual v1p1 SiFive Inc ...