by scott_wilson46 · 10y ago · 0 comments
reg [31:0] mem[0:1023];
always @(posedge clk) begin
rd_data <= mem[rd_addr];
if (wr_en)
mem[wr_addr] <= wr_data;
end
Then tools like vivado, quartus, synplify will infer a 1k x 32bits ram.I was able to modify the design (moving registers from inputs to outputs - https://github.com/Elphel/x393/blob/master/x393_sata/host/el... ) to force Vivado to infer correctly, but still have suspicion that it may not always be the case. So I used wrapper modules for Block RAMS with direct instances, they can be replaced as you suggested.