Skip to content

Commit

Permalink
Increase coverage of pmp permission tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Michalak <[email protected]>
  • Loading branch information
tmichalak committed Oct 9, 2024
1 parent 4be86d0 commit 0cc9805
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions design/el2_pmp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ module el2_pmp
) (
input logic clk, // Top level clock
input logic rst_l, // Reset
/* verilator coverage_off */
input logic scan_mode, // Scan mode
/* verilator coverage_on */

`ifdef RV_SMEPMP
input el2_mseccfg_pkt_t mseccfg, // mseccfg CSR content, RLB, MMWP and MML bits
Expand Down Expand Up @@ -113,7 +115,9 @@ module el2_pmp
2'b11: result =
(pmp_req_type == EXEC) |
((pmp_req_type == READ) & ~priv_mode);
/* verilator coverage_off */
default: ;
/* verilator coverage_on */
endcase
end else begin
if (csr_pmp_cfg.read & csr_pmp_cfg.write & csr_pmp_cfg.execute & csr_pmp_cfg.lock) begin
Expand Down
3 changes: 2 additions & 1 deletion testbench/tests/csr_mseccfg/csr_mseccfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ int main () {
write_csr(CSR_PMPADDR3, PMPADDR(A(_data_end)));

uint32_t pmpcfg;
pmpcfg = PMPREGION((PMPCFG_TOR | PMPCFG_X) , 1) |
pmpcfg = PMPREGION((PMPCFG_TOR | PMPCFG_W | PMPCFG_X), 1) |
PMPREGION((PMPCFG_TOR | PMPCFG_W), 2) |
PMPREGION((PMPCFG_TOR | PMPCFG_R | PMPCFG_W), 3);

write_csr(CSR_PMPCFG0, pmpcfg);
Expand Down

0 comments on commit 0cc9805

Please sign in to comment.