Forum Discussion
Altera_Forum
Honored Contributor
16 years agoIf you really want to do a shared memory region, you don't need the "flag", but you do need a hardware Mutex to allow the processors to be sure which one is allowed to write to critical memory locations e.g. to create a Mailbox mechanism: a CPU sets a bit to say: "mailbox contains data", the other CPU clears the bit to say: "data read and can be replaced" by new data. These operations need to be protected against each other. Altead SOPC-Builder does provide a Mutex on the Avalon bus for that purpose. I suppose it can issue an interrupt so that one CPU can notify the other of changes of the mailbox state.
If the shared memory is a "hardware" unit dedicated for communication, this will not slow down the CPUs, as (AFAIK) the Avalon "bus" is not a real bus, but a link between any master and any slave is created, so that accesses from two masters to different slaves can be done in parallel . -Michael