kwaj said:
I am attempting to simulate a design in ModelSim. Is a command to get the
simulator to display the current value of a variable? For instance, I would
like to see the current value of a variable (note not signal) called
"nstates"...how might I do this?
You can specify a variable using a hierarchical path at the command
line, just as you would for a signal, but remembering to include
the name of its enclosing process. For example:
entity Device...
architecture D of Device is
begin
P: process
variable V: ...
begin
end process P;
end architecture D;
entity TopLevel...
architecture T of TopLevel is
begin
U: entity work.Device(D); -- instance
end architecture T;
Now you can refer to the variable V from ModelSim's command
line as
/TopLevel/U/P/V
NOTE the process name P in that path.
If you fail to name the process, ModelSim will cook up
a name for you based on its line number in the file.
From the ModelSim GUI, get the Process window, select
the process containing your variable, then bring up a
Variables window.
In matlab, simply typing the value of the
variable would give its current value...
what is the vhdl equivalent?
This is not a VHDL issue. When you're typing at the ModelSim
command prompt you are using Tcl, not VHDL. ModelSim adds
various commands to Tcl, such as [examine] and [force],
allowing you to interact with the running simulator's data
structures.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: (e-mail address removed)
Fax: +44 (0)1425 471573 Web:
http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.