Merge pull request #1365 from coreyqh/ccov

Full priv and cacheways code coverage
This commit is contained in:
David Harris 2025-04-17 09:19:44 -07:00 committed by GitHub
commit ed93cca5f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -451,6 +451,12 @@ coverage exclude -scope /dut/core/priv/priv/csr/csru/csru -linerange [GetLineNum
coverage exclude -scope /dut/core/priv/priv/csr/counters/counters/cntr[1] -linerange [GetLineNum ${SRC}/privileged/csrc.sv "MTIME traps"] -item e 1 -fecexprrow 2 4
coverage exclude -scope /dut/core/priv/priv/csr/counters/counters/cntr[1] -linerange [GetLineNum ${SRC}/privileged/csrc.sv "assign NextHPMCOUNTERM"] -item b 1
# attempting to write stimecmp with STCE=0 traps, causing CSRSWriteM to go low
coverage exclude -scope /dut/core/priv/priv/csr/csrs/csrs -linerange [GetLineNum ${SRC}/privileged/csrs.sv "assign WriteSTIMECMPM"] -item e 1 -fecexprrow 5
# mode != m_mode and TVM = 1 causes a trap, causing CSRSWriteM to go low
coverage exclude -scope /dut/core/priv/priv/csr/csrs/csrs -linerange [GetLineNum ${SRC}/privileged/csrs.sv "assign WriteSATPM"] -item e 1 -fecexprrow 5 8
####################
# EBU
####################

View file

@ -31,20 +31,32 @@ main:
li t0, 0x80100770
sd zero, 0(t0)
sd zero, 1(t0)
lr.d t1, (t0)
addi t0, t0, 1
sc.d t2, t1, (t0)
// way 1
li t0, 0x80101770
sd zero, 0(t0)
sd zero, 1(t0)
lr.d t1, (t0)
addi t0, t0, 1
sc.d t2, t1, (t0)
// way 2
li t0, 0x80102770
sd zero, 0(t0)
sd zero, 1(t0)
lr.d t1, (t0)
addi t0, t0, 1
sc.d t2, t1, (t0)
// way 3
li t0, 0x80103770
sd zero, 0(t0)
sd zero, 1(t0)
lr.d t1, (t0)
addi t0, t0, 1
sc.d t2, t1, (t0)
j done