Skip to content

Commit

Permalink
Don't attempt to cover non-existent U-mode counters (#2817)
Browse files Browse the repository at this point in the history
* Don't attempt to cover non-existent U-mode counters

* Modification in the logic to not cover non-existent U-mode counters

Co-authored-by: Andrew Waterman <andrew@sifive.com>
Co-authored-by: Umer Imran <umerimran@lambda44.internal.sifive.com>
  • Loading branch information
3 people authored Apr 19, 2021
1 parent 7e1596b commit 5ef0be4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/scala/rocket/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,10 @@ class CSRFile(
io.rw.rdata := Mux1H(for ((k, v) <- read_mapping) yield decoded_addr(k) -> v)

// cover access to register
read_mapping.foreach( {case (k, v) => {
val coverable_counters = read_mapping.filterNot { case (k, _) =>
k >= CSR.firstHPC + nPerfCounters && k < CSR.firstHPC + CSR.nHPM
}
coverable_counters.foreach( {case (k, v) => {
when (!k(11,10).andR) { // Cover points for RW CSR registers
cover(io.rw.cmd.isOneOf(CSR.W, CSR.S, CSR.C) && io.rw.addr===k, "CSR_access_"+k.toString, "Cover Accessing Core CSR field")
} .otherwise { // Cover points for RO CSR registers
Expand Down

0 comments on commit 5ef0be4

Please sign in to comment.