Skip to content

Commit

Permalink
sys_regs: add read-only UBE field to mstatus
Browse files Browse the repository at this point in the history
UBE felt left out because MBE and SBE are already there.
Add useless UBE field.

Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
  • Loading branch information
radimkrcmar committed Jan 11, 2025
1 parent 782fd14 commit 89d4953
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions model/riscv_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ bitfield Mstatus : status_bits = {
SPP : 8,

MPIE : 7,
UBE : 6,
SPIE : 5,

MIE : 3,
Expand Down Expand Up @@ -266,6 +267,8 @@ function legalize_mstatus(o : Mstatus, v : status_bits) -> Mstatus = {
SPP = v[SPP],

MPIE = v[MPIE],
/* We don't currently support changing UBE. */
// UBE = v[UBE],
SPIE = v[SPIE],

MIE = v[MIE],
Expand Down Expand Up @@ -684,6 +687,7 @@ bitfield Sstatus : status_bits = {
FS : 14 .. 13,
VS : 10 .. 9,
SPP : 8,
UBE : 6,
SPIE : 5,
SIE : 1,
}
Expand All @@ -700,6 +704,7 @@ function lower_mstatus(m : Mstatus) -> Sstatus = {
FS = m[FS],
VS = m[VS],
SPP = m[SPP],
UBE = m[UBE],
SPIE = m[SPIE],
SIE = m[SIE],
]
Expand All @@ -714,6 +719,7 @@ function lift_sstatus(m : Mstatus, s : Sstatus) -> Mstatus = {
FS = s[FS],
VS = s[VS],
SPP = s[SPP],
UBE = s[UBE],
SPIE = s[SPIE],
SIE = s[SIE],
]
Expand Down

0 comments on commit 89d4953

Please sign in to comment.