Skip to content

Commit

Permalink
[rocketv] fix vxrm write.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed Aug 24, 2024
1 parent 8b79116 commit 695b32d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rocketv/src/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,10 @@ class CSR(val parameter: CSRParameter)
}

val setVlReadData: UInt = Wire(UInt(xLen.W))
io.rw.rdata := Mux1H(for ((k, v) <- read_mapping) yield decoded_addr(k) -> v).asUInt | setVlReadData
val cseReadData: UInt = Mux1H(for ((k, v) <- read_mapping) yield decoded_addr(k) -> v).asUInt
io.rw.rdata := io.vectorCsr.map(s =>
Mux(s, setVlReadData, cseReadData)
).getOrElse(cseReadData)

// cover access to register
val coverable_counters = read_mapping.filterNot {
Expand Down Expand Up @@ -1733,6 +1736,12 @@ class CSR(val parameter: CSRParameter)
vector.get.states("vill") := true.B
}
}
// v csr write
when(csr_wen) {
when(decoded_addr(CSRs.vxrm)) {
vector.get.states("vxrm") := wdata
}
}
} else {
setVlReadData := 0.U
}
Expand Down

0 comments on commit 695b32d

Please sign in to comment.