Shop OBEX P1 Docs P2 Docs Learn Events
Simple HUB access timing question — Parallax Forums

Simple HUB access timing question

godzichgodzich Posts: 74
edited 2011-12-22 04:05 in Propeller 1
Hi,

Sorry if asked before but could not find an answer with a quick search. I'm doing lots of PASM programming and want to keep the timing consistent. Fully aware of zero extra overhead access time to HUB ram - if you obey the following rule and place two PASM instructions between each HUB access instruction:

...
pasmhub access instruction (first HUB access takes 8...23 clocks)
pasm instruction (4 clocks)
pasm instruction (4 clocks)
pasmhub access instruction (execution time now only 4 clocks)
pasm instruction (4 clocks)
pasm instruction (4 clocks)
pasmhub access instruction (execution time now only 4 clocks)
...

The question, is the following also true?:

...
pasm HUB access instruction (first HUB access takes 8...23 clocks)
pasm instruction (4 clocks) 1st
pasm instruction (4 clocks) 2nd
pasm instruction (4 clocks) 3rd (could als be a HUB access - but not necessarily)
pasm instruction (4 clocks) 4th
pasm instruction (4 clocks) 5th
pasm HUB access instruction 6th (execution still only 4 clocks ?)
pasm instruction (4 clocks) 7th
...

Can I trust that consecutive HUB accesses takes only 4 clocks if I sync the HUB access once, and then obey the rule to make a (possible) hub access only at every third PASM (4 clock) instruction? This is not explicitly stated anywhere?!

Cheers,

Christian

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-12-22 01:26
    Minimal hub access time is 8 cycles (penalty 0..15). And yes, once you are in sync and you place your hub ops at 16n from there you don't get the penalty (the 16 cycle window is based on 8 cogs running with an interleave of two cycles). FWIW, the first cog instruction is -4 cycles relative to the cog's hub window.
  • godzichgodzich Posts: 74
    edited 2011-12-22 04:00
    Hi Kuoneko,

    Sorry, my mistake, HUBops takes at minimum 8 clocks if "synced", not 4. Otherwise I'm right - or?

    So the trick is that if HUB instructions occur after every 16th system clocks they stay in sync (after an initial synced HUBop) and they then always execute in 8 clocks if this every 16th clock rule is obeyed!?

    Christian
  • kuronekokuroneko Posts: 3,623
    edited 2011-12-22 04:05
    godzich wrote: »
    So the trick is that if HUB instructions occur after every 16th system clocks they stay in sync (after an initial synced HUBop) and they then always execute in 8 clocks if this every 16th clock rule is obeyed!?
    Correct. You can always fit 4n+2 normal (4-cycle) insns between hubops without violating sync.
Sign In or Register to comment.