Shop OBEX P1 Docs P2 Docs Learn Events
Looking for a P2 Simulator — Parallax Forums

Looking for a P2 Simulator

ReinhardReinhard Posts: 489
edited 2013-03-20 09:23 in Propeller 1
hi all,
I'm searching a simulator tool for P2.
This means: generate a elf - file with the propgcc toolchain and the simulator read the elf file and process the instructions.( Like gdb, but without hardware )

I have search the web but found no hits.
Do anybody in this forum know about such a project ?

Best Regards
Reinhard

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-20 07:24
    Reinhard wrote: »
    hi all,
    I'm searching a simulator tool for P2.
    This means: generate a elf - file with the propgcc toolchain and the simulator read the elf file and process the instructions.( Like gdb, but without hardware )

    I have search the web but found no hits.
    Do anybody in this forum know about such a project ?

    Best Regards
    Reinhard
    Dave Hein was working on a P2 simulator but I'm not sure he's been updating it with Chip's latest instruction set descriptions. Maybe he'll comment on its status. His P1 simulator used to work with gdb but I'm not sure so I'm sure the version that also supports P2 can be made to work with gdb if it doesn't already.
  • Dave HeinDave Hein Posts: 6,347
    edited 2013-03-20 08:09
    The version of spinsim that is in the PropGCC repository has some support for P2. It basically implements the instructions that are available in P1, but with the P2 binary instruction values. It also implements the P2 instruction pipeline delays, the delayed jump instructions and the cached memory instructions. This is based on the P2 spec from a year ago, so some things have changed. It does not support the new I/O instructions or the new math instructions or any of the other new instructions.

    The PropGCC version of spinsim doesn't have a debugger. I do have a private version of spinsim that I worked on many months ago that supports simple debug instructions, but I haven't posted that version.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-20 08:23
    Dave Hein wrote: »
    The version of spinsim that is in the PropGCC repository has some support for P2. It basically implements the instructions that are available in P1, but with the P2 binary instruction values. It also implements the P2 instruction pipeline delays, the delayed jump instructions and the cached memory instructions. This is based on the P2 spec from a year ago, so some things have changed. It does not support the new I/O instructions or the new math instructions or any of the other new instructions.

    The PropGCC version of spinsim doesn't have a debugger. I do have a private version of spinsim that I worked on many months ago that supports simple debug instructions, but I haven't posted that version.
    While the PropGCC version if spinsim may not have a built-in debugger, I'm certain that Ken Rose had a version that worked with his early version of gdb. Maybe that could be resurrected although I think Eric has made many changes to Ken's debug code since then. Do you plan to update spinsim to match Chip's newest instruction set documentation?
  • ReinhardReinhard Posts: 489
    edited 2013-03-20 09:23
    Yep!
    spinsim is exactly the tool, what I needed ;-))

    for example - - -

    this command line:
    C:\propgcc\demos\forumists\Reinhard\DES-RSA>spinsim -p -10 -l out.txt crypto_demo.elf

    make this output:
    Cog 0: 0 000 00000000 I if_never wrbyte 000, 000
    Cog 0: 4 000 a0fc0005 mov 000, #005
    Cog 0: 8 001 a0bc03f0 mov 001, 1f0
    Cog 0: 12 002 80fc0202 add 001, #002
    Cog 0: 16 003 04bfd601 W rdword 1eb, 001
    Cog 0: 20 003 04bfd601 rdword 1eb, 001
    Cog 0: 24 004 80fc0700 add 003, #100
    Cog 0: 28 005 80fc0700 add 003, #100
    Cog 0: 32 006 e4fc0002 djnz 000, #002
    Cog 0: 36 002 80fc0202 add 001, #002

    ---

    Thank's a lot
    Reinhard
Sign In or Register to comment.