Forum Discussion
Altera_Forum
Honored Contributor
16 years agoOk I got it so far. I am using the M4K memory within an other design unit. Here is the simplified code:
module LocalMem(...);
parameter cpuid = 0;
M4K memory (
.clock(clk),
.data(m4k_data),
.rdaddress(m4k_rdaddress),
.wraddress(m4k_wraddress),
.wren(m4k_wren),
.q(m4k_q)
);
defparam memory.altsyncram_component.init_file = {"mem", cpuid, ".mif"};
endmodule
module TestLocalMem(...);
LocalMem# (.cpuid(1)) localmem_inst(...);
endmoduleThis does not work. Within the defparam line, cpuid seems to be empty. No matter what I set cpuid to, the file "mem.mif" gets loaded. I have also tried this to make cpuid the correct ASCII value: defparam memory.altsyncram_component.init_file = {"mem", 8'd48 + cpuid, ".mif"};but no change... Maybe you have another hint for me?