PDA

View Full Version : Propeller Cog and Hub timings



russ christensen
03-31-2009, 11:47 PM
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

Bill Henning
03-31-2009, 11:59 PM
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 (http://www.mikronauts.com) - a new blog about microcontrollers

russ christensen
04-01-2009, 02:47 AM
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

ericball
04-01-2009, 03:08 AM
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 Green
04-01-2009, 03:26 AM
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 christensen
04-01-2009, 03:27 AM
i see. Thanks for answering these questions. I'll put the idea's out of my mind. :)