Nios® V Processor Reference Manual

ID 683632
Date 6/30/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.4.2.1. Control and Status Register Field

The value in the each CSR registers determines the state of the Nios® V/m processor. The field descriptions are based on the RISC-V specification.

Table 14.  Vendor ID Register FieldsThe mvendorid CSR is a 32-bit read-only register that provides the JEDEC manufacturer ID of the provider of the core.
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Bank
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Bank Offset
Table 15.  Architecture ID Register FieldsThe marchid CSR is a 32-bit read-only register encoding the base microarchitecture of the hart.
Bit Field
31 30 29 28 27 26 25 ... 6 5 4 3 2 1 0
Architecture ID
Table 16.  Implementation ID Register FieldsThe mimpid CSR provides a unique encoding of the version of the processor implementation.
Bit Field
31 30 29 28 27 26 25 ... 6 5 4 3 2 1 0
Implementation
Table 17.  Hardware Thread ID Register FieldsThe mhartid CSR is a 32-bit read-only register that contains the integer ID of the hardware thread running the code
Bit Field
31 30 29 28 27 26 25 ... 6 5 4 3 2 1 0
Hart ID
Table 18.  Machine Status Register FieldsThe mstatus register is a 32-bit read-write register that keeps track of and controls the hart’s current operating state.
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SD WPRI TSR TW TVM MXR SUM MPRV XS[1:0]
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XS[1:0] FS[1:0] MPP[1:0] WPRI SPP MPIE WPRI SPIE UPIE MIE WPRI SIE UIE
Table 19.  Machine ISA Register FieldsThe misa CSR is a read-write register reporting the ISA supported by the hart.
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MXL[1:0] WLRL Extension[25:0]
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Extension[25:0]
Table 20.  Machine Interrupt-Enable Register FieldsThe mie register is a 32-bit read-write register that contains interrupt enable bits.
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WPRI
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WPRI MEIE WPRI SEIE UEIE MTIE WPRI STIE UTIE MSIE WPRI SSIE USIE
Table 21.  Machine Trap-Handler Base Address Register FieldsThe mtvec register is a 32-bit read/write register that holds trap vector configuration, consisting of a vector base address (BASE) and a vector mode (MODE).
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Base[31:2]
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Base[31:2] Mode
Table 22.  Machine Exception Program Counter Register FieldsThe mepc register is a 32-bit read-write register that holds the addresses of the instruction that was interrupted or that encountered the exception when a trap is taken into M-mode.
Bit Field
31 30 29 28 27 26 25 ... 6 5 4 3 2 1 0
mepc
Table 23.  Machine Trap Cause Register FieldsThe mcause register is a 32-bit read-write register that hold the code indicating the event that caused the trap when a trap is taken into M-mode.
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Interrupt Exception code [30:16]
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Exception code [15:0]
Table 24.  Machine Trap Value Register Fields The mtval register is a 32-bit read-write register that is written with exception-specific information to assist software in handling the trap when a trap is taken into M-mode.
Bit Field
31 30 29 28 27 26 25 ... 6 5 4 3 2 1 0
mtval
Table 25.  Machine Interrupt-Pending Register FieldsThe mip register is a 32-bit read/write register containing information on pending interrupts.
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WPRI
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WPRI MEIP WPRI SEIP UEIP MTIP WPRI STIP UTIP MSIP WPRI SSIP USIP
Table 26.  Debug Control and Status Register FieldsThe dcsr CSR is a 32-bit read-write register containing information and status during D-mode
Bit Field
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
debugver 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ebreakm 0 ebreaks ebreaku stepie stopcount stoptime cause 0 mprven nmip step prv
Table 27.  Debug Program Counter Register FieldsUpon entry to D-mode, dpc CSR is updated with the virtual address of the next instruction to be executed.
Bit Field
31 30 29 28 27 26 25 ... 6 5 4 3 2 1 0
dpc