diff --git a/sim/coverage-exclusions-rv64gc.do b/sim/coverage-exclusions-rv64gc.do index 4d3b47c1..88116aa3 100644 --- a/sim/coverage-exclusions-rv64gc.do +++ b/sim/coverage-exclusions-rv64gc.do @@ -153,6 +153,8 @@ set line [GetLineNum ../src/mmu/mmu.sv "PMAInstrAccessFaultF \\|"] coverage exclude -scope /dut/core/lsu/dmmu/dmmu -linerange $line-$line -item e 1 -fecexprrow 2,4,5,6 set line [GetLineNum ../src/mmu/pmpchecker.sv "EnforcePMP & ExecuteAccessF"] coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmp/pmpchecker -linerange $line-$line -item e 1 -fecexprrow 1,2,4,5,6 +set line [GetLineNum ../src/mmu/pmpchecker.sv "EnforcePMP & ExecuteAccessF"] +coverage exclude -scope /dut/core/ifu/immu/immu/pmp/pmpchecker -linerange $line-$line -item e 1 -fecexprrow 3 ## The IFU has ReadAccess = WriteAccess = 0 and ExecuteAccess = 1 hardwired, so exclude alternatives @@ -206,3 +208,7 @@ coverage exclude -scope /dut/core/priv/priv/pmd/wfi/wficountreg -linerange $line # TLB not recently used never has all RU bits = 1 because it will then clear all to 0 # This is a blunt instrument; perhaps there is a more graceful exclusion coverage exclude -srcfile priorityonehot.sv + +# Excluding pmpadrdecs[0] coverage case for PAgePMPAdrIn being hardwired to 1 +coverage exclude -scope /dut/core/ifu/immu/immu/pmp/pmpchecker/pmp/pmpadrdecs[0] -linerange [GetLineNum ../src/mmu/pmpadrdec.sv "exclusion-tag: PAgePMPAdrIn"] -item e 1 -fecexprrow 1 +coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmp/pmpchecker/pmp/pmpadrdecs[0] -linerange [GetLineNum ../src/mmu/pmpadrdec.sv "exclusion-tag: PAgePMPAdrIn"] -item e 1 -fecexprrow 1 diff --git a/src/mmu/pmpadrdec.sv b/src/mmu/pmpadrdec.sv index f36fa99f..a4fb8068 100644 --- a/src/mmu/pmpadrdec.sv +++ b/src/mmu/pmpadrdec.sv @@ -63,7 +63,7 @@ module pmpadrdec ( assign CurrentAdrFull = {PMPAdr, 2'b00}; assign PAltPMPAdr = {1'b0, PhysicalAddress} < {1'b0, CurrentAdrFull}; // unsigned comparison assign PAgePMPAdrOut = ~PAltPMPAdr; - assign TORMatch = PAgePMPAdrIn & PAltPMPAdr; + assign TORMatch = PAgePMPAdrIn & PAltPMPAdr; // exclusion-tag: PAgePMPAdrIn // Naturally aligned regions logic [`PA_BITS-1:0] NAMask, NABase; diff --git a/testbench/tests.vh b/testbench/tests.vh index 81b31617..4bd55a4e 100644 --- a/testbench/tests.vh +++ b/testbench/tests.vh @@ -63,7 +63,8 @@ string tvpaths[] = '{ "pmp", "pmpcfg", "pmpcfg1", - "pmpcfg2" + "pmpcfg2", + "pmpadrdecs" }; string coremark[] = '{ diff --git a/tests/coverage/pmpadrdecs.S b/tests/coverage/pmpadrdecs.S new file mode 100644 index 00000000..51ca4d14 --- /dev/null +++ b/tests/coverage/pmpadrdecs.S @@ -0,0 +1,22 @@ +// pmpadrdecs +// Liam Chalk, lchalk@hmc.edu, 4/27/2023 +// Setting AdrMode to 2 or 3 for pmpadrdecs[0-4] + +#include "WALLY-init-lib.h" +main: + + # Writing values to pmpcfg0 to change AdrMode to 2 or 3 + # pmpadrdec[0] + li t0, 0x0000000010 + csrw pmpcfg0, t0 + # pmpadrdec[1] + li t0, 0x0000001800 + csrw pmpcfg0, t0 + # pmpadrdec[2] + li t0, 0x0000180000 + csrw pmpcfg0, t0 + # pmpadrdec[4] + li t0, 0x1000000000 + csrw pmpcfg0, t0 + + j done \ No newline at end of file