Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ibex_pmp/lint] Declare functions before using them #2097

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading