Table 17:
mtvec
Register
Machine Trap Vector Register
CSR
mtvec
Bits
Field Name
Attr.
Description
[1:0]
MODE
WARL
MODE
Sets the interrupt processing mode.
The encoding for the FE310-G003 supported
modes is described in Table 18.
[31:2]
BASE[31:2]
WARL
Interrupt Vector Base Address. Requires
64-byte alignment.
Table 18:
Encoding of
mtvec.MODE
MODE Field Encoding
mtvec.MODE
Value
Name
Description
0x0
Direct
All exceptions set
pc
to
BASE
0x1
Vectored
Asynchronous interrupts set
pc
to
BASE
+ 4 ×
mcause.EXCCODE
.
≥ 2
Reserved
See Table 17 for a description of the
mtvec
register. See Table 18 for a description of the
mtvec.MODE
field. See Table 22 for the FE310-G003 interrupt exception code values.
When operating in direct mode all synchronous exceptions and asynchronous interrupts trap to
the
mtvec.BASE
address. Inside the trap handler, software must read the
mcause
register to
determine what triggered the trap.
While operating in vectored mode, interrupts set the
pc
to
mtvec.BASE
+ 4 × exception code.
For example, if a machine timer interrupt is taken, the
pc
is set to
mtvec.BASE
+ 0x1C. Typically,
the trap vector table is populated with jump instructions to transfer control to interrupt-specific
trap handlers.
In vectored interrupt mode, BASE must be 64-byte aligned.
Chapter 8 Interrupts
FE310-G003 Manual
© SiFive, Inc.
Page 39
Содержание FE310-G003
Страница 1: ...SiFive FE310 G003 Manual v1p1 SiFive Inc ...