From 26c573f1cb3da1ef8bf60c18fba54edbde08fda3 Mon Sep 17 00:00:00 2001 From: Michael Schaffner Date: Wed, 18 Oct 2023 17:43:59 -0700 Subject: [PATCH] [ibex_pmp/lint] Declare functions before using them Signed-off-by: Michael Schaffner --- rtl/ibex_pmp.sv | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rtl/ibex_pmp.sv b/rtl/ibex_pmp.sv index 74cb6a3783..6bda6e03d3 100644 --- a/rtl/ibex_pmp.sv +++ b/rtl/ibex_pmp.sv @@ -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, @@ -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,