- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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? -- AmalLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't like `defines but using a `define instead of a parameter should solve the issue.
Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't want to define all the different ROM files that we use. I don't like defines either unless they are managed properly, which they are not most often.
-- Amal
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page