Shop OBEX P1 Docs P2 Docs Learn Events
Is there interest in a Spin to P2 PASM compiler? — Parallax Forums

Is there interest in a Spin to P2 PASM compiler?

I have a Spin to PASM compiler that's working for the Propeller. Is there interest in having this working on Propeller 2? And by "interest" I don't mean "yes, that sounds like something cool", I mean more like "yes, I would actually use that" or even better "yes, I would contribute to that". The P2 world already has TAZ C, but that doesn't seem to have taken off. What are the requirements for a compiler to actually be used on P2? Or is PASM more than sufficient for the current P2 work?

Comments

  • Heater.Heater. Posts: 21,230
    That is a big question Eric.

    Why bother with Spin byte codes when you can have go faster native instructions? Which I understand COGs can now execute without an LMM loop. So yeah "...that sounds like something cool".

    On the other hand 32 bit wide instructions take up more space than byte codes. But hey, the P2 has 16 times more space.

    What is TAZ C? Never heard of it.





  • ColeyColey Posts: 1,110
    Yes, most definitely! I would use that.
  • Heater. wrote: »
    That is a big question Eric.

    Why bother with Spin byte codes when you can have go faster native instructions? Which I understand COGs can now execute without an LMM loop. So yeah "...that sounds like something cool".

    On the other hand 32 bit wide instructions take up more space than byte codes. But hey, the P2 has 16 times more space.

    What is TAZ C? Never heard of it.
    Taz C is a simple C compiler that I wrote for the P2. It handles a subset of the C language, and is far from being complete. At some point I may make it more C-compliant, but I haven't worked on it for a while.

    A Spin compiler for the P2 would be nice. However, I would really prefer to see the Gnu C compiler for the P2.

  • jmgjmg Posts: 15,173
    ersmith wrote: »
    I have a Spin to PASM compiler that's working for the Propeller. Is there interest in having this working on Propeller 2? And by "interest" I don't mean "yes, that sounds like something cool", I mean more like "yes, I would actually use that" or even better "yes, I would contribute to that". The P2 world already has TAZ C, but that doesn't seem to have taken off. What are the requirements for a compiler to actually be used on P2? Or is PASM more than sufficient for the current P2 work?
    An important point you missed above, is Test Coverage.
    PASM is ok for early & lowest level pin-driver testing, but very soon Ken & Chip are going to want some serious Test Code Coverage, and Spin-P2 seems a very good way to get a wide range of upper level ('known good'?) code running on P2, to exercise things.

    I'm guessing Spin-P2 is less work than Gnu C P2 ? - but both will exist eventually.
  • Cluso99Cluso99 Posts: 18,069
    Not sure when there will be a P2 Spin. I may convert my P1 Faster Spin interpreter to run on P2 and I know Chip has some things in mind for P2 Spin.

    For sure though, spin will be a sizeable part of P2 just as in P1. It is so much easier if speed and specific timing is not required.

    Having said that, a Spin to P2 PASM that does a half reasonable job would be quite useful, both for newbies to learn PASM, and for others to translate a working spin program into PASM for speed gains. Could have used a P1 version years ago. I will be looking at the P1 version later to convert Kyes SDFAT and his ASCII string converters.

    It is also likely to be of more use in P2 since we have 2x cog program space as well as hubexec.
  • If I'm not mistaken, this supports inline assembly, right?

    If so, yes I would use it.

  • msrobotsmsrobots Posts: 3,709
    edited 2016-03-21 21:24
    Eric,

    I am very impressed by your current work with spin to c or PASM.

    And as @Heater. pointed out the code space in the P2 and the hubexec makes it a perfect target for SPIN(P1) to PASM(P2).

    As far as I followed your progress, you said to me that you are even able to break the 32K barrier for SPIN on the P1 by converting to C and then compiling with PropGCC to use the external memory.

    So you created BIGSPIN and nobody even react on this.

    Without external memory your SPIN to PASM(P1) conversion is a bit of a riddle to me. I guess you use LMM for that so execution speed is better than SPIN, but the code size quadruples.

    But like PropBasic this is a very nice tool to produce fast running PASM(P1) code.

    On the P2 this is even more interesting. Just imagine having all (or most) of the OBEX available on a P2 converted to PASM(P2) just by recompiling. IMHO this would be really great. Even if it would just use digital I/O and not analog, thus just using stuff available on the P1.

    Sure it does not really make sense to use FullDuplexSerial.spin bitbanging on a P2 having serial on the smart pins now, but for converting existing projects or just using existing objects until 'native P2' replacements are written a brilliant way to migrate things from P1 to P2.

    On the other hand Dave has a point too. If a future PropGCC(P2) is able to compile your created C source, your PASM generator may be obsolete later on.

    But me, myself and I have never liked C/C++, programming COBOL formed some of my mindset and, well...

    So my options to program a P2 (If I would get a FPGA) are by now PASM(P2). Because sadly I do also have problems with FORTH. I love the idea and implementation of it, but - hmm - can't program in it.

    tl;dr;

    YES, I would absolutely love the idea to be able to produce PASM(P2) out of SPIN(P1).

    Enjoy!

    Mike

  • Heater: Dave Hein has already responded, but his Taz C compiler is a pretty neat project -- a (subset) C compiler and repacement P2 assembler.

    Dave: Working on PropGCC is, well, work. I'm sure at some point someone (perhaps Parallax) will sponsor a port of PropGCC to the new P2, but it's probably too early for that. We all remember what happened to the last P2 PropGCC port :( so it probably makes sense to hold off on that until chips are actually available, or at least taped out. Spin2pasm is a much more limited project, with a simpler code generator.

    jmg: Good point about the code coverage work. It would make sense to have high level languages available for testing, although between Taz and Tachyon Forth we already have some coverage.

    All: thanks for the encouragement.
  • Oh, and Dave Hein: thanks (again) for your spinsim project. It makes debugging code generators so much easier, it's practically indispensable. I remember you had a P2 version for P2-Hot; have you updated it to the recent P2?

    Thanks,
    Eric
  • Heater.Heater. Posts: 21,230
    Oh, that TAZ C. Excellent.

    I even managed to build it here for 64 bit Debian when you announced it back in December. It promptly slipped from my mind.

    Now if only I had a P2 ...
  • Heater. wrote: »
    Oh, that TAZ C. Excellent.

    I even managed to build it here for 64 bit Debian when you announced it back in December. It promptly slipped from my mind.

    Now if only I had a P2 ...
    I take it you're not interested in using an FPGA P2?

  • David Betz wrote: »
    I take it you're not interested in using an FPGA P2?

    FPGA is too expensive.

    I wonder... how many P1s do I need to emulate a P2?
  • DavidZemon wrote: »
    David Betz wrote: »
    I take it you're not interested in using an FPGA P2?

    FPGA is too expensive.

    I wonder... how many P1s do I need to emulate a P2?
    Too expensive for experimenting or for a product? I can believe the latter. Seems cheap enough to me for experimenting with the P2 design while waiting for real silicon. Granted the Parallax FPGA board is kind of expensive but there are boards for less than $100 that can run a couple of COGs.

  • David Betz wrote: »
    DavidZemon wrote: »
    David Betz wrote: »
    I take it you're not interested in using an FPGA P2?

    FPGA is too expensive.

    I wonder... how many P1s do I need to emulate a P2?
    Too expensive for experimenting or for a product?

    Too expensive for playing with no end goal in mind.
  • DavidZemon wrote: »
    David Betz wrote: »
    DavidZemon wrote: »
    David Betz wrote: »
    I take it you're not interested in using an FPGA P2?

    FPGA is too expensive.

    I wonder... how many P1s do I need to emulate a P2?
    Too expensive for experimenting or for a product?

    Too expensive for playing with no end goal in mind.
    For me, the end goal would be to learn something about the upcoming P2 silicon. I assume most of us will want to use it when it finally appears.

  • David Betz wrote: »
    DavidZemon wrote: »
    David Betz wrote: »
    DavidZemon wrote: »
    David Betz wrote: »
    I take it you're not interested in using an FPGA P2?

    FPGA is too expensive.

    I wonder... how many P1s do I need to emulate a P2?
    Too expensive for experimenting or for a product?

    Too expensive for playing with no end goal in mind.
    For me, the end goal would be to learn something about the upcoming P2 silicon. I assume most of us will want to use it when it finally appears.

    Agreed. My only use is playing with PropWare. Which, in turn, means the P2 is simply an exciting curiosity until PropGCC is available. Which is probably a good thing because I have a lot of work remaining on the P1 version of PropWare.
  • Heater.Heater. Posts: 21,230
    David Betz,
    I take it you're not interested in using an FPGA P2?
    I have a nano board here so I could be tempted. Is there a current P2 configuration for the nano?


  • Heater. wrote: »
    David Betz,
    I take it you're not interested in using an FPGA P2?
    I have a nano board here so I could be tempted. Is there a current P2 configuration for the nano?

    Yes, but it is hard to find these things. It's in the top post of some thread but I can't recall at present which one. I really wish Parallax would setup a repository containing the latest images for all supported boards.

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-03-22 12:14
    @Heater
    is there a current P2 configuration for the nano?

    As far as I know this is the latest :
    http://forums.parallax.com/discussion/144199/propeller-ii-emulation-of-the-p2-on-fpga-boards-prop123-a7-a9-de0-nano-de2-115-etc/p1
  • TubularTubular Posts: 4,702
    edited 2016-03-22 12:31
    Heater. wrote: »
    David Betz,
    I take it you're not interested in using an FPGA P2?
    I have a nano board here so I could be tempted. Is there a current P2 configuration for the nano?


    v7 is the latest available for the nano. There are 2 JIC files in it, i think one is for the bare DE0 and the other for the DE0 with parallax breakout. However I'm not 100% sure on it
    http://forums.parallax.com/discussion/162298/prop2-fpga-files-updated-8-feb-2016-smart-pins-v7
    From the first post in that thread you get 1 cog, 8 smart pins, and 32kB hub

    there are 2 subsequent "intermediate releases", 7X and 7Y, but I don't think they include nano compiles
  • Dave HeinDave Hein Posts: 6,347
    edited 2016-03-22 13:04
    ersmith wrote: »
    Oh, and Dave Hein: thanks (again) for your spinsim project. It makes debugging code generators so much easier, it's practically indispensable. I remember you had a P2 version for P2-Hot; have you updated it to the recent P2?

    The latest version of spinsim is compatible with the November 25th FPGA. It doesn't support any of the smart pin instructions. I think that the instructions that are supported haven't changed with the latest FPGA images, so it should probably work with binaries generated by the latest version of PNut.

    I've thought about the P2 spin2pasm question some more, and I agree that it would be useful to have a Spin compiler that generates P2 assembly. I'm slowly losing interest in the P2 chip development, and I think one of the reasons is the lack of a high level compiler for the P2. My experiment with Taz C was an attempt to create a high level language tool for the P2. I think a P2 spin2pasm utility would be a very useful tool to have, and may get more people involved in working with the P2 FPGA.
Sign In or Register to comment.