Forum Discussion

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

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

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

3 Replies

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

    --- 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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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