Shop OBEX P1 Docs P2 Docs Learn Events
Cog Memory Dump? — Parallax Forums

Cog Memory Dump?

grahamreitzgrahamreitz Posts: 56
edited 2009-09-05 02:24 in Propeller 1
Is there a method to dump the contents of a cog's memory? I am working in pasm. It doesn't need to be real time. All that is necessary is to dump the contents once a pasm program has completed.

I apologize if this has been answered before. I entered 'cog,memory,dump' (no quotes) and received no results. Although, I found a post by cluso that had exactly that phrase. It only seems to work if I enter only one search item.

Thanks,
graham

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-05 00:27
    Here's a link to one assembly debugger (http://forums.parallax.com/showpost.php?p=0).

    There's no way to access the cog's memory from another cog, so any dump scheme has to be made part of the program running in the cog. The easiest way to do this would be to just add a loop to the end of your program to copy the contents of the cog to a 2K buffer in the hub. You can then dump it from the hub buffer any way you want.

    dumpLoop    wrlong    dumpDest,0                    ' Write 4 bytes to the end of the hub
                       add        dumpLoop,#1                 ' Increment the source
                       add        dumpDest,#4                 ' Increment the destination
                       djnz       dumpCount,#dumpLoop  ' Repeat for 512 longs
                       cogid     dumpTemp                     ' Now stop the cog
                       cogstop  dumpTemp
    dumpDest     long       $8000 - $800
    dumpCount   long       $200
    dumpTemp   long       0
    

    Post Edited (Mike Green) : 9/5/2009 12:55:59 AM GMT
  • grahamreitzgrahamreitz Posts: 56
    edited 2009-09-05 00:33
    Thanks Mike. That should work nicely.
  • jazzedjazzed Posts: 11,803
    edited 2009-09-05 02:24
    I've used PASD for a couple of years now. It is a good tool.
    You could also try my BMA debugger which has a dump feature and other things. It is pure Spin/PASM.

    BMA Debugger Started.
    PC 007 nop    : nop     00000000   N D:000 083C01F3 S:000 083C01F3 D=000 083C01F3
    d
    000: 083C01F3 08BC0BF5 E87C0A01 08BC0BF5 EC7C0A03 5C7C0000 5C7C8001 00000000
    008: 5C7C001F 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    010: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    018: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 A0BC17F0
    020: 04BC200B A0FC1201 2CBC1210 68BC3809 80FC1602 04BC200B A0FC1401 2CBC1410
    028: 68BC380A 80FC1602 A0BC180B 80FC1604 A0BC1A0B 80FC1604 A0BC1E0B 80FC1604
    030: A0BC1C0B 80FC1604 A0BC340B A0BFE809 A0BFEC09 64BFEC0A 5C7C0043 0ABC25F0
    ....
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve

    Propeller Tools
Sign In or Register to comment.