Cog startup time
Alex Mackinnon
Posts: 25
I just wondered what the cog startup time is?
The datasheet gives the instruction time for the calling cog but I'm not sure I've seen a note anywhere of how long after that·(in clocks)·the initialized cog begins executing instructions - I assume it has to read the 512 longs of data from the hub-memory and then starts processing?
The datasheet gives the instruction time for the calling cog but I'm not sure I've seen a note anywhere of how long after that·(in clocks)·the initialized cog begins executing instructions - I assume it has to read the 512 longs of data from the hub-memory and then starts processing?
Comments
The architecture is really just that of separate, independent processors with some shared resources (I/O, hub memory). The Propeller is somewhat like the I/O processors of the Cray or CDC multiprocessing computers of years gone by.
Mike, ( as you've done something like this with your OS ) or anyone at Parallax, is there a particular way you can do this at the moment?
Cheers,
Baggers.
In the OS, the actual assembly routine along with its Spin initialization routine is in one object while the Spin routines that interact with the cog are in a second object. My intention was to provide the OS itself (which includes the cog initialization stuff) as one program while "applications", which are separate programs, would only include the Spin interface objects (not the cog initialization stuff). The OS would be loaded first. It would set up the cogs, then load and run the "application".
Each cog "driver" has its own work area allocated at the end of the hub memory. The pointers to the work areas are in fixed locations so the cog "drivers" and the Spin interface routines can find them. The program loader in the OS knows about the work areas and won't load programs into that area.
You could certainly modify the existing I/O drivers to return the address and size of the area where the assembly driver is assembled. Your program could link these areas together and use them for some kind of buffer or other data storage once the cog has been loaded.
I need a buffer for text processing in my main programme so after the main programme starts I load the image for each of the cogs into this buffer from the EEPROM, start the cog and then move onto the next one - when all the cogs are loaded my main programme can use the buffer for it's own purposes. I have a bootstrap EEPROM image that I can load to send the cog images into the post-32k EEPROM. I've also got a couple of the cog images in the buffer to preserve space in the EEPROM.
In essence all I'm doing away with is the spin wrapper and embedded cog asm in the main programme and shifting a number of cog programmes into the spare EEPROM above 32k.