Shop OBEX P1 Docs P2 Docs Learn Events
SETRACE Report Generator — Parallax Forums

SETRACE Report Generator

ozpropdevozpropdev Posts: 2,792
edited 2013-12-09 03:37 in Propeller 2
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
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

  • Cluso99Cluso99 Posts: 18,069
    edited 2013-12-06 09:18
    Nice work Brian. IIRC the pin xfr mode to aux can run in the background, so perhaps this is doable on the DE0 to some extent?
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-12-06 09:22
    +1

    Nice work!
    Cluso99 wrote: »
    Nice work Brian. IIRC the pin xfr mode to aux can run in the background, so perhaps this is doable on the DE0 to some extent?
  • potatoheadpotatohead Posts: 10,261
    edited 2013-12-06 09:40
    Thank you!

    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.
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-12-06 18:57
    Cluso99 wrote: »
    Nice work Brian. IIRC the pin xfr mode to aux can run in the background, so perhaps this is doable on the DE0 to some extent?

    Ray,
    Just posted a variant that runs in the same COG as the test code.
    So full steam ahead for DE0 too. :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-12-06 21:37
    Excellent!
    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.
  • rjo__rjo__ Posts: 2,114
    edited 2013-12-08 05:06
    Is the wait x broken too? Maybe that is why the serial version of Chip's balls demo isn't working?
  • ozpropdevozpropdev Posts: 2,792
    edited 2013-12-08 05:27
    rjo__ wrote: »
    Is the wait x broken too? Maybe that is why the serial version of Chip's balls demo isn't working?

    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. :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-12-09 03:37
    My LMM execution unit is working nicely on the latest DE0 code. I have replaced th tx and rx to use the serial uart. I now only need to mod the disassembler for the new instruction set.
Sign In or Register to comment.