add clock trigger mechanism and URL interface for reset pin

This commit is contained in:
BigEd 2010-11-06 17:21:50 +00:00
parent e885646e5e
commit 758d53bf5b
2 changed files with 10 additions and 0 deletions

View File

@ -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);

View File

@ -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();}
}