Merge pull request #220 from BLangOS/patch-1

Update DebugPlugin.scala: Add optional readback of hardware breakpoint values
This commit is contained in:
Dolu1990 2021-11-15 09:25:00 +01:00 committed by GitHub
commit 6c5908f7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -176,7 +176,7 @@ case class DebugExtensionIo() extends Bundle with IMasterSlave{
}
}
class DebugPlugin(var debugClockDomain : ClockDomain, hardwareBreakpointCount : Int = 0) extends Plugin[VexRiscv] {
class DebugPlugin(var debugClockDomain : ClockDomain, hardwareBreakpointCount : Int = 0, BreakpointReadback : Boolean = false) extends Plugin[VexRiscv] {
var io : DebugExtensionIo = null
val injectionAsks = ArrayBuffer[(Stage, Bool)]()
@ -248,6 +248,17 @@ class DebugPlugin(var debugClockDomain : ClockDomain, hardwareBreakpointCount :
io.bus.rsp.data(3) := haltedByBreak
io.bus.rsp.data(4) := stepIt
}
if (BreakpointReadback) {
switch(RegNext(io.bus.cmd.address(7 downto 2))) {
for(i <- 0 until hardwareBreakpointCount){
is(0x10 + i){
io.bus.rsp.data(31 downto 1) := hardwareBreakpoints(i).pc.asBits
io.bus.rsp.data(0) := hardwareBreakpoints(i).valid
}
}
}
}
injectionPort.valid := False
injectionPort.payload := io.bus.cmd.data