Forum Discussion

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

Automating multiple VHDL simulations in ModelSim

Hello,

I'll try to explain my problem, I'm sorry if there are some English mistakes.

I have my design in VHDL, and several VHDL testbenches, each of them simulates one component of my design.

I'm using tcl files to automate the simulation for each testbench, one after the other.

Below is a short version of my files:

go.bat :

start "Simulation of Design" /WAIT vsim -runinit -do "do All_Simulations.do"

all_simulations.do:

do Start_Simulation.do [set simulation [list {RTL arch1}]]

do Start_Simulation.do [set simulation [list {RTL arch2}]]

start_simulation.do:

# # Compilation

...

...

# Simulation

vsim -t 1ps -L lpm -L altera_mf -coverage work.testbench

run -all

quit -sim

# Save coverage reports

coverage save -code bcefs -instance sim:/testbench/top_inst ../RESULT/UCDB/${ARCH_SIM}.ucdb

The first simulation goes well until the last line of my VHDL testbench, which is "report severity failure", is reached.

My script is stuck at "run -all", and in ModelSim I see vsim <paused>

I was wondering if there were a way to quit the simulation, and not Modelsim? Maybe include something in my VHDL code?

I tried to use "stop" and "finish" from ENV package without success, indeed "stop" doesn't change anything and "finish" makes Modelsim quit.

I would be really glad if you could help me !!

Thank you

Damien

5 Replies

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

    Unfortunately i'm not able to check if it works right now

    but what I found about stop is :

    procedure STOP (STATUS : INTEGER) is

    begin

    report "Procedure STOP called with status: " & INTEGER'image(STATUS)

    severity failure;

    end procedure STOP;

    There's already a report with severity failure in my testbench, so my guess is a same result.

    Is there any other difference?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    As expected this doesn't make any difference.

    I found a beginning of a solution by using the onbreak command before "run -all":

    onbreak {

    coverage save -code bcefs -instance sim:/testbench/top_inst ../RESULT/UCDB/${ARCH_SIM}.ucdb

    quit -sim

    }

    run -all

    My .ucdb is saved and correct but "quit -sim" seems to be invisible
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Simulations will automaticcally stop at event starvation (like you stop the clock). it should also stop on a assert failure.

    but to quit the sim, and not modelsim, you can type:

    quit -sim
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I found the solution, I just added the command "resume" :

    onbreak {

    coverage save -code bcefs -instance sim:/testbench/top_inst ../RESULT/UCDB/${ARCH_SIM}.ucdb

    resume

    }

    run -all

    quit -sim

    Now I can have the hand in my .do file again and i'm no longer in "run -all", that's why I can put "quit -sim" afterwards.

    That's why I got the following message on Modelsim transcript:

    "Macro ./Start_Simulation.do PAUSED at line 131"

    I should have mentioned that before...

    Thank you for your help!