Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] modelsim - error assertion causes file to open

Status
Not open for further replies.

gbounce

Junior Member level 3
Joined
Mar 28, 2012
Messages
25
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,438
Is there a command line option to tell ModelSim not to open the .vhd/.v file when an failure assertion occurs, say from ending of a testbench?
 

You could try ending a testbench via event starvation (eg by stopping the clock)
But there is a setting (I had exactly the same thing) but I dont have modelsim at home - will check tomorrow at work.
 

thanks.

ya, it isn't a big deal, just annoying. i found another solution online, instead of asserting a failure at the end you can wait on a signal to assert from a .do file:

when -label sim_done {sim_done == '1'} {echo "Simulation finished."; stop;}
 

And heres how to do it:

Tools - Edit preference - By Name - source - Open on Break: Set it to '0' to disable window pop up.

As for killing a simulation, in VHDL I always have the following in my testbenches.


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
------------------------------------------------------------------------------------------------
--clk_proc : process to generate the clock
------------------------------------------------------------------------------------------------
vid_clk_proc : process
  variable end_time       : time;
begin
  while not ENDSIM loop
    
    clk                    <= not clk;
    
    if NOW >= TIMEOUT*CLK_PERIOD then
      KILLSIM               <= true;
    end if;
    
    if run_clk then
      wait for CLK_PERIOD/2;
    else
      wait until run_clk;
    end if;
  end loop;
  
  if KILLSIM then
    report "Simulation Timed Out after " & integer'image(TIMEOUT) & " clock cycles."
      severity warning;
      
  else
    end_time := NOW;
    
    report "Simulation ended successfully after " & time'image(end_time)
      severity note;
      
  end if;
  
  wait;
end process;
 
--------------------------------------------------------------------
--Stop all processes to starve all events and stop the simulation
--------------------------------------------------------------------
ENDSIM <=    KILLSIM 
          or (input_complete and output_complete);



Then all testbench processes contain a loop like:

while not ENDSIM loop;

This way, I know all processes will die at the end of simulation, or if the testbench didnt complete successfully, or something has hung, it wont run forever because of the timeout.
 
thanks, thats a nice way to do it. little more graceful than just using an assertion as well.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top