Forum Discussion
Altera_Forum
Honored Contributor
12 years ago$sformatf will work as a constant function as long all of its arguments are constants in Modelsim.
The alternative is to have the generate loop block of code execute the code that does the initialization, then it doesn't need to be a constant.genvar I;
for (I=0;i<NUM;i++) begin : block
RAM inst(...);
initial $readmemh($sformatf("file%2d.dat",I),inst.mem_inst);
end : block