Altera_Forum
Honored Contributor
16 years ago$readmemb and $readmemh cannot accept parameters!
I have a design that infers memory and I would like to initialize memory from a file. I used $readmemb and $readmemh and a filename parameter that is passed to the block.
parameter P_MEM_FILE = "mem_ini.txt", $readmemb( P_MEM_FILE, memory, 0, P_DEPTH-1 ); Quartus complains about the parameter! Error (10853): Verilog HDL error at cw_memory_sp.v(248): argument 0 to $readmemb must be a string literal File: cw_memory_sp.v Line: 248 If I have a fixed string as the filename in $readmemb, it works fine. I would like to reuse the same code among different synthesis tools and it is frustrating when one vendor does not support this. Has anyone encountered this? Or do you have any workarounds? -- Amal