Shop OBEX P1 Docs P2 Docs Learn Events
p1spin — Parallax Forums

p1spin

Dave HeinDave Hein Posts: 6,347
edited 2014-03-06 15:11 in Propeller 2
p1spin is a program that runs P1 Spin binary files on a P2. The P1 binary file is included at the end of p1spin.spin using a FILE statement. p1spin maps port A from P1 to port C in P2. The serial pins 91 and 90 should be referenced at pins 27 and 26, since that is their bit positions within Port C. p1spin has been tested on the DE2 FPGA board, and under spinsim.

A sample P1 program is included that runs a Spin version of the Dhrystone 1.1 benchmark. The top object is test.spin, which uses dry11.spin and Simple_Serial.spin. Simple_Serial is identical to the one in the OBEX, except that variables are stored in a DAT section instead of VAR. The baud rate is set for 19200, but I have run it up to 57600. The binary file, test.binary is included at the end of p1spin.spin.

Comments

  • jmgjmg Posts: 15,148
    edited 2014-03-05 20:26
    Any summary of results, and the size of spinsim, relative to P1-Spin-Rom ?
  • SapiehaSapieha Posts: 2,964
    edited 2014-03-05 22:32
    Hi Dave.

    Nice work !!!

    jmg wrote: »
    Any summary of results, and the size of spinsim, relative to P1-Spin-Rom ?
  • BaggersBaggers Posts: 3,019
    edited 2014-03-06 00:54
    Awesome project Dave :D well done!
  • nutsonnutson Posts: 242
    edited 2014-03-06 04:07
    Great project, Dave, I have fired up my DE2-115 board again to try out this very usefull program. Now hoping Chip freezes the P2 instruction set soon, and the Parallax P2 emulator board becomes a succes, so pieces of great coding like this can be spread and appreciated by more people.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-03-06 04:36
    jmg wrote: »
    Any summary of results, and the size of spinsim, relative to P1-Spin-Rom ?
    The p1spin interpreter is about 1,500 longs in size, which is 3 times larger than the ROM version in P1. It's basically an unrolled version of the one that is used in P1, and uses the byte code as an index into a jump table. Because of it's size most of the interpreter executes from the hub.

    The Dhrystone benchmarks runs about 3.8 times faster in p1spin on a P2 than it does on a P1. I haven't attempted to align with hub slots or use delayed jumps so there's some room for improvement. However, the nature of the p1spin code makes it difficult to take advantage of these features.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-03-06 05:23
    Well done Dave!
  • RossHRossH Posts: 5,346
    edited 2014-03-06 14:36
    nutson wrote: »
    Great project, Dave ...

    I agree - well done, Dave.
    nutson wrote: »
    Now hoping Chip freezes the P2 instruction set soon ...

    Dream on! :lol:

    Ross.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-03-06 15:11
    Thanks for all the positive comments. It's kind of cool to grab a Spin object from the OBEX and run it on P2. One of the next things I want to try is to get FSRW to talk to an SD card on the DE2.

    BTW, I included the file spasm.txt in the zip file, which is the man page for the spinix spasm bytecode assembler. This provides some information on the bytecode names that I used in p1spin.
Sign In or Register to comment.