diff --git a/expertWires.js b/expertWires.js index e79ed27..bd2607c 100644 --- a/expertWires.js +++ b/expertWires.js @@ -181,6 +181,12 @@ function setupParams(){ userResetLow=parseInt(value,16)%256; userResetHigh=(parseInt(value,16)>>8)%256; } else + // setup input pin events, breakpoints, watchpoints + if(name=="reset0" && parseInt(value)!=NaN){ + clockTriggers[value]="setLow('res');"; + } else if(name=="reset1" && parseInt(value)!=NaN){ + clockTriggers[value]="setHigh('res');"; + } else // run a test program, and optionally check against a golden checksum if(name=="steps" && parseInt(value)!=NaN){ userSteps=parseInt(value); diff --git a/macros.js b/macros.js index 14a6be1..341dcda 100644 --- a/macros.js +++ b/macros.js @@ -201,9 +201,13 @@ function step(){ chipStatus(); } +// triggers for breakpoints, watchpoints, input pin events +clockTriggers={}; + // simulate a single clock phase with no update to graphics or trace function halfStep(){ var clk = isNodeHigh(nodenames['clk0']); + eval(clockTriggers[cycle]); // usually undefined, no measurable performance loss if (clk) {setLow('clk0'); handleBusRead(); } else {setHigh('clk0'); handleBusWrite();} }