Forum Discussion

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

ModelSim-Altera Error loading design

Hello,

This is my first time using ModelSim and writing testbenches, so this may sound like a silly problem. But I am having problems simulating my project on ModelSim from Quartus II. Here is the testbench I have written up for the project:

module test_tgen;

reg CLK_IN;

reg reset;

reg IN_4ms;

reg OUT_4ms;

reg OUT_1ms;

reg OUT_20KHZ;

reg LOST_SINK;

timing_gen_block mytiming_gen(reset, IN_4ms, CLK_IN, OUT_4ms, OUT_1ms, OUT_20KHZ, LOST_SINK);

initial // Clock generator

begin

CLK_IN = 0;

forever# 8 CLK_IN = !CLK_IN;

end

initial // Test stimulus

begin

reset = 0;

IN_4ms = 1;# 5 reset = 1;# 250 IN_4ms = 0;

end

initial

$monitor($stime,, reset,, IN_4ms,, CLK_IN);

endmodule

Now this compiles just fine. But when I try to simulate it in ModelSim from Quartus II by selecting tools > run eda simulation tool > eda rtl simulation, I get the following output in ModelSim:

# Reading C:/altera/91/modelsim_ase/tcl/vsim/pref.tcl # do Timing_Gen_block_run_msim_rtl_verilog.do # if {[file exists rtl_work]} {# vdel -lib rtl_work -all# }# vlib rtl_work# vmap work rtl_work# Copying C:\altera\91\modelsim_ase\win32aloem/../modelsim.ini to modelsim.ini# Modifying modelsim.ini# ** Warning: Copied C:\altera\91\modelsim_ase\win32aloem/../modelsim.ini to modelsim.ini.# Updated modelsim.ini.# # vlog -sv -work work +incdir+C:/Users/Travis/ESSM\ FPGA\ Project/FPGA\ Code/Timing_Gen_block {C:/Users/Travis/ESSM FPGA Project/FPGA Code/Timing_Gen_block/Timing_Gen_if.sv}# Model Technology ModelSim ALTERA vlog 6.5b Compiler 2009.10 Oct 1 2009# -- Compiling module Timing_Gen_if# # Top level modules:# Timing_Gen_if# # vlog -sv -work work +incdir+C:/Users/Travis/ESSM\ FPGA\ Project/FPGA\ Code/Timing_Gen_block {C:/Users/Travis/ESSM FPGA Project/FPGA Code/Timing_Gen_block/test_tgen.sv}# Model Technology ModelSim ALTERA vlog 6.5b Compiler 2009.10 Oct 1 2009# -- Compiling module test_tgen# # Top level modules:# test_tgen# # vsim -t 1ps -L altera_ver -L lpm_ver -L sgate_ver -L altera_mf_ver -L stratixiii_ver -L rtl_work -L work -voptargs="+acc" Timing_Gen_block# vsim -L altera_ver -L lpm_ver -L sgate_ver -L altera_mf_ver -L stratixiii_ver -L rtl_work -L work -voptargs=\"+acc\" -t 1ps Timing_Gen_block # ** Error: (vsim-3170) Could not find 'C:\Users\Travis\ESSM FPGA Project\FPGA Code\Timing_Gen_block\simulation\modelsim\rtl_work.Timing_Gen_block'.# Error loading design# Error: Error loading design # Pausing macro execution # MACRO ./Timing_Gen_block_run_msim_rtl_verilog.do PAUSED at line 12

Because of the "Error loading design", my project won't go straight into the simulation . I have the Timing_Gen_block.sv file in the same folder as the others, but am unsure as how to have it recognized. Any suggestions as to what I missed or things I am doing wrong to get the "Error loading design"?

Thanks,

T Miller

4 Replies

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

    Thanks for the help guys. It turned out I left out a few key files when setting up the testbench in Quartus.

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

    The very first thing I would do is move your project to a path that does_not_contain_spaces. :)

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

    I had the exact same problem recently. I didn't really figure out exactly what has going wrong, but I figured out a way to get past it.

    The script seems to be triggering an error on the following statements:

    if {} {
        vdel -lib rtl_work -all
    }
    
    There is an error deleting rtl_work becusae it cannot be found. I have no idea how this can happen as the if statement should be checking for this case.

    To get past this, I simply loaded the script (Timing_Gen_block_run_msim_rtl_verilog.do in your case) into an editor. I then copied everything past the above lines I mentioned and pasted them into the Modelsim transcript window. The simulation then ran as normal. The next time I started the simulation from Quartus, the problem did not repeat itself.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thanks for the help guys. It turned out I left out a few key files when setting up the testbench in Quartus.

    --- Quote End ---

    can you tell me what files did you left when you were setting up the testbench in Quartus? Cause I got the same problem as you,Thanks a lot!