Shop OBEX P1 Docs P2 Docs Learn Events
SimpleIDE/PropGCC Code Generation Question. — Parallax Forums

SimpleIDE/PropGCC Code Generation Question.

Just Curious. I am looking at the assembly code generated for a C program. It appears that the assembly generated for code in the HUB uses RDLONG/WRITLONG instructions. Does these instructions have a fixed execution time in the HUB or a variable instruction time as when executed in a COG?

Comments

  • Heater.Heater. Posts: 21,230
    RDLONG/WRLONG and similar are so called HUB operations. Their timing is variable and depends on the relation to the round robin HUB access cycle.

    The Propeller Manual gives all the details.

    By the way, all the instructions are executed in a COG. For code that is run from HUB the instructions have to be fetched from HUB RAM by a tight fetch, execute loop.


  • I just assumed that a main .c code would have a direct (tight read/write?) to the HUB RAM instead of the RDLONG/WRLONG timing. So....doesn't work as I assumed.

    Thanks for the clarification.
  • To be more precise the hub operations work on a 16 clock cycle for any particular cog - but if you don't know
    the clock phase the first hub instruction encountered can take 7 to 22 cycles (if I recall rightly)
Sign In or Register to comment.