FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-25-2007, 07:44 PM
Andreas Ehliar
Guest
 
Posts: n/a
Default Re: Modelsim simulation progress in batch/command line mode?

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

I haven't tested it much since I just wrote it, but it seems to work
fairly ok.

/Andreas
Reply With Quote
  #2 (permalink)  
Old 04-25-2007, 08:26 PM
M. Hamed
Guest
 
Posts: n/a
Default Modelsim simulation progress in batch/command line mode?

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?

Thank you.

Reply With Quote
  #3 (permalink)  
Old 04-26-2007, 03: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
  #4 (permalink)  
Old 04-26-2007, 02:46 PM
Andreas Ehliar
Guest
 
Posts: n/a
Default Re: Modelsim simulation progress in batch/command line mode?

["Followup-To:" header set to comp.arch.fpga.]
On 2007-04-26, Terry Brown <[email protected]> wrote:
> Is there a reason people don't suggest just using an always block in the
> test bench?
>
> For example, I use:
>
> //this is a status heartbeat for batch mode operation
> integer microseconds;
> reg heartbeat;
> always #10000 microseconds = microseconds + 10;
> always @ (microseconds)
> if (heartbeat)
> $display("%d us",microseconds);
>
> This has the advantage on not requiring tcl (and the scripting is an
> enhanced, pay for it option), and is portable to other simulators.


The major advantage of using the TCL based approach is that you are sure
that your simulation status will be printed with the same frequency,
(more or less depending on the scheduling of the after command in TCL)
regardless of CPU speed and design complexity.

On the other hand, your approach is more useful in general since you
are able to print much more interesting data than the simulation time
such as for example the number of transactions your testbench has
performed.


/Andreas
Reply With Quote
  #5 (permalink)  
Old 04-26-2007, 04:04 PM
Terry Brown
Guest
 
Posts: n/a
Default Re: Modelsim simulation progress in batch/command line mode?

On Wed, 25 Apr 2007 11:26:07 -0700, M. Hamed 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?
>
> Thank you.


Is there a reason people don't suggest just using an always block in the
test bench?

For example, I use:

//this is a status heartbeat for batch mode operation
integer microseconds;
reg heartbeat;
always #10000 microseconds = microseconds + 10;
always @ (microseconds)
if (heartbeat)
$display("%d us",microseconds);

This has the advantage on not requiring tcl (and the scripting is an
enhanced, pay for it option), and is portable to other simulators.

Terry Brown
Tyzx, Inc.
Reply With Quote
  #6 (permalink)  
Old 04-26-2007, 05:36 PM
NigelE
Guest
 
Posts: n/a
Default Re: Modelsim simulation progress in batch/command line mode?

On Apr 25, 7:26 pm, "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?
>
> Thank you.


ModelSim SE and Questa users can use the JobSpy tool to monitor and
interact with batch jobs, including those running under LSF and Grid
Engine load sharing software.

One of the available JobSpy commands is 'now', which prints the
current simulation time.

Have a look at the 'Monitoring Simulations with JobSpy' chapter in the
User's Manual

- Nigel

Reply With Quote
  #7 (permalink)  
Old 04-26-2007, 07:05 PM
M. Hamed
Guest
 
Posts: n/a
Default Re: Modelsim simulation progress in batch/command line mode?

Thank you. This seems to work well. I was wondering if it's possible
to format the time display to display in a certain unit like us or ns.

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulation mismatch for a basic example (Verilog-XL vs ModelSim) Scott Verilog 3 08-24-2006 03:24 AM
ncverilog: command line options Prashanth Verilog 1 03-06-2006 10:55 AM
defining a string macro from ncverilog command line Jason Zheng Verilog 2 03-30-2005 02:28 AM
VirSim command line chainastole Verilog 2 02-14-2005 07:57 PM
Post Simulation in ModelSim 5.4d Mehmood Verilog 1 10-17-2003 01:07 PM


All times are GMT +1. The time now is 05:20 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved