Skip to content

Commit

Permalink
Removed some unwanted code
Browse files Browse the repository at this point in the history
Signed-off-by: joydeep049 <[email protected]>
  • Loading branch information
joydeep049 committed Jul 16, 2024
1 parent 5058125 commit 3141c0c
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions model/riscv_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -262,67 +262,6 @@ function set_mstatus_UXL(m : Mstatus, a : arch_xlen) -> Mstatus = {
}
}

val extension : (string) -> bool

/* helper to check support for various extensions. */
/* we currently don't model 'E', so always assume 'I'. */
function extension(ext) = {
match ext {
"A" => misa.A() == 0b1,
"C" => misa.C() == 0b1,

/* F and D extensions have to enabled both via misa.{FD} as well as mstatus.FS */
"D" => (misa.D() == 0b1) & (mstatus.FS() != 0b00),
"F" => (misa.F() == 0b1) & (mstatus.FS() != 0b00),

"M" => misa.M() == 0b1,
"N" => misa.N() == 0b1,
"U" => misa.U() == 0b1,
"S" => misa.S() == 0b1,

/* V extension has to enable both via misa.V as well as mstatus.VS */
"V" => (misa.V() == 0b1) & (mstatus.VS() != 0b00),

/* BitManip extension support. */
"Zba" => true,
"Zbb" => true,
"Zbc" => true,
"Zbs" => true,

/* Scalar Cryptography extensions support. */
"Zbkb" => true,
"Zbkc" => true,
"Zbkx" => true,

/* Zfa (additional FP) extension */
"Zfa" => true,

/* Zfh (half-precision) extension depends on misa.F and mstatus.FS */
"Zfh" => (misa.F() == 0b1) & (mstatus.FS() != 0b00),

/* Zhinx, Zfinx and Zdinx extensions (TODO: gate FCSR access on [mhs]stateen0 bit 1 when implemented) */
"Zdinx" => sys_enable_zfinx() & sizeof(flen) >= 64,
"Zfinx" => sys_enable_zfinx(),
"Zhinx" => sys_enable_zfinx(),

/* Zicond extension support */
"Zicond" => true,

/* Cryptography extension support. Note these will need updating once */
/* Sail can be dynamically configured with different extension support */
/* and have dynamic changes of XLEN via S/UXL */
"Zkr" => true,
"Zksh" => true,
"Zksed" => true,
"Zknd" => true,
"Zkne" => true,
"Zknh" => true,

"Zmmul" => true,
_ => false
}
}

function legalize_mstatus(o : Mstatus, v : xlenbits) -> Mstatus = {
/*
* Populate all defined fields using the bits of v, stripping anything
Expand Down

0 comments on commit 3141c0c

Please sign in to comment.