Skip to content

Commit

Permalink
feat: add regnext for easy debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SeddonShen committed Aug 26, 2024
1 parent 2650dde commit 930fdde
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/main/scala/rvspeccore/checker/Checker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ class CheckerWithResult(checkMem: Boolean = true, enableReg: Boolean = false)(im
// assertions

if (checkMem) {
assert(io.mem.get.read.valid === specCore.io.mem.read.valid)
when(io.mem.get.read.valid || specCore.io.mem.read.valid){
assert(io.mem.get.read.addr === specCore.io.mem.read.addr)
assert(io.mem.get.read.memWidth === specCore.io.mem.read.memWidth)
assert(regDelay(io.mem.get.read.valid) === regDelay(specCore.io.mem.read.valid))
when(regDelay(io.mem.get.read.valid) || regDelay(specCore.io.mem.read.valid)){
assert(regDelay(io.mem.get.read.addr) === regDelay(specCore.io.mem.read.addr))
assert(regDelay(io.mem.get.read.memWidth) === regDelay(specCore.io.mem.read.memWidth))
}
assert(io.mem.get.write.valid === specCore.io.mem.write.valid)
when(io.mem.get.write.valid || specCore.io.mem.write.valid){
assert(io.mem.get.write.addr === specCore.io.mem.write.addr)
assert(io.mem.get.write.data === specCore.io.mem.write.data)
assert(io.mem.get.write.memWidth === specCore.io.mem.write.memWidth)
assert(regDelay(io.mem.get.write.valid) === regDelay(specCore.io.mem.write.valid))
when(regDelay(io.mem.get.write.valid) || regDelay(specCore.io.mem.write.valid)){
assert(regDelay(io.mem.get.write.addr) === regDelay(specCore.io.mem.write.addr))
assert(regDelay(io.mem.get.write.data) === regDelay(specCore.io.mem.write.data))
assert(regDelay(io.mem.get.write.memWidth) === regDelay(specCore.io.mem.write.memWidth))
}
specCore.io.mem.read.data := io.mem.get.read.data
} else {
Expand All @@ -73,9 +73,9 @@ class CheckerWithResult(checkMem: Boolean = true, enableReg: Boolean = false)(im
}
}
// printf("[SSD] io.instCommit.valid %x io.event.valid %x speccore.io.event.valid %x\n", io.instCommit.valid, io.event.valid, specCore.io.event.valid)
when(io.instCommit.valid) {
when(regDelay(io.instCommit.valid)) {
// now pc:
assert(io.instCommit.pc === specCore.io.now.pc)
assert(regDelay(io.instCommit.pc) === regDelay(specCore.io.now.pc))
// next pc: hard to get next pc in a pipeline, check it at next instruction

// next csr:
Expand Down

0 comments on commit 930fdde

Please sign in to comment.