Regarding COGID instruction
sanket
Posts: 28
Hello every one,
I have gone through the manual of propeller.
I got a problem with the instruction COGID (page -365 in propeller manual)
when processor encounter this 32 bit instruction, how can it came to know which COG it is?
Does the last 3 (LSB) bits of the source field specifies the COGID?
For example - 000011 0011 1111 ddddddddd
001
Is above instruction specifies for COG1?
and, 000 in LSB of source indicates for COG0?
Thank You
I have gone through the manual of propeller.
I got a problem with the instruction COGID (page -365 in propeller manual)
when processor encounter this 32 bit instruction, how can it came to know which COG it is?
Does the last 3 (LSB) bits of the source field specifies the COGID?
For example - 000011 0011 1111 ddddddddd
001
Is above instruction specifies for COG1?
and, 000 in LSB of source indicates for COG0?
Thank You
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: Forum
NTSC & PAL driver templates: ObEx Forum
OnePinTVText driver: ObEx Forum
I understand what you have written in reply.
If last three digits selcects one of the instruction among the HUB operation then how is it possible to say by seeing COGID instruction that which cog is running? because COGID copies the running COG's number in to destination. So is there anyway to know the running COG's number by seeing 32 bit?
Thank You
This code fragment stores the cog ID in the register labelled temp, which is then used as an argument to cogstop thereby shutting down the calling cog.
The knowledge about which cog is executing the instruction is hard-wired into the chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: Forum
NTSC & PAL driver templates: ObEx Forum
OnePinTVText driver: ObEx Forum
Your last question was "how does the COGID instruction know which cog is executing it?".
The HUB logic knows. Remember that the hub allows access to the shared 32K of memory every 16 clock cycles. Internal to the hub logic is a counter that holds the number of the cog currently accessing the hub. The COGID instruction simply copies this counter to a cog memory location.