SETRACE Report Generator
ozpropdev
Posts: 2,793
Hi All
Here is a small program that uses the SETRACE instruction to collect data on cog activity.
I've been using it on the FPGA to test stuff and get a clearer picture on P2's inner workings.
I thought you guys might have a use for it too.
For separate cog variant:
Just set up the pin exchange function and SET pin 127 to start trace.
To stop trace CLEAR pin 127 and the results will be transmitted.
For single cog variant:
SETXFR #n
exec code..
SETXFR #0
CALL #report
The Rnnn represents the record number
Tn is the task number
+nn is the cycle count from the last execution of that task
ZC represent Z/C flags
S indicates pipeline stall
F indicates condition false
X indicates a cancelled operation
$nnn is the tasks program counter (indented)
Here's a sample output
It' was designed for DE2-115 only (Apologies to DE0 users,but you need a separate cog)
Edit: Added single COG variant
Ozpropdev
Here is a small program that uses the SETRACE instruction to collect data on cog activity.
I've been using it on the FPGA to test stuff and get a clearer picture on P2's inner workings.
I thought you guys might have a use for it too.
For separate cog variant:
Just set up the pin exchange function and SET pin 127 to start trace.
To stop trace CLEAR pin 127 and the results will be transmitted.
For single cog variant:
SETXFR #n
exec code..
SETXFR #0
CALL #report
The Rnnn represents the record number
Tn is the task number
+nn is the cycle count from the last execution of that task
ZC represent Z/C flags
S indicates pipeline stall
F indicates condition false
X indicates a cancelled operation
$nnn is the tasks program counter (indented)
Here's a sample output
r000 t3 +01 ____ ____ ____ $033 r001 t0 +02 $00f ____ ____ ____ r002 t0 +01 $010 ____ ____ ____ r003 t0 +01 s $011 ____ ____ ____ r004 t0 +01 s $011 ____ ____ ____ r005 t0 +01 s $011 ____ ____ ____ r006 t0 +01 s $011 ____ ____ ____ r007 t0 +01 $011 ____ ____ ____ r008 t2 +09 ____ ____ $02d ____ r009 t0 +02 $012 ____ ____ ____ r010 t1 +11 ____ $028 ____ ____ r011 t0 +02 fx $013 ____ ____ ____ r012 t0 +01 fx $014 ____ ____ ____ r013 t2 +05 ____ ____ $02d ____ r014 t3 +14 ____ ____ ____ $030 r015 t0 +03 $012 ____ ____ ____
It' was designed for DE2-115 only (Apologies to DE0 users,but you need a separate cog)
Edit: Added single COG variant
Ozpropdev
Comments
Nice work!
With all the changes, little snippets are a big help. Much appreciated. We should start a pile of these somewhere... I've kind of lost track of all the code we've got sitting around. Some of it's old, but still valuable at this point.
Ray,
Just posted a variant that runs in the same COG as the test code.
So full steam ahead for DE0 too.
Have my P2 Debugger semi working - had to replace the tx bit-banging with SENDSER as waitcnt is not working. Now have to replace the receive end.
WAITX checks out OK
In the sample output in post #1 the $11 address in task0 is a WAIT 5 instruction that stalls the pipeline.