add tracing of named nodes

This commit is contained in:
BigEd 2010-11-01 19:36:52 +00:00
parent cd05762f20
commit 294918789a
3 changed files with 35 additions and 20 deletions

View File

@ -122,10 +122,12 @@ $().ready(function(){
<div id="tracingdiv">
<div id="expertControlPanel">
<form>
<form action="javascript:updateLogList()">
<input type="button" value="Trace more" onclick="updateLoglevel(++loglevel)" />
<input type="button" value="Trace less" onclick="updateLoglevel(--loglevel)" />
<input type="button" value="Clear Log" onclick="updateLoglevel(loglevel)" />
<input type="button" value="Trace these too:" onclick="updateLogList()" />
<input type="text" id="LogThese" name="LogThese" value="" />
<input type="button" value="Clear Log" onclick="updateLoglevel(loglevel)" />
</form>
<br />
</div>

View File

@ -1,5 +1,5 @@
/*
Copyright (c) 2010 Brian Silverman, Barry Silverman
Copyright (c) 2010 Brian Silverman, Barry Silverman, Ed Spittles
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -101,6 +101,7 @@ function setup_part3(){
function setup_part4(){
setupTable();
setupNodeNameList();
logThese=signalSet(loglevel);
loadProgram();
if(noSimulation){
running=undefined;
@ -293,7 +294,8 @@ function handleClick(e){
function updateLoglevel(value){
loglevel = value;
initLogbox(signalSet(loglevel));
logThese = signalSet(loglevel);
initLogbox(logThese);
}
function updateExpertMode(isOn){

View File

@ -25,6 +25,17 @@ var cycle = 0;
var trace = Array();
var logstream = Array();
var running = false;
var logThese=[];
var presetLogLists=[
['cycle'],
['ab','db','rw','sync','pc','a','x','y','s','p'],
['ir','tcstate','pd'],
['adl','adh','sb','alu'],
['alucin','alua','alub','alucout','aluvout','dasb'],
['plaOutputs'],
['idb','dor'],
['irq','nmi','res'],
];
function loadProgram(){
// a moderate size of static testprogram might be loaded
@ -146,32 +157,32 @@ function initChip(){
refresh();
cycle = 0;
trace = Array();
initLogbox(signalSet(loglevel));
initLogbox(logThese);
chipStatus();
if(ctrace)console.log('initChip done after', now()-start);
}
var logThese=[
['cycle'],
['ab','db','rw','sync','pc','a','x','y','s','p'],
['ir','tcstate','pd'],
['adl','adh','sb','alu'],
['alucin','alua','alub','alucout','aluvout','dasb'],
['plaOutputs'],
['idb','dor'],
['irq','nmi','res'],
];
function signalSet(n){
var signals=[];
for (var i=0; (i<=n)&&(i<logThese.length) ; i++){
for (var j=0; j<logThese[i].length; j++){
signals.push(logThese[i][j]);
for (var i=0; (i<=n)&&(i<presetLogLists.length) ; i++){
for (var j=0; j<presetLogLists[i].length; j++){
signals.push(presetLogLists[i][j]);
}
}
return signals;
}
function updateLogList(){
// user supplied a list of signals, which we append to the set defined by loglevel
logThese = signalSet(loglevel);
var tmplist = document.getElementById('LogThese').value.split(/[\s,]+/);
for(var i=0;i<tmplist.length;i++){
if(typeof nodes[nodenames[tmplist[i]]] != "undefined")
logThese.push(tmplist[i]);
}
initLogbox(logThese);
}
var traceChecksum='';
var goldenChecksum;
@ -383,7 +394,7 @@ function chipStatus(){
chk=" Chk:" + traceChecksum + ((traceChecksum==goldenChecksum)?" OK":" no match");
setStatus(machine1, machine2, "Hz: " + estimatedHz().toFixed(1) + chk);
if (loglevel>0) {
updateLogbox(signalSet(loglevel));
updateLogbox(logThese);
}
selectCell(ab);
}