Is This Possible Yet? Efficient Use of HUB RAM
Brian Fairchild
Posts: 549
in Propeller 1
A few years ago the answer to this question was 'NO'. I wonder if things have changed?
Using a P1 programmed in 'C'.
At boot 32k is automagically loaded from the external memory into HUB memory. Eight 2k (max) blocks get loaded into the 8 COGs which start doing their own thing using COG RAM for storage etc. Can the full 32k of HUB, as it is now no longer needed by the COGs or boot process, be used as a contiguous block of RAM?
Using a P1 programmed in 'C'.
At boot 32k is automagically loaded from the external memory into HUB memory. Eight 2k (max) blocks get loaded into the 8 COGs which start doing their own thing using COG RAM for storage etc. Can the full 32k of HUB, as it is now no longer needed by the COGs or boot process, be used as a contiguous block of RAM?
Comments
the COGs are running in COG mode, loaded with a C function (or 2k of assembly).
The P1 hardware has not changed, so the same limitations apply. Not sure if cog0 can be reloaded with PASM code after the spin interpreter loads the other 7 cogs, but afaik all 8 cogs can access all 32K of hub ram.
The cogs only have the one mode where they execute the P1 machine language instructions. Any "C function" would be converted to PASM by the C compiler, loaded into hub ram, and then to cog ram.
When I originally asked the question the limitation was the software. So, I guess the question is "can prop-gcc do this?"
Why can't they run with a local stack?
It seems crazy that a multi-core processor can't run all its cores totally stand-alone and independently of each other.
Thanks David. I'd overlooked the lack of addressing modes.
In C, I think it is more straightforward to make a buffer, load the PASM image from some outside source like high EEPROM, then reuse the buffer for something else. But the basic principle would be similar.