stop busybear from hanging

This commit is contained in:
Ben Bracker 2021-07-02 17:22:09 -05:00
parent 0bd18ff662
commit 59b177beac
3 changed files with 8 additions and 3 deletions

View File

@ -35,5 +35,6 @@ vopt work_busybear.testbench -o workopt_busybear
vsim workopt_busybear -suppress 8852,12070 vsim workopt_busybear -suppress 8852,12070
run -all
run -all run -all
quit quit

View File

@ -35,9 +35,10 @@ vopt +acc work.testbench -o workopt
vsim workopt -suppress 8852,12070 vsim workopt -suppress 8852,12070
do ./wave-dos/linux-waves.do
#-- Run the Simulation #-- Run the Simulation
run -all run -all
do ./wave-dos/linux-waves.do
run -all
##quit ##quit

View File

@ -27,8 +27,8 @@
module testbench(); module testbench();
parameter waveOnICount = 2657000; // # of instructions at which to turn on waves in graphical sim parameter waveOnICount = `BUSYBEAR*140000 + `BUILDROOT*2400000; // # of instructions at which to turn on waves in graphical sim
parameter stopICount = `BUSYBEAR*143898 + `BUILDROOT*0000000; // # instructions at which to halt sim completely (set to 0 to let it run as far as it can)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// DUT ///////////////////////////////////// ///////////////////////////////////// DUT /////////////////////////////////////
@ -248,6 +248,9 @@ module testbench();
if (instrs == waveOnICount) begin if (instrs == waveOnICount) begin
$display("turning on waves at %0d instructions", instrs); $display("turning on waves at %0d instructions", instrs);
$stop; $stop;
end else if (instrs == stopICount && stopICount != 0) begin
$display("Ending sim at %0d instructions (set stopICount to 0 to let the sim go on)", instrs);
$stop;
end end
// Check if PCD is going to be flushed due to a branch or jump // Check if PCD is going to be flushed due to a branch or jump