Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17267 Discussions

Is it possible to use $writememb in Quartus II?

Altera_Forum
Honored Contributor II
1,758 Views

Hi all. 

 

I have a question about $writememb command in Verilog coding. 

 

I can run $readmemb command without problem, but I can't get any output from $writememb command.  

I have my code compilation passed without error, but the target file doesn't get anything written in it after run.  

 

There are very few references on google and I am rather confused whether $writememb is a valid command in Quartus II. 

If it is, can anyone share the experience on how to use the command correctly? 

 

Thanks.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,011 Views

$readmemb() works in a verilog initial block to set the initial contents of a block ram. This is valid in QuartusII to fill a register array (eg, block rams) with data at FPGA configuration time. It will work either in QuartusII (implementation) or modelsim (simulation). 

 

However, $writememb() makes no sense in an FPGA implementation itself. Write the memory contents where? $writememb() would only be valid and useful in a test bench, not the FPGA itself. It does work in modelsim (simulation) as in a test bench context.
0 Kudos
Altera_Forum
Honored Contributor II
1,011 Views

I see! Thank you ak6dn!  

Now I see what has gone wrong in my concept.  

Thank you very much for the explanation. :)
0 Kudos
Reply