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

Modelsim error: Failed to open file "mem_init.mif" for reading?

Altera_Forum
Honored Contributor II
9,503 Views

Hey guys: 

 

I instantiated a synchronous RAM megafunction in my project and successfully compiled in Quartus and Modelsim. But when I run the simulation there is no waveform. I checked the Modelsim transcript it shows an error and two warnings: 

# ** Warning: (vsim-3534) [FOFIR] - Failed to open file "mem_init.mif" for reading.# No such file or directory. (errno = ENOENT) : /opt/altera/13.0sp1/quartus/eda/sim_lib/altera_mf.v(187)# Time: 0 ps Iteration: 0 Instance: /proc_testbench/DUV_2/altsyncram_component# ERROR: cannot read mem_init.mif.# ** Warning: (vsim-7) Failed to open readmem file "mem_init.ver" in read mode.# No such file or directory. (errno = ENOENT) : /opt/altera/13.0sp1/quartus/eda/sim_lib/altera_mf.v(45501) 

 

It seems that Modelsim cannot find the initial memory file. How can I solve the problem? 

Thanks in advance! 

 

Yumeng
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
6,609 Views

 

--- Quote Start ---  

Hey guys: 

 

I instantiated a synchronous RAM megafunction in my project and successfully compiled in Quartus and Modelsim. But when I run the simulation there is no waveform. I checked the Modelsim transcript it shows an error and two warnings: 

# ** Warning: (vsim-3534) [FOFIR] - Failed to open file "mem_init.mif" for reading.# No such file or directory. (errno = ENOENT) : /opt/altera/13.0sp1/quartus/eda/sim_lib/altera_mf.v(187)# Time: 0 ps Iteration: 0 Instance: /proc_testbench/DUV_2/altsyncram_component# ERROR: cannot read mem_init.mif.# ** Warning: (vsim-7) Failed to open readmem file "mem_init.ver" in read mode.# No such file or directory. (errno = ENOENT) : /opt/altera/13.0sp1/quartus/eda/sim_lib/altera_mf.v(45501) 

 

It seems that Modelsim cannot find the initial memory file. How can I solve the problem? 

Thanks in advance! 

 

Yumeng 

--- Quote End ---  

 

 

A common problem. 

quickest way is to insert your mif in simulation folder. 

 

The problem arises from mif path being correct for ip but not from sim folder.
0 Kudos
Altera_Forum
Honored Contributor II
6,609 Views

the mif file needs to be in the same directory that the simulation is run from.

0 Kudos
Altera_Forum
Honored Contributor II
6,609 Views

Thank you so much! It works!

0 Kudos
Reply