Skip to content

Commit

Permalink
implement SpinalHDL#176 DebugPlugin.allowEBreak is now disabled until…
Browse files Browse the repository at this point in the history
… the debug bus is used.
  • Loading branch information
Dolu1990 committed Apr 20, 2021
1 parent 38064f4 commit d226dd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/vexriscv/plugin/DebugPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ class DebugPlugin(var debugClockDomain : ClockDomain, hardwareBreakpointCount :
val isPipBusy = RegNext(stages.map(_.arbitration.isValid).orR || iBusFetcher.incoming())
val godmode = RegInit(False) setWhen(haltIt && !isPipBusy)
val haltedByBreak = RegInit(False)
val allowEBreak = RegInit(False) setWhen(io.bus.cmd.valid)
// val allowEBreak = if(!pipeline.serviceExist(classOf[PrivilegeService])) True else pipeline.service(classOf[PrivilegeService]).isMachine()


val hardwareBreakpoints = Vec(Reg(new Bundle{
val valid = Bool()
Expand Down Expand Up @@ -277,8 +280,6 @@ class DebugPlugin(var debugClockDomain : ClockDomain, hardwareBreakpointCount :
}
}

val allowEBreak = if(!pipeline.serviceExist(classOf[PrivilegeService])) True else pipeline.service(classOf[PrivilegeService]).isMachine()

decode.insert(DO_EBREAK) := !haltIt && (decode.input(IS_EBREAK) || hardwareBreakpoints.map(hb => hb.valid && hb.pc === (decode.input(PC) >> 1)).foldLeft(False)(_ || _)) && allowEBreak
when(execute.arbitration.isValid && execute.input(DO_EBREAK)){
execute.arbitration.haltByOther := True
Expand Down
5 changes: 4 additions & 1 deletion src/test/cpp/regression/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2824,13 +2824,16 @@ class DebugPlugin : public SimElement{
socklen_t addr_size;
char buffer[1024];
uint32_t timeSpacer = 0;
bool taskValid = false;
bool taskValid;
DebugPluginTask task;


DebugPlugin(Workspace* ws){
this->ws = ws;
this->top = ws->top;
taskValid = true; //true as a Workaround to enable the ebreak
task.wr = false;
task.address = 0;

#ifdef DEBUG_PLUGIN_EXTERNAL
ws->mTimeCmp = ~0;
Expand Down

0 comments on commit d226dd8

Please sign in to comment.