Altera_Forum
Honored Contributor
11 years agoprevent write/write collision in on-chip True Dual Port Ram
Hi,
FPGA: Cyclone V SoC On-chip Memory: Ram, True Dual Port, single clock, Old_data Two NIOS will have access to the ram (NIOS A to Ram port S1, NIOS B to Ram port S2) In Altera documentation of On-chip memory implementations page 8 (link: http://www.altera.com/literature/hb/cyc/cyc_c51007.pdf) it is written that True Dual Port Mode support "two write operations". Also in Altera documentation (link: http://www.altera.com/literature/ug/ug_ram_rom.pdf) Page 4-8, shows that if two Write operations to the same address happened at the same time, an unknown data will be written to that address. Conclusion: the two write operations to the same address at the same time should be avoided. Question: How to avoid write/write collision? My suggested solution: create 1 bit bidirectional PIO and connect it to the both NIOS's (without exporting it to outside Qsys) https://www.alteraforum.com/forum/attachment.php?attachmentid=8962 For example: NIOS A should read(check) this bit if it is "1" (1 means write in progress) and wait till it goes to "0", then NIOS A will set this bit to 1 and make the required writing, after that it returns the bit to "0" ....same for NIOS B Is this an efficient solution? How can I implement similar behavior in Quartus? (not in NIOS) Best Regards hbs