PoR value of MSTATUS
Bug Description
The documented power-on-reset value of the mstatus
CSR (0x300) is 0x0000_1800 which expands to:
Bit Pos | PoR | Field |
---|---|---|
21 | 1'b0 | TW |
17 | 1'b0 | MPRV |
12:11 | 2'b11 | MPP |
7 | 1'b0 | MPIE |
3 | 1'b0 | MIE |
However the coded PoR in the RTL is:
localparam status_t MSTATUS_RST_VAL = '{mie: 1'b0,
mpie: 1'b1,
mpp: PRIV_LVL_U,
mprv: 1'b0,
tw: 1'b0};
Given that PRIV_LVL_U is 2'b00, this yields a PoR of 0x0000_0080.
I believe that the documented PoR value is the proper one, but the coded PoR has been in the Ibex code for three years so I am not certain.
You can show this in simulation in CORE-V-VERIF by running the debug_test
:
$ make test TEST=debug_test
(Set the SIMULATOR and USE_ISS vars as appropriate for your installation.)