Skip to content

Commit

Permalink
cheri_inst: don't pass physaddrs to handle_mem_exception
Browse files Browse the repository at this point in the history
Another instance of riscv/sail-riscv#54
  • Loading branch information
nwf committed Jun 19, 2020
1 parent ea3b0cd commit 87acc92
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cheri_insts.sail
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ function handle_store_data_via_cap(rs, cs, cap_val, vaddrBits, width) = {
TR_Address(addr, _) => {
let eares : MemoryOpResult(unit) = mem_write_ea(addr, size, aq, rl, false);
match (eares) {
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL },
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL },
MemValue(_) => {
let rs_val = X(rs);
let res : MemoryOpResult(bool) = match (width, sizeof(xlen)) {
Expand All @@ -1199,7 +1199,7 @@ function handle_store_data_via_cap(rs, cs, cap_val, vaddrBits, width) = {
match (res) {
MemValue(true) => RETIRE_SUCCESS,
MemValue(false) => internal_error("store got false from mem_write_value"),
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL }
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL }
}
}
}
Expand Down Expand Up @@ -1265,13 +1265,13 @@ function handle_store_cap_via_cap(rs, cs, cap_val, vaddrBits) = {
_ => {
let eares : MemoryOpResult(unit) = mem_write_ea_cap(addr, aq, rl, false);
match (eares) {
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL },
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL },
MemValue(_) => {
let res : MemoryOpResult(bool) = mem_write_cap(addr, rs_val, aq, rl, false);
match (res) {
MemValue(true) => RETIRE_SUCCESS,
MemValue(false) => internal_error("store got false from mem_write_value"),
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL }
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL }
}
}
}
Expand Down Expand Up @@ -1352,7 +1352,7 @@ function handle_store_cond_data_via_cap(rs2, cs, cap_val, vaddrBits, width) = {
TR_Address(addr, _) => {
let eares : MemoryOpResult(unit) = mem_write_ea(addr, size, aq, rl, false);
match (eares) {
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL },
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL },
MemValue(_) => {
let rs2_val = X(rs2);
let res : MemoryOpResult(bool) = match (width, sizeof(xlen)) {
Expand All @@ -1364,7 +1364,7 @@ function handle_store_cond_data_via_cap(rs2, cs, cap_val, vaddrBits, width) = {
match (res) {
MemValue(true) => { X(rs2) = EXTZ(0b0); cancel_reservation(); RETIRE_SUCCESS },
MemValue(false) => { X(rs2) = EXTZ(0b1); cancel_reservation(); RETIRE_SUCCESS },
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL }
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL }
}
}
}
Expand Down Expand Up @@ -1421,7 +1421,7 @@ function handle_store_cond_cap_via_cap(cs2, cs, cap_val, vaddrBits) = {
_ => {
let eares : MemoryOpResult(unit) = mem_write_ea_cap(addr, aq, rl, false);
match (eares) {
MemException(e) => { handle_mem_exception(addr, e); RETIRE_FAIL },
MemException(e) => { handle_mem_exception(vaddrBits, e); RETIRE_FAIL },
MemValue(_) => {
let res : MemoryOpResult(bool) = mem_write_cap(addr, cs2_val, aq, rl, false);
match (res) {
Expand All @@ -1436,7 +1436,7 @@ function handle_store_cond_cap_via_cap(cs2, cs, cap_val, vaddrBits) = {
RETIRE_SUCCESS
},
MemException(e) => {
handle_mem_exception(addr, e);
handle_mem_exception(vaddrBits, e);
RETIRE_FAIL
}
}
Expand Down

0 comments on commit 87acc92

Please sign in to comment.