Skip to content

Commit

Permalink
Merge pull request #444 from jdavidberger/bugfix/tdata2_rw
Browse files Browse the repository at this point in the history
Make TDATA2 RW. Openocd requires this for hw breakpoints
  • Loading branch information
Dolu1990 authored Feb 14, 2025
2 parents 9b40a05 + c559c6d commit 229fecd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/vexriscv/plugin/CsrPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -942,12 +942,12 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep
}

val tdata2 = new Area{
val value = Reg(PC)
csrw(CSR.TDATA2, 0 -> value)
val value = Reg(Bits(32 bits))
csrrw(CSR.TDATA2, value, 0 -> value)

val execute = new Area{
val enabled = !debugMode && tdata1.action === 1 && tdata1.execute && tdata1.privilegeHit
val hit = enabled && value === decode.input(PC)
val hit = enabled && value.asUInt === decode.input(PC)
decodeBreak.enabled.setWhen(hit)
}
}
Expand Down

0 comments on commit 229fecd

Please sign in to comment.