From 6f6b1265ffda50bd272d568062f70b54a6318297 Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Mon, 7 Oct 2024 09:42:19 +0100 Subject: [PATCH] Allow writing CBO bits in xenvcfg This was accidentally missed from the CBO implementation. --- model/riscv_sys_regs.sail | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/model/riscv_sys_regs.sail b/model/riscv_sys_regs.sail index b4fadd26b..fe0e1622a 100644 --- a/model/riscv_sys_regs.sail +++ b/model/riscv_sys_regs.sail @@ -352,6 +352,9 @@ function legalize_menvcfg(o : MEnvcfg, v : bits(64)) -> MEnvcfg = { let v = Mk_MEnvcfg(v); [o with FIOM = if sys_enable_writable_fiom() then v[FIOM] else 0b0, + CBZE = v[CBZE], + CBCFE = v[CBCFE], + CBIE = if v[CBIE] != 0b10 then v[CBIE] else 0b00, STCE = if extensionEnabled(Ext_Sstc) then v[STCE] else 0b0, // Other extensions are not implemented yet so all other fields are read only zero. ] @@ -361,8 +364,11 @@ function legalize_senvcfg(o : SEnvcfg, v : xlenbits) -> SEnvcfg = { let v = Mk_SEnvcfg(v); [o with FIOM = if sys_enable_writable_fiom() then v[FIOM] else 0b0, + CBZE = v[CBZE], + CBCFE = v[CBCFE], + CBIE = if v[CBIE] != 0b10 then v[CBIE] else 0b00, // Other extensions are not implemented yet so all other fields are read only zero. - ]; + ] } register menvcfg : MEnvcfg