Skip to content

Commit

Permalink
Add unratified B extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Jan 11, 2024
1 parent d7a3d80 commit 62b9c3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions model/riscv_sys_control.sail
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ function init_sys() -> unit = {

misa->MXL() = arch_to_bits(if sizeof(xlen) == 32 then RV32 else RV64);
misa->A() = 0b1; /* atomics */
misa->B() = 0b1; /* Bit-manipulation */
misa->C() = bool_to_bits(sys_enable_rvc()); /* RVC */
misa->I() = 0b1; /* base integer ISA */
misa->M() = 0b1; /* integer multiply/divide */
Expand Down
1 change: 1 addition & 0 deletions model/riscv_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ function legalize_misa(m : Misa, v : xlenbits) -> Misa = {
/* helpers to check support for various extensions. */
/* we currently don't model 'E', so always assume 'I'. */
function haveAtomics() -> bool = misa.A() == 0b1
function haveBExt() -> bool = misa.B() == 0b1
function haveRVC() -> bool = misa.C() == 0b1
function haveMulDiv() -> bool = misa.M() == 0b1
function haveSupMode() -> bool = misa.S() == 0b1
Expand Down

0 comments on commit 62b9c3c

Please sign in to comment.