View Single Post
  #3 (permalink)  
Old 04-26-2007, 02:42 AM
Jonathan Bromley
Guest
 
Posts: n/a
Default Re: Modelsim simulation progress in batch/command line mode?

On Wed, 25 Apr 2007 17:44:18 +0000 (UTC),
Andreas Ehliar <[email protected]> wrote:

>On 2007-04-25, M. Hamed <[email protected]> wrote:


>> Is there a way I can get ModelSim to display the time progress of the
>> simulation when it's running in command line/batch mode similar to
>> what it would do at the bottom of the GUI window?

>
>
>Put something like the following in a TCL script:
>proc printsimstate {} {
> global now
> global UserTimeUnit
> echo "Simulator time is $now, timescale is $UserTimeUnit"
> after 5000 printsimstate
>}
>after 5000 printsimstate


Andreas,

nice, but be aware that it will leave an "after" action lying around;
if you pause the sim (or it reaches a breakpoint) you will continue
to get "Simulator time is..." messages spitting out of the console
every five seconds.

This seems to be closer to a robust solution, although you might
also want to provide a new timed version of the "continue"
command too. Just source this Tcl script into ModelSim
before running the sim, and then use "trun" instead of "run"
to start the simulation.

# Smarter version of "run" that displays timings as it runs
proc trun {args} {
# Start the periodic runtime display
after 2000 printSimTime
# Do the usual run command
eval run $args
}
#
# Periodic time display, stops itself when the
# run is stopped or interrupted
proc printSimTime {} {
echo "time = $::now"
if { [string equal running [runStatus]] } {
after 2000 printSimTime
}
}

In my own experiments I've found that the value of "now" that this
code reports is not very reliable - presumably, thanks to the very
heavy CPU loading caused by a busy simulation, things don't always
get updated as promptly as you might hope. Even so, it's
better than nothing.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
[email protected]
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
Reply With Quote