Shop OBEX P1 Docs P2 Docs Learn Events
HUB / COG behaviour — Parallax Forums

HUB / COG behaviour

VonSzarvasVonSzarvas Posts: 3,509
edited 2012-03-15 05:25 in Propeller 1
Is there some timing difference between multiple cogs waiting to access the hub, or only one cog waiting to access the hub?

To better explain the question...

Say that 8 cogs are accessing the hub in do/loops, reading unique hub values (so 1 hub value per cog), incrementing it, then writing it back.
Then each cog waits the maximum 22 clock cycles between each hub read and write?

But if only 2 cogs are running... will the hub access come around quicker for them? Now the hub does not need to spare any overhead responding to requests from all 8 cogs.
Or is the hub timing absolutely fixed, regardless of the state of each cog?

I can figure that the hub might still knock on the door of every cog, to ask if it needs to read or write, and that will take some fixed cycle time (how much.. 1 cycle?). And if the cog says yes, and writes something, then that also takes time (another 1 cycle?). But if the cog does not ask for anything.. is that cycle saved? Will the hub push onto the next cog 1 cycle faster, or will it dwell at the door of each cog for 2 cycles, regardless of what it needs to do there?


Hope this is not a previously answered question... well, has not "clicked" for me yet!
Reference this interesting thread: http://forums.parallax.com/showthread.php?125627-How-Fast-Can-you-Make-Your-Propeller

Comments

  • blittledblittled Posts: 681
    edited 2012-03-15 04:57
    The timing is fixed. It doesn't matter how many cogs are using the hub memory. It stays on each cog for the 2 cycles if needed or not.
  • VonSzarvasVonSzarvas Posts: 3,509
    edited 2012-03-15 05:25
    Thank you blittled.
    blittled wrote: »
    The timing is fixed. It doesn't matter how many cogs are using the hub memory. It stays on each cog for the 2 cycles if needed or not.

    I have been putting together a little PropBasic task which monitors a hub array and outputs the bytes to an ascii terminal (basically for writing debugging messages from all cogs without adding too much code overhead at each cog). I was concerned this might put some extra load on the hub which could upset timing for other cogs. Seems I need not have worried about that, which is good news.

    I will share the debugTask code in a new thread... it might be a useful simple debugging example for Prop and PropBasic beginners.
Sign In or Register to comment.