Skip to content

Commit

Permalink
In vmem code, renamed Level to more descriptive PTW_Level
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnikhil committed Jan 2, 2024
1 parent c3d3bd6 commit 5668f60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/riscv_vmem.sail
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ struct SV_Params = {
}

// Current level during a page-table walk (0 to SV_Params.levels - 1)
type Level = range(0,3) // range(0,4) when add Sv57 (TODO)
type PTW_Level = range(0,3) // range(0,4) when add Sv57 (TODO)

// PRIVATE
let sv32_params : SV_Params = struct {
Expand Down Expand Up @@ -246,7 +246,7 @@ function vpns_of_va(sv_params : SV_Params,
// PRIVATE: Extract VPN[level] from VA
function vpn_j_of_va(sv_params : SV_Params,
va : bits(64),
level : Level) -> bits(64) = {
level : PTW_Level) -> bits(64) = {
let lsb : range(0,63) = pagesize_bits + level * sv_params.vpn_size_bits;
assert (lsb < sizeof(xlen));
let mask : bits(64) = zero_extend(ones(sv_params.vpn_size_bits));
Expand Down Expand Up @@ -469,7 +469,7 @@ val pt_walk : (SV_Params,
bool, // mstatus.MXR
bool, // do_sum
bits(64), // PT base addr
Level, // tree level for this recursive call
PTW_Level, // tree level for this recursive call
bool, // global translation,
ext_ptw) // ext_ptw
-> PTW_Result
Expand Down

0 comments on commit 5668f60

Please sign in to comment.