Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Cog and Hub timings — Parallax Forums

Propeller Cog and Hub timings

russ christensenruss christensen Posts: 84
edited 2009-03-31 20:27 in Propeller 1
I have a question.· I wish I could have asked this to Jeff during the webinar the other day.· Is the wait to access hub ram increased as you use more cogs?· Ex. I am using 1 cog, and the prop knows this so it lets me have hub access whenever needed, or is it more like Ex2. I'm only using one cog, but it has to allow the other cogs to access it regardeless?· That being said, in some cases would it be more efficient to have everything in one cog if splitting it into two cogs just because you can, not for the speed increase, if both cogs are extremely hubram intensive?

Russ

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2009-03-31 16:59
    No, the wait is not increased with cogs used.

    Think of it as an eight spoke rotating wheel, where only the first spoke leads to the hub - whichever cog the "hub" spoke is pointed to gets to do a read or write to the hub.

    The wheel makes a complete circuit in 16 cycles, and hub operations themselves take 7 cycles.

    If you catch the wheel at the right time (every 16 cycles, or multiple thereof), you can execute a hub operation (read/write) and two normal ops before the next hub window.

    Hope this helps,

    Bill
    russ christensen said...
    I have a question. I wish I could have asked this to Jeff during the webinar the other day. Is the wait to access hub ram increased as you use more cogs? Ex. I am using 1 cog, and the prop knows this so it lets me have hub access whenever needed, or is it more like Ex2. I'm only using one cog, but it has to allow the other cogs to access it regardeless? That being said, in some cases would it be more efficient to have everything in one cog if splitting it into two cogs just because you can, not for the speed increase, if both cogs are extremely hubram intensive?


    Russ
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • russ christensenruss christensen Posts: 84
    edited 2009-03-31 19:47
    Thank you thats exactly the answer i was looking for.· Maybe this could be improved somehow in future versions of the processor?· i dunno what it would take, but i feel that it could be a significant speed increase for programs not taking full advantage of all the cogs.

    Russ
  • ericballericball Posts: 774
    edited 2009-03-31 20:08
    The advantage of the current method is it is deterministic. Once a COG gets sync'd with the HUB, the number of cycles required to perform a sequence of instructions can be calculated exactly. If this were not true, RDLONG / OP / OP / WRLONG could get out of step with the HUB and actually take longer. Also, I'm sure the HUB logic is fairly simple which means it takes up less die space and can handle higher clock speeds.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-31 20:26
    There was a very long thread discussion on just this sort of question. Chip proposed a variable hub timing scheme where the number of timeslots available to particular cogs could be adjusted. There were enough issues that came up regarding the loss of determinism that the idea was dropped. One of the great benefits of the current architecture is that you can predict exactly what two cogs will be doing once they've been sync'd with each other. This is vital for very high speed processing where two cogs can alternate tasks in lockstep.
  • russ christensenruss christensen Posts: 84
    edited 2009-03-31 20:27
    i see. Thanks for answering these questions. I'll put the idea's out of my mind. [noparse]:)[/noparse]
Sign In or Register to comment.