If D is a register and WC is used, the next-available (newly started) cog gets written into D. This is intended for 'cognew' cases, where D[3] was set, going into the COGINIT, indictating that you wanted to start the first available cog, and WC was used, so that C would get set if there were no available cogs.
If D is a register and WC is used, the next-available (newly started) cog gets written into D. This is intended for 'cognew' cases, where D[3] was set, going into the COGINIT, indictating that you wanted to start the first available cog, and WC was used, so that C would get set if there were no available cogs.
Did you mean D[4]?
So, given the following combinations (where D is not an immediate value):
* D[4] not set, WC not set -> C is not altered, D is not altered
* D[4] not set, WC is set -> C is set always set to 0, D is not altered
* D[4] is set, WC not set -> C is not altered, D is not altered
* D[4] is set, WC is set -> If cog is available, set C to 0 and D to new cog ID; otherwise set C to 1 and D is not altered.
D is always altered if it is a register and WC is used, whether or not D[4] is set. Of course, if WC is used and D is a register, you'd certainly have D[4] set.
D mode D[4] WC C D (out) Note
------- ------- --- --- --------------- --------------------------------------------
imm 0 0 -> C D Always succeeds
imm 0 1 -> 0 D Always succeeds
imm 1 0 -> C D May fail, but result not captured
imm 1 1 -> 0 D Succeeded, don't know new cog ID
-> 1 D Failed
reg 0 0 -> C D Always succeeds
reg 0 1 -> 0 D[3:0] Always succeeds
reg 1 0 -> C D May fail, but result not captured
reg 1 1 -> 0 new cog ID Succeeded, new cog ID captured
-> 1 undefined Failed, D is still overwritten\
Comments
Did you mean D[4]?
So, given the following combinations (where D is not an immediate value):
* D[4] not set, WC not set -> C is not altered, D is not altered
* D[4] not set, WC is set -> C is set always set to 0, D is not altered
* D[4] is set, WC not set -> C is not altered, D is not altered
* D[4] is set, WC is set -> If cog is available, set C to 0 and D to new cog ID; otherwise set C to 1 and D is not altered.
D is always altered if it is a register and WC is used, whether or not D[4] is set. Of course, if WC is used and D is a register, you'd certainly have D[4] set.
Look correct?