How does LUT sharing work?
ersmith
Posts: 6,053
in Propeller 2
OK, I get that we have to allocate an even/odd pair of COGs (call them cog #0 and cog #1) and that a COG that wants to receive writes has to issue SETLUTS #1. Let's say cog #0 does SETLUTS #1. Then:
(1) Do all wrlut calls in cog #1 result in writes to both the cog #1 and cog #0 LUT?
(2) Assuming the answer to (1) above is "yes", is there any way for cog #1 to write to its own LUT (only) and not to its partner's?
(3) Does SETQ2/RDLONG in cog #1 also write to both LUTs?
(1) Do all wrlut calls in cog #1 result in writes to both the cog #1 and cog #0 LUT?
(2) Assuming the answer to (1) above is "yes", is there any way for cog #1 to write to its own LUT (only) and not to its partner's?
(3) Does SETQ2/RDLONG in cog #1 also write to both LUTs?
Comments
I think the answers are:
(1) Yes.
(2) No, apart from SETLUTS #0 in cog 0.
(3) Yes.
Whole LUT is shared, I believe. The half LUT behaviour is that reads/writes are not possible in upper half using immediate addressing. Note that either paired cog reading/writing top four longs in LUT can set selectable-event flags 1 to 4, therefore it might be better not to put fixed lookup tables at very top of LUT RAM if sharing is enabled.
revA silicon has a design flaw on coinciding read and write at same address. revB is fixed.
If both cogs are sharing both ways, be careful not to have coinciding writes at same address. That doesn't work. Shouldn't be needed anyway, with only two parties.
Is any of this dependent on SETLUTS #1?
It was added for LUT-LUT communication so I would presume yes but we will need to hear from the master