Forum Discussion

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

RTL Simulation

Hello, I have been using ModelSim-Altera for my RLT simulations of my FPGA designs. I usually go to Tools->Run Simulation Tool->RTL Simulation and then ModelSim launches, compiles my project, run the sim and displays the data. I have seen others simply open ModelSim, Change Directory and then run a tcl script that compiles the project and runs the testbench simulation. The tcl script is rather lengthy and I was wondering if anyone knows if Quartus can generate the the tcl script for you?

I have heard this method is faster and would like to try it out. Can anyone help me?

Thanks,

Joe

19 Replies

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

    Why not learn how to write a testbench in Verilog (or VHDL, as appropriate)? The full verilog language has lots of features that can be used to write complex testbenches (ie, behavioral verilog) that allow one to generate stimulus signals, and check results match expectations. For example, procedural TASKs come to mind as a feature I routinely used.

    I fail to see what benefit using TCL scripts would provide over and above using Verilog / SystemVerilog as a language for testbench generation.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    TCL scripts does not include testbench generation, user will still have to write their own testbench unless you use modelsim feature to create one.

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

    --- Quote Start ---

    Why not learn how to write a testbench in Verilog (or VHDL, as appropriate)? The full verilog language has lots of features that can be used to write complex testbenches (ie, behavioral verilog) that allow one to generate stimulus signals, and check results match expectations. For example, procedural TASKs come to mind as a feature I routinely used.

    I fail to see what benefit using TCL scripts would provide over and above using Verilog / SystemVerilog as a language for testbench generation.

    --- Quote End ---

    TCL scripts drive the simulator:

    create libraries

    compile files

    initialise simulation

    determine where output logs go.

    TCL has nothing to do with the testbench itself, but with actually getting the testbench running.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Kentan,

    Hello, in my modelsim directory I only see msim_transcript which has some comments and some wave commands. I did see a my_counter_run_msim_rtl_Verilog.do file and it has a vlog command which looks like a compiler command. What do you mean "you can drag the message to the top". Are you referring to your youtube clip?

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

    Tricky,

    Hello, thanks for clarifying that up. Say, are you aware of any simple examples on this topic? Something like the Youtube clip that Kentan did but would include how to write the simple tcl script?

    Thanks,

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

    Kentan,

    Hello, can you please tell me the name of the auto generate script and where to look? Say, this may be a good idea for a Youtube clip just like the one you had on generate a Testbench.

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

    Hi Joe,

    If I remember correctly, it should be the *.do files. What you can do is when the modelsim launch, scroll to the top of your message. You will see some command being use like do *.do.

    Thanks,

    Best regards,

    Kentan

    (This message was posted on behalf of Intel Corporation)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Kentan,

    Hello, thanks for information. I found the file and will try to do a simple project and a script to run in ModelSim. If I have problems you probably see a post.

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

    I got it working. In the simulation/modelsim directory there is a file called "my_counter_run_msim_rtl_Verilog.do ". I simply opened ModelSim and changed the directory to the directory of the file and then typed "do my_counter_run_msim_rtl_Verilog.do" and my simulation ran. Thanks everyone for your comments.