Skip to content

Commit

Permalink
Remove redundant type annotations on w_pte & add explicit var.
Browse files Browse the repository at this point in the history
These are given on the previous line already. Sail does not let you change the type of a variable like Rust does. The `var` ensures this definitely refers to a local rather than global variable.
  • Loading branch information
Timmmm authored and ptomsich committed Sep 12, 2023
1 parent 6c7cb9b commit a656e50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion model/riscv_vmem_sv32.sail
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function translate32(asid, ptb, vAddr, ac, priv, mxr, do_sum, level, ext_ptw) =
/* pte needs dirty/accessed update but that is not enabled */
TR_Failure(PTW_PTE_Update(), ext_ptw)
} else {
w_pte : SV32_PTE = update_BITS(pte, pbits.bits());
var w_pte : SV32_PTE = update_BITS(pte, pbits.bits());
/* ext is unused since there are no reserved bits for extensions */
match mem_write_value_priv(to_phys_addr(pteAddr), 4, w_pte.bits(), Supervisor, false, false, false) {
MemValue(_) => {
Expand Down
4 changes: 2 additions & 2 deletions model/riscv_vmem_sv39.sail
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ function translate39(asid, ptb, vAddr, ac, priv, mxr, do_sum, level, ext_ptw) =
/* pte needs dirty/accessed update but that is not enabled */
TR_Failure(PTW_PTE_Update(), ext_ptw)
} else {
w_pte : SV39_PTE = update_BITS(pte, pbits.bits());
w_pte : SV39_PTE = update_Ext(w_pte, ext);
var w_pte : SV39_PTE = update_BITS(pte, pbits.bits());
w_pte = update_Ext(w_pte, ext);
match mem_write_value_priv(zero_extend(pteAddr), 8, w_pte.bits(), Supervisor, false, false, false) {
MemValue(_) => {
add_to_TLB39(asid, vAddr, pAddr, w_pte, pteAddr, level, global);
Expand Down
4 changes: 2 additions & 2 deletions model/riscv_vmem_sv48.sail
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ function translate48(asid, ptb, vAddr, ac, priv, mxr, do_sum, level, ext_ptw) =
/* pte needs dirty/accessed update but that is not enabled */
TR_Failure(PTW_PTE_Update(), ext_ptw)
} else {
w_pte : SV48_PTE = update_BITS(pte, pbits.bits());
w_pte : SV48_PTE = update_Ext(w_pte, ext);
var w_pte : SV48_PTE = update_BITS(pte, pbits.bits());
w_pte = update_Ext(w_pte, ext);
match mem_write_value_priv(zero_extend(pteAddr), 8, w_pte.bits(), Supervisor, false, false, false) {
MemValue(_) => {
add_to_TLB48(asid, vAddr, pAddr, w_pte, pteAddr, level, global);
Expand Down

0 comments on commit a656e50

Please sign in to comment.