Altera_Forum
Honored Contributor
13 years agoDual port memory corruption
We have system that is using an M9K memory block for IPC between two nios2 cpus.
CPU A accesses it as tightly coupled data memory, CPU B via the data port and Avalon bus (no data cache on either cpu). The memory block is set to return OLD_DATA during concurrent read and write. One of the memory locations contains the 'write pointer' into a ring buffer, this is written by CPU A (actually updated every 125us) and polled by CPU B (along with a couple of other locations) in its idle loop. On one card the 'OLD_DATA' option doesn't seem to be working properly, CPU B reads 0x00015460 (lots of times), then 0x00015420 (invalid) followed by the valid 0x00015480 (I've added a double read & compare to detect the error). So it looks as though the read has latched a part-changed value. Does any one know if 'OLD_DATA' actually works correctly, or do we have a more general timing error.