Skip to content

Commit

Permalink
add unratified Zaamo and Zalrsc
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Jan 7, 2024
1 parent d7a3d80 commit b12e693
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/riscv_insts_aext.sail
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function process_loadres(rd, addr, value, is_unsigned) =
}

function clause execute(LOADRES(aq, rl, rs1, width, rd)) = {
if haveAtomics() then {
if haveAtomics() | haveZalrsc() then {
/* Get the address, X(rs1) (no offset).
* Extensions might perform additional checks on address validity.
*/
Expand Down Expand Up @@ -181,7 +181,7 @@ function clause execute (STORECON(aq, rl, rs2, rs1, width, rd)) = {
*/
X(rd) = zero_extend(0b1); RETIRE_SUCCESS
} else {
if haveAtomics() then {
if haveAtomics() | haveZalrsc() then {
/* normal non-rmem case
* rmem: SC is allowed to succeed (but might fail later)
*/
Expand Down Expand Up @@ -274,7 +274,7 @@ mapping clause encdec = AMO(op, aq, rl, rs2, rs1, size, rd) if amo_width_valid(s
/* NOTE: Currently, we only EA if address translation is successful.
This may need revisiting. */
function clause execute (AMO(op, aq, rl, rs2, rs1, width, rd)) = {
if haveAtomics() then {
if haveAtomics() | haveZaamo() then {
/* Get the address, X(rs1) (no offset).
* Some extensions perform additional checks on address validity.
*/
Expand Down
4 changes: 4 additions & 0 deletions model/riscv_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ function haveZknd() -> bool = true

function haveZmmul() -> bool = true

/* A extension sub-extensions */
function haveZaamo() -> bool = true
function haveZalrsc() -> bool = true

/* Zicond extension support */
function haveZicond() -> bool = true

Expand Down

0 comments on commit b12e693

Please sign in to comment.