Multi-cog system application image
0000
Posts: 11
Hello,
I'm wondering how the propeller manage a multi-cog application image.
That means, at the boot up procedure, the propeller will execute the first public method thanks to his
spin interpreter and on each cognew() it will copy part of image into the corresponding cog's RAM?
There are so many things about the propeller which are undocumented, it looks like a magical microcontroller.
I'm wondering how the propeller manage a multi-cog application image.
Assembly code is loaded from Main RAM (the application image) into Cog RAM and executed directly, which is why it is so much faster than Spin code.
That means, at the boot up procedure, the propeller will execute the first public method thanks to his
spin interpreter and on each cognew() it will copy part of image into the corresponding cog's RAM?
There are so many things about the propeller which are undocumented, it looks like a magical microcontroller.
Comments
When you compile code for the propeller it is converted either into SPIN byte-code or assembly tokens. That stuff then sits in the hub memory which can be read or written to by all of the eight processors. The other processors must be started first be they do anything. Only core 0 turns on by default and executes the first PUB in your code.
Then, the cognew command just tells the next free core to load up its personal cog ram with part of the main ram and start executing whatever code that was it just loaded up in ASM. Alternative the cognew command can tell a core to start running the SPIN interpreter ASM program which is located in the propeller chip's ROM. This gives you the ability to startup multiple SPIN interpreters which can execute SPIN byte-code.
And what happens if the AsmAddress is near the end of the global RAM? e.g. COGNEW(0x7FF0)
You the programmer, must assume that any un-initialized registers will contain junk. So, if you write code that takes up 130 longs... then any of the last (496 - 130) = 369 registers will just have junk in them. The last 16 special purpose registers are always initialized to 0 on startup.