Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add tracing of datapath control signals

  • Loading branch information...
commit 8a6fe3634f37e803daa6002162b3ce693ed0b402 1 parent 2965998
BigEd authored November 19, 2010

Showing 1 changed file with 13 additions and 8 deletions. Show diff stats Hide diff stats

  1. 21  macros.js
21  macros.js
@@ -273,18 +273,19 @@ function readPC(){return (readBits('pch', 8)<<8) + readBits('pcl', 8);}
273 273
 function readPCL(){return readBits('pcl', 8);}
274 274
 function readPCH(){return readBits('pch', 8);}
275 275
 
276  
-function listActivePlaOutputs(){
277  
-	// PLA outputs are mostly ^op- but some have a prefix too
278  
-	//    - we'll allow the x and xx prefix but ignore the #
279  
-	var r=new RegExp('^([x]?x-)?op-');
280  
-	var pla=[];
  276
+// for one-hot or few-hot signal collections we want to list the active ones
  277
+// and for brevity we remove the common prefix
  278
+function listActiveSignals(pattern){
  279
+	var r=new RegExp(pattern);
  280
+	var list=[];
281 281
 	for(var i in nodenamelist){
282 282
 		if(r.test(nodenamelist[i])) {
283 283
 			if(isNodeHigh(nodenames[nodenamelist[i]]))
284  
-				pla.push(nodenamelist[i]);
  284
+				// also map hyphen to a non-breaking version
  285
+				list.push(nodenamelist[i].replace(r,'').replace(/-/g,'&#8209'));
285 286
 		}
286 287
 	}
287  
-	return pla;
  288
+	return list;
288 289
 }
289 290
 
290 291
 function readBit(name){
@@ -311,7 +312,11 @@ function busToString(busname){
311 312
 	if(busname=='tcstate')
312 313
 		return ['clock1','clock2','t2','t3','t4','t5'].map(busToHex).join("");
313 314
 	if(busname=='plaOutputs')
314  
-		return listActivePlaOutputs();
  315
+		// PLA outputs are mostly ^op- but some have a prefix too
  316
+		//    - we'll allow the x and xx prefix but ignore the #
  317
+		return listActiveSignals('^([x]?x-)?op-');
  318
+	if(busname=='DPControl')
  319
+		return listActiveSignals('^dpc[0-9]+_');
315 320
 	if(busname[0]=="-"){
316 321
 		// invert the value of the bus for display
317 322
 		var value=busToHex(busname.slice(1))

0 notes on commit 8a6fe36

Please sign in to comment.
Something went wrong with that request. Please try again.