- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used the Verilog code below:
module Memory(
input we, clk,
input [5:0] waddr, raddr, // address width = 6
input [3:0] be, // 4 bytes per word
input [31:0] wdata, // byte width = 8, 4 bytes per word
output reg [31:0] q // byte width = 8, 4 bytes per word
);
// use a multi-dimensional packed array
//to model individual bytes within the word
(* ramstyle = "MLAB, no_rw_check" *)
logic [3:0][7:0] ram[0:63];// # words = 1 << address width
always_ff@(posedge clk)
begin
if(we) begin
if(be[0]) ram[waddr][0] <= wdata[7:0];
if(be[1]) ram[waddr][1] <= wdata[15:8];
if(be[2]) ram[waddr][2] <= wdata[23:16];
if(be[3]) ram[waddr][3] <= wdata[31:24];
end
q <= ram[raddr];
end
endmodule
=> In the fit report I found that fitter used Logic LABs resources not MLABs, and as you can see in the Verilog I added ramstyle attribute with MLAB parameter.
How can I make fitter use MLAB resources in this case?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you can do is right click the .vhdl -> insert template.
From there, look for the byte enable template and use it.
Usually, due to different coding style, it would be hard for the Quartus to determined the code to be infer. Let's us know if you still failed to infer after this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried the solution above and added the ramstyle attribute to force MLAB utilization:
attribute ramstyle : string;
attribute ramstyle of ram : signal is "MLAB, no_rw_check";
After compiling I found that fitter used logic LABs resources not MLABs as desired.
Is there any other solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May I know what device that you were using? Can you attached your design.qar here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
any update?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page