Altera_Forum
Honored Contributor
7 years agoHow to infer MLAB memory?
I have a simple memory code
(* ramstyle = "MLAB" *) module memory_module # (parameter addr_width = 8, data_width = 32) (input clk, input [data_width-1:0] wr_data, output reg [data_width-1:0]rd_data, input [addr_width-1:0] wr_addr, input [addr_width-1:0] rd_addr, input we, input re); reg [data_width-1:0] mem [2**addr_width-1:0] /* synthesis syn_ramstyle = "MLAB"*/; always@(posedge clk) begin if (we) mem[wr_addr] <= wr_data; if (re) rd_data <= mem[rd_addr]; end endmodule And I am trying to use MLAB for this. Is there any other attribute that I am missing to infer MLABs? The attributes in the code do not work as intended.