Results 1 to 5 of 5

Thread: Can't use testbench in Modelsim - error loading design

  1. #1
    Join Date
    Mar 2016
    Posts
    18
    Rep Power
    1

    Default Can't use testbench in Modelsim - error loading design

    Hi everyone,

    First I want to say that I searched all the threads here, and while this is a common problem, I could not figure out how to solve it.

    I am trying to use a small testbench I wrote using the Quartus testbench template writer, but I am getting this error:
    Code:
     ** Error: (vsim-3170) Could not find 'C:/Users/nettek/QuartusProjects/Final Project - 11.3.16 - par/test/simulation/modelsim/rtl_work.tb_test1'.
    # 
    # Error loading design
    # Error: Error loading design
    #        Pausing macro execution
    # MACRO ./Test_run_msim_rtl_vhdl.do PAUSED at line 14
    Steps I took:
    1. Created a BDF file with two components in it, obviously it has input/output ports and some internal signals.
    2. Created an HDL file from the BDF file. Added it to project. Removed the BDF file from project (did not delete it).
    3. Created a testbench using the Quartus template writer.
    4. Added the VHT file to project.
    5. Took to Assignments -> Settings -> EDA tool settings -> Simulation ->
    Chose compile test bench and chose the VHT file.
    6. Tools -> Run simulation tool -> RTL simulation which opened Modelsim.

    Of course I always made sure to compile whenever I needed to.

    I don't understand this problem, just two days ago it didn't happen and now it does. What could be the problem?

    Also, I would appreciate if you could tell me how to test internal signals of a BDF file in Modelsim using a testbench. I know that I can give the signals names, turn the BDF file into a HDL file and then compile it in Modelsim, and then force the signals, but I want to use a testbench to make this be automatic. Problem is, using a testbench, I only see the input/outputs.

    Thank you!
    Last edited by nettek; March 13th, 2016 at 12:29 AM.

  2. #2
    Join Date
    Sep 2012
    Location
    Albuquerque, NM USA
    Posts
    748
    Rep Power
    1

    Default Re: Can't use testbench in Modelsim - error loading design

    I don't think modelsim will work if there are spaces or characters that are illegal for linux anywhere in your path. Try renaming your directory "FinalProject_11.3.16_par" and see if that works. You will need to update your project file as well. BTW, I like to write dates like 20160311 so that a series of dated files will sort correctly.

  3. #3
    Join Date
    Mar 2016
    Posts
    18
    Rep Power
    1

    Default Re: Can't use testbench in Modelsim - error loading design

    Thanks for your answer. Unfortunately changing the folder name did not help (I didn't think it would, as this thing worked before with the previous folder name), though I'm not sure what you meant by updating project file.

    Anyway, I have to say that despite this not working, I can actually go to work/rtl_work from Modelsim, right click the VHT file and simulate. The test bench is working correctly, it seems. But I have another problem.
    Last edited by nettek; March 15th, 2016 at 03:17 AM.

  4. #4
    Tricky is online now Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,825
    Rep Power
    1

    Default Re: Can't use testbench in Modelsim - error loading design

    Quote Originally Posted by nettek View Post
    I don't understand this problem, just two days ago it didn't happen and now it does. What could be the problem?
    This looks like theres files missing in MODELSIM. I suggest driving modelsim yourself and not relying on Quartus to do this for you. The commands are very straightforward. If you have files a.vhd and b.vhd with the top level entity called "testbench" inside a.vhd, then all you need to do is this in the modelsim console:

    vcom a.vhd
    vcom b.vhd
    vsim testbench

    (use vlog instead of vcom for verilog files).

    Also, I would appreciate if you could tell me how to test internal signals of a BDF file in Modelsim using a testbench. I know that I can give the signals names, turn the BDF file into a HDL file and then compile it in Modelsim, and then force the signals, but I want to use a testbench to make this be automatic. Problem is, using a testbench, I only see the input/outputs.

    Thank you!
    BDF files cannot be simulated, so you can only see what is in the generated HDL file. As for driving them, with verilog you can always force/drive any signal within the hierarchy. With VHDL this requires you to use VHDL 2008. But if you need to drive internal signals then I suggest you have a problem with the design - testbenches should only ever drive the DUT io. You can always monitor internal signals on the wave window or log them in your HDL.

  5. #5
    Join Date
    Mar 2016
    Posts
    18
    Rep Power
    1

    Default Re: Can't use testbench in Modelsim - error loading design

    Tricky, thank you. You're right, it's best to open these files in Modelsim itself and not through Quartus.

    I have actually found a solution to this, I'll post it here in case others run into the same problems: (assuming vhdl and not verilog)

    1. If you have a BDF file like me, use Quartus to create an HDL file from it (file -> create/update -> create HDL file...)
    2. Open a project in Modelsim
    3. Add all the vhd files in your design, include of course the main HDL file
    4. Open the main HDL file so that the code appears (you can edit it, etc.)
    5. In the menu, click on source -> show language templates
    6. In the new window that just opened, double click create Testbench
    7. Write your testbench code
    8. Compile the files, click simulate, and choose to simulate the testbench file in your work library

Similar Threads

  1. Error loading design in Modelsim
    By krithika.anand in forum Quartus II and EDA Tools Discussion
    Replies: 10
    Last Post: February 1st, 2016, 05:53 AM
  2. Error loading design in Modelsim Altera
    By jasonjinct in forum Quartus II and EDA Tools Discussion
    Replies: 0
    Last Post: April 8th, 2014, 07:53 PM
  3. ModelSim-Altera Error loading design
    By travis.miller in forum Quartus II and EDA Tools Discussion
    Replies: 4
    Last Post: September 18th, 2010, 12:12 AM
  4. Error Loading Design in Modelsim
    By woeichee in forum Quartus II and EDA Tools Discussion
    Replies: 0
    Last Post: June 8th, 2010, 12:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •