Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

altera veriog "argument 0 to readmemb must be a string literal"

Status
Not open for further replies.

permute

Advanced Member level 3
Joined
Jul 16, 2010
Messages
918
Helped
295
Reputation
590
Reaction score
266
Trophy points
1,343
Activity points
8,543
parameter FILE = ""; // modified by instantiation
...
$readmemb(FILE,ram);


Is there anyway to convert a string literal provided by a parameter into a string literal usable by readmem?

this code does work in XST, and altera even provides an example of using readmemb, but they hard code the filename in the example.
 

Thus far I've got a workaround in place, but I'd prefer it to work properly. I've made a file called ram_init.txt with an if-else structure with lines like:
if (FILE == "filename") $readmemb("filename",ram);

Then I just `include ram_init.txt within the initial block. It at least allows me to pass the filename as a parameter, even if it is a bit silly.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top