From 46bc941e6e2f84438cd3ebf27765a6e0d71435d8 Mon Sep 17 00:00:00 2001 From: Ved Shanbhogue Date: Wed, 10 Jan 2024 18:05:02 -0600 Subject: [PATCH] Add unratified B extension --- model/riscv_sys_control.sail | 1 + model/riscv_sys_regs.sail | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/model/riscv_sys_control.sail b/model/riscv_sys_control.sail index 1baa33701..d796e2edd 100644 --- a/model/riscv_sys_control.sail +++ b/model/riscv_sys_control.sail @@ -483,6 +483,7 @@ function init_sys() -> unit = { misa[MXL] = arch_to_bits(if sizeof(xlen) == 32 then RV32 else RV64); misa[A] = 0b1; /* atomics */ misa[C] = bool_to_bits(sys_enable_rvc()); /* RVC */ + misa[B] = bool_to_bits(haveBExt()); /* Bit-manipulation */ misa[I] = 0b1; /* base integer ISA */ misa[M] = 0b1; /* integer multiply/divide */ misa[U] = 0b1; /* user-mode */ diff --git a/model/riscv_sys_regs.sail b/model/riscv_sys_regs.sail index 6c66492b4..aa53ae41d 100644 --- a/model/riscv_sys_regs.sail +++ b/model/riscv_sys_regs.sail @@ -136,10 +136,11 @@ function haveNExt() -> bool = misa[N] == 0b1 /* see below for F and D (and Z*inx counterparts) extension tests */ /* BitManip extension support. */ -function haveZba() -> bool = true -function haveZbb() -> bool = true +function haveBExt() -> bool = true +function haveZba() -> bool = true | haveBExt() +function haveZbb() -> bool = true | haveBExt() +function haveZbs() -> bool = true | haveBExt() function haveZbc() -> bool = true -function haveZbs() -> bool = true /* Zfa (additional FP) extension */ function haveZfa() -> bool = true