Shop OBEX P1 Docs P2 Docs Learn Events
Custom Instructions — Parallax Forums

Custom Instructions

steddymansteddyman Posts: 91
edited 2014-12-20 06:31 in Propeller 1
Is there a tutorial or guide anywhere that explains how one would go about adding custom instructions in PropGCC to support changes to the verilog for the P1V?

I can see various references to custom instructions in this forum but no explanation of how GCC is modified to support them.

Comments

  • ozpropdevozpropdev Posts: 2,792
    edited 2014-12-19 16:04
    AFAIK everyone adding custom instructions are using PASM code only.
    New instructions can be included using a LONG directive. :)
  • pik33pik33 Posts: 2,366
    edited 2014-12-19 23:49
    GCC is (I think) not modified. Spin too. There are too many versions of these instructions to implement them in the compiler.
    I think the Spin interpreter can be easy modified to make use of mul.

    New instruction can be added not only with long. There is modified openspin (there is a topic in this subforum) that supports them so you can use propeller ide with this modified openspin.
    Then there is the propeller tool. It recognizes mul so you don't have to use long for multiplication.
  • steddymansteddyman Posts: 91
    edited 2014-12-20 05:11
    Thanks. I had already looked at the OpenSpin source and it is very confusing on how instructions are implemented.

    It wasn't just instructions, but the target platform I want to change. For example putting 16k of Cog ram into each cog (just as an example).
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-20 06:07
    I suspect what you really need to read up on is how libraries are created in GCC.

    I presume that your 'custom instructions' are referring to standard and non-standard library functions.

    Cog Ram doesn't have 16K of ram. At the most, it has 2K of ram minus the 16 32bit special registers. The Hubram has a total of 32K bytes available. Some of your confusion is that you are unclear on the archiecture and working with imaginary resources.
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-12-20 06:31
    Loopy,

    Steadyman has modified the P1v and loaded it into an FPGA. While they may seem to be imaginary resources in a real Propeller, they are real resources in his new virtual Propeller. He wants to be able to generate the 32 bit values for his new instructions and access his new memory. All perfectly valid expectations!
Sign In or Register to comment.