I am trying to build a RAM block in Verilog with the following configuration:
- Port A: 128 bit wide, with clk_a, sees RAM block as 128 bit wide times 128 lines deep
- Port B: 32 bit wide with clk_b, sees RAM block as 32 bit wide times 512 lines deep
Do not worry about READ-WRITE serialization and mutexing, I will be taking care of it with a layer above that.
Basically, the code that generates the 128 bit times 128 lines looks like:
reg [DATA_WIDTH-1:0] mem [0:2**ADDRESS_WIDTH-1];
Now, if I want it to look like 32 bit times 512 deep, how do I refactor this memory to look different (kind of like a recast in C) ? I understand that I might be able to do this with 32 bit word enable(s), but I am trying to see if there is a cleaner way to achieve this.
Let me know what you think ?
RRS
Correction: I am referring Xilinx BRAM (BRAMs cant be 512 deep). But this is essentially a memory block with the glue logic chaining multiple BRAMs. Thanks for pointing out !!