LUT Memory
Each of the Propeller 2's Cogs has 512 longs (=2 kiB) of "Lookup RAM".
Note that Pointer Expressions can also be used for LUT memory operations.
LUT Sharing
Pairs of even/odd cogs can "share" their LUT memory. When this feature is enabled in the even cog, all writes the odd cog does to its LUT memory are also applied to the even cog's LUT. The same applies in the other direction if the odd cog enables LUT sharing. The previous contents of either LUT are not affected. LUT sharing should not be enabled in a cog that is simultaneously using the LUT for Streamer purposes (Lookup or DDS modes).
TODO: What happens if both cogs write the same location simultaneously?
LUT block transfers
It is possible to quickly transfer blocks of data between Hub and LUT memories. See Block Transfers.
Instructions
RDLUT D,{#}S/P {WC/WZ/WCZ} - Read long from LUT
Encoding | Register Written | C Flag | Z Flag | Cycles (cogexec) | Cycles (hubexec) | IRQ Shield | EEEE 1010101 CZI DDDDDDDDD SSSSSSSSS | D | MSB of data | Result == 0 | 3 | 3 | No |
---|
RDLUT reads the LUT memory location addressed by Source or a pointer expression into Destination (and as a side effect, also the Q Register). Only the bottom 9 bits of the effective address are considered, the rest are ignored.
If the WC or WCZ effect is specified, the C flag is set to the MSB (bit 31) of the read value.
If the WZ or WCZ effect is specified, the Z flag is set (1) if the read value equals zero, or is cleared (0) if it is non-zero.
WRLUT {#}D,{#}S/P - Write long to LUT
Encoding | Register Written | C Flag | Z Flag | Cycles (cogexec) | Cycles (hubexec) | IRQ Shield | EEEE 1100001 1LI DDDDDDDDD SSSSSSSSS | none | --- | --- | 2 | 2 | No |
---|
WRLUT writes Destination into the LUT memory location addressed by Source or a pointer expression. Only the bottom 9 bits of the effective address are considered, the rest are ignored.
SETLUTS {#}D - Configure LUT RAM
Encoding | Register Written | C Flag | Z Flag | Cycles (cogexec) | Cycles (hubexec) | IRQ Shield | EEEE 1101011 00L DDDDDDDDD 000110111 | none | --- | --- | 2 | 2 | No |
---|
SETLUTS configures a cog's LUT memory. If Destination[0] is set, LUT Sharing is enabled (and disabled otherwise). Other bits are currently unused and should probably be kept as zero.