IXP1200 Programming: The Microengine Coding Guide for the Intel IXP1200 Network Processor Family

Fundamentally, both intra-microengine and inter-microengine programming require the same tools:
A mechanism to share information between threads.
A mechanism to synchronize access to this shared information.
For intra-microengine programming, shared variables are the mechanism of choice for sharing information between the threads. Shared variables provide extremely fast access to the shared information because they are implemented with shared, or absolute, registers. From a performance perspective, this fast access makes shared variables an ideal inter-thread communication channel. However, since each microengine has its own set of registers, an absolute register is only accessible by the threads of the same microengine. So shared variables are not suitable for intermicroengine state sharing.
Since registers are not available, the solution for inter-microengine information sharing is memory. Any of the memory types scratchpad, SRAM, and SDRAM can be used for inter-microengine information sharing because each memory type is accessible from every microengine.
So which memory do you use for inter-microengine shared information? Well, the answer is, it depends. Each of these memory types provides a tradeoff in terms of size, latency, and special operations. Unless your shared information is too large to fit in a particular memory type, or you need to use a particular special operation available on only one memory type, you need to experiment to find out which memory type is best.
| Note | When in doubt, we tend to use SRAM for shared memory. SRAM offers a middle ground in terms of size, latency, and unique features like LIFOs, atomic... |