Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

Verilog initfile for inferred-RAM, $readmemh won't accept parameter-argument

I've written the following code in a Systemverilog design-file:

   module font_2ram# ( 
  parameter init_file = "font88_8.txt" ) ( ... );
   reg   memory ;
    initial $readmemh( init_file, memory );  // 8x8 (half-height) font

Unfortunately, Quartus-II doesn't like it:

Error (10853): Verilog HDL error at font_2ram.sv(43): argument 0 to $readmemh must be a string literal

Instead, I have to hardcode the string in the $readmem command itself:

module font_2ram ( ... );
   reg   memory ;
    initial $readmemh( "font88_8.txt", memory );  // 8x8 (half-height) font

Xilinx XST 9.1 accepts a parameter-argument to $readmemh() just fine.

I don't suppose this could be a new feature for Quartus 8.x?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Could you file an SR? This post is for people to help each other with stuff already working, but there is no ownership. (It can be worthwhile to see if other people are requesting this, if someone has a workaround etc., but there is no guarantee Altera will fix an issue because it was posted here.) Thanks.