Electronic – Multi-Port RAM (1 write port, many read ports)

portramverilogvhdlxilinx

I have a project where I may need a 128 KB lookup RAM. I have 1 write port which writes the lookup values at the start of the application. I will have more than 2 read ports (I am assuming 4). I do not want to replicate the 128 KB RAM 4 times for the sake of space.

I wanted to know if it is possible to build a multiport RAM using Xilinx BRAMs by simply adding n RdAddr/RdDataOut ports ? Is this possible. What do I need to take care of when I try to do this ?

Is there an open-source project which has done this, so I dont have to reinvent the wheel ?

Thanks for your info.

RRS

Best Answer

Assuming you need a read cycle on each port on each clock cycle, each BRAM will give you two read ports. Beyond that, you have to replicate the contents of the memory.

Is the bandwidth required at each port less than the raw bandwidth of the BRAM? In that case, you might consider multiplexing the ports. Use a counter that runs at the full speed of the BRAM to drive a multiplexer that scans the address bus for each port, feed these addresses to the BRAM, and then deliver the data (typically 2 clocks later) to the corresponding data bus for each port.

The downside of this approach is that the access latency for each port is now N clocks longer than the non-multiplexed case. There are various ways to deal with this latency, including adding additional pipeline stages to the other data paths.

Note that with a 2-port BRAM inside the module, you can scan two of the external ports at a time.