Table 20:
mip
Register
Machine Interrupt Pending Register
[10:8]
Reserved
WIRI
11
MEIP
RO
Machine External Interrupt Pending
[31:12]
Reserved
WIRI
When a trap is taken in machine mode,
mcause
is written with a code indicating the event that
caused the trap. When the event that caused the trap is an interrupt, the most-significant bit of
mcause
is set to 1, and the least-significant bits indicate the interrupt number, using the same
encoding as the bit positions in
mip
. For example, a Machine Timer Interrupt causes
mcause
to
be set to
0x8000_0007
.
mcause
is also used to indicate the cause of synchronous exceptions, in
which case the most-significant bit of
mcause
is set to 0.
See Table 21 for more details about the
mcause
register. Refer to Table 22 for a list of synchro-
nous exception codes.
Table 21:
mcause
Register
Machine Cause Register
CSR
mcause
Bits
Field Name
Attr.
Description
[9:0]
Exception Code
WLRL
A code identifying the last exception.
[30:10]
Reserved
WLRL
31
Interrupt
WARL
1, if the trap was caused by an interrupt; 0
otherwise.
Table 22:
mcause
Exception Codes
Interrupt Exception Codes
Interrupt
Exception Code
Description
1
0–2
Reserved
1
3
Machine software interrupt
1
4–6
Reserved
1
7
Machine timer interrupt
Chapter 8 Interrupts
FE310-G003 Manual
© SiFive, Inc.
Page 41
Содержание FE310-G003
Страница 1: ...SiFive FE310 G003 Manual v1p1 SiFive Inc ...