Forum Discussion
CAlex
Contributor
3 years agoHow to initialize a large buffer by quartus prime
Hi, I want to init my written RAM by a mif file. Here is my mif file: DEPTH = 256; WIDTH = 32; ADDRESS_RADIX = HEX; DATA_RADIX = HEX; CONTENT BEGIN 00 : 0000 0000; 01 : 0000 0000; 02 : 0000...
- 3 years ago
I discovered that we cannot use the $readmemb funciton to read a MIF file.
To read the MIF file, you should use the ram_init_file attribute instead.
You may refer to the document below for instructions on how to apply this attribute:
Best Regards,
Richard Tan
CAlex
Contributor
3 years agoHi
in the RAM design:
// initial
initial
begin
if (DPBUFFER_INITIAL_FILE == "DPbuffer_init.mif")begin
$readmemh(DPBUFFER_INITIAL_FILE,mem);
end
// read data initial
ava_read_data <= 0;
read_data <= 0;
end
I've tried different path, but the quartus still cant recognize the mif file.
I've placed the mif file both under qpf file and my IP verilog file.