Forum Discussion

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

ModelSim TCL Scripts

Hi.

I am writing a .do file to compile and simulate all of my .vhd files in a project. I was wondering if anyone knows a TCL command that would make all of my .vhd files automatically show up in my ModelSim workspace that I could add to my .do so that I don't have to open all of them individually.

I am using ModelSim Altera Starter Edition 6.4a.

Thanks!

2 Replies

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

    i sometimes use the Quartus II NativeLink feature to do this. even if you don't want to use this feature all the time, NativeLink can create a simulation "template" similar to what you are describing.

    for example: i will run NativeLink RTL simulation once, copy the RTL .do file to myscript.do, edit the script (adding some internal signals, set radix, set analog view), then run the script myself in ModelSim.

    NativeLink should be pretty well covered here:

    http://www.altera.com/literature/hb/qts/qts_qii53001.pdf
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    heres the basic outline I use for all TCL files. Doing this, you do not need a modelsim project to work.

    # create the work library
    vlib work
    # map in external libraries (you may have to call in altera libraries here)
    vmap <external lib name> <external lib path>
    # compile all of the work files
    vcom -2002 <file 1>
    vcom -2002 <file 2>
    vcom -2002 <etc...>
    # start simulation
    vsim <testbench entity>
    run -all