At this point control is handed over to software.
The Control and Status Registers involved in handling RISC‑V interrupts are described in Sec-
tion 8.3.
Interrupt Control Status Registers
The FE310-G003 specific implementation of interrupt CSRs is described below. For a complete
description of RISC‑V interrupt behavior and how to access CSRs, please consult
The RISC‑V
Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10
.
The
mstatus
register keeps track of and controls the hart’s current operating state, including
whether or not interrupts are enabled. A summary of the
mstatus
fields related to interrupts in
the FE310-G003 is provided in Table 16. Note that this is not a complete description of
mstatus
as it contains fields unrelated to interrupts. For the full description of
mstatus
, please consult
the
The RISC‑V Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10
.
Table 16:
FE310-G003
mstatus
Register (partial)
Machine Status Register
CSR
mstatus
Bits
Field Name
Attr.
Description
[2:0]
Reserved
WPRI
3
MIE
RW
Machine Interrupt Enable
[6:4]
Reserved
WPRI
7
MPIE
RW
Machine Previous Interrupt Enable
[10:8]
Reserved
WPRI
[12:11]
MPP
RW
Machine Previous Privilege Mode
Interrupts are enabled by setting the MIE bit in
mstatus
and by enabling the desired individual
interrupt in the
mie
register, described in Section 8.3.3.
The
mtvec
register has two main functions: defining the base address of the trap vector, and
setting the mode by which the FE310-G003 will process interrupts. The interrupt processing
mode is defined in the lower two bits of the
mtvec
register as described in Table 18.
Chapter 8 Interrupts
FE310-G003 Manual
© SiFive, Inc.
Page 38
Содержание FE310-G003
Страница 1: ...SiFive FE310 G003 Manual v1p1 SiFive Inc ...