Skip to content

Commit

Permalink
[ibex_pmp/lint] Declare functions before using them
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Schaffner <msf@opentitan.org>
  • Loading branch information
msfschaffner authored and GregAC committed Oct 19, 2023
1 parent 97c0a72 commit bac72d9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions rtl/ibex_pmp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@ module ibex_pmp #(
// |
// \--> pmp_req_err_o

// A wrapper function in which it is decided which form of permission check function gets called
function automatic logic perm_check_wrapper(logic csr_pmp_mseccfg_mml,
ibex_pkg::pmp_cfg_t csr_pmp_cfg,
ibex_pkg::pmp_req_e pmp_req_type,
ibex_pkg::priv_lvl_e priv_mode,
logic permission_check);
return csr_pmp_mseccfg_mml ? mml_perm_check(csr_pmp_cfg,
pmp_req_type,
priv_mode,
permission_check) :
orig_perm_check(csr_pmp_cfg.lock,
priv_mode,
permission_check);
endfunction

// Compute permissions checks that apply when MSECCFG.MML is set. Added for Smepmp support.
function automatic logic mml_perm_check(ibex_pkg::pmp_cfg_t csr_pmp_cfg,
ibex_pkg::pmp_req_e pmp_req_type,
Expand Down Expand Up @@ -118,6 +103,21 @@ module ibex_pmp #(
permission_check;
endfunction

// A wrapper function in which it is decided which form of permission check function gets called
function automatic logic perm_check_wrapper(logic csr_pmp_mseccfg_mml,
ibex_pkg::pmp_cfg_t csr_pmp_cfg,
ibex_pkg::pmp_req_e pmp_req_type,
ibex_pkg::priv_lvl_e priv_mode,
logic permission_check);
return csr_pmp_mseccfg_mml ? mml_perm_check(csr_pmp_cfg,
pmp_req_type,
priv_mode,
permission_check) :
orig_perm_check(csr_pmp_cfg.lock,
priv_mode,
permission_check);
endfunction

// Access fault determination / prioritization
function automatic logic access_fault_check (logic csr_pmp_mseccfg_mmwp,
logic csr_pmp_mseccfg_mml,
Expand Down

0 comments on commit bac72d9

Please sign in to comment.