Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


add wave

The add wave command adds VHDL signals and variables and Verilog nets and registers to the Wave window. It also allows specification of user-defined buses.

If no port mode is specified, add wave will display all items in the selected region with names matching the item name specification.

Limitations: VHDL variables and Verilog memories can be listed using the variable's full name only (no wildcards).

Syntax

add wave

[-allowconstants] [color <standard_color_name>] [expand <signal_name>] [expandall <signal_name>] [<format>] [height <pixels>] [in] [inout] [internal]
[[
<item_name> | {<item_name> [-flatten] {sig1 sig2 sig3 ...}}] ...]... [label <name>] [noupdate] [offset <offset>] [out] [ports] [<radix>] [recursive] [scale <scale>] [window <wname>]

Arguments

-allowconstants

For use with wildcard searches. Specifies that constants matching the wildcard search should be added to the Wave window. Optional. By default, constants are ignored because they do not change.

color <standard_color_name>

Specifies the color used to display a waveform. Optional. These are the standard X Window color names, or rgb value (e.g., #357f77); enclose 2-word names ("light blue") in quotes.

expand <signal_name>

Causes a compound signal to be expanded immediately, but only one level down. Optional. The <signal_name> is required, and may include wildcards.

expandall <signal_name>

Causes a compound signal to be fully expanded immediately. Optional. The <signal_name> is required, and may include wildcards.

<format>

Specifies the display format of the items:

literal
logic
analog-step
analog-interpolated
analog-backstep

Optional. Literal waveforms are displayed as a box containing the item value. Logic signals may be U, X, 0, 1, Z, W, L, H, or `-'.

The way each state is displayed is specified by the logic type display preferences, see "Preference variables located in INI files" . Analog signals are sized by scale and by -offset. Analog-step changes to the new time before plotting the new Y. Analoginterpolated draws a diagonal line. Analog-backstep plots the new Y before moving to the new time. See "Editing and formatting HDL items in the Wave window" .

height <pixels>

Specifies the height (in pixels) of the waveform. Optional.

in

For use with wildcard searches. Specifies that the scope of the search is to include ports of mode IN if they match the item_name specification. Optional.

inout

For use with wildcard searches. Specifies that the scope of the search is to include ports of mode INOUT if they match the item_name specification. Optional.

internal

For use with wildcard searches. Specifies that the scope of the search is to include internal items (non-port items) if they match the item_name specification. Optional.

<item_name>

Specifies the names of HDL items to be included in the Wave window display. Optional. Wildcard characters are allowed. Variables may be added if preceded by the process name. For example,

add wave myproc/int1

{<item_name> [-flatten] {sig1 sig2 sig3 ...}}

Creates a user-defined bus with the name <item_name>; `sigi' are signals to be concatenated within the user-defined bus. Optional. The following option is available:

flatten

Creates an array signal that cannot be expanded to show waveforms of individual elements. Gives greater flexibility in the types of elements that can be combined, but loses the original element names. Without the -flatten option, all items must be either all scalars or all arrays of the same size. With flatten, specified items may be either scalars or various sized arrays as long as they have the same element enumeration type.


Note: You can select Edit > Combine (Wave window) to create a userdefined bus.

label <name>

Specifies an alternative name for the signal being added to the Wave window. Optional. For example,

add wave -label c clock

adds the clock signal, labeled as "c", to the Wave window.

This alternative name is not valid in a force or examine command; however, it can optionally be used in a search command with the wave option.

noupdate

Prevents Wave window from updating when a series of add wave commands are executed in series. Optional.

offset <offset>

Modifies an analog waveform's position on the display. Optional. The offset value is part of the wave positioning equation (see -scale below).

out

For use with wildcard searches. Specifies that the scope of the search is to include ports of mode OUT if they match the item_name specification. Optional.

ports

For use with wildcard searches. Specifies that the scope of the listing is to include ports of modes IN, OUT, or INOUT. Optional.

<radix>

Specifies the radix for the items that follow in the command. Optional. Valid entries (or any unique abbreviation) are:

binary
octal
decimal (or signed)
unsigned
hexadecimal
ascii
symbolic
default

If no radix is specified for an enumerated type, the default representation is used. You can change the default radix for the current simulation using the radix command. You can change the default radix permanently by editing the DefaultRadix variable in the modelsim.ini file.

If you specify a radix for an array of a VHDL enumerated type, ModelSim converts each signal value to 1, 0, Z, or X. See also, "Preference variables located in Tcl files" .

recursive

For use with wildcard searches. Specifies that the scope of the search is to descend recursively into subregions. Optional; if omitted, the search is limited to the selected region.

scale <scale>

Scales analog waveforms. Optional. The scale value is part of the wave positioning equation shown below.

The position and size of the waveform is given by:

(signal_value + <offset>) * <scale>

If signal_value + <offset> = 0, the waveform will be aligned with its name. The <scale> value determines the height of the waveform, 0 being a flat line.

window <wname>

Adds HDL items to the specified window <wname> (e.g., wave2). Optional. Used to specify a particular window when multiple instances of that window type exist. Selects an existing window; does not create a new window. Use the view command with the -new option to create a new window.

Examples

add wave -logic -color gold out2

Displays an item named out2. The item is specified as being a logic item presented in gold.

add wave -hex {address {a_7 a_6 a_5 a_4 a_3 a_2 a_1 a_0}}

Displays a user-defined, hex formatted bus named address.

add wave -r /*

Waves all items in the design.

add wave *

Waves all items in the region.

add wave -in *

Waves all input ports in the region.

add wave -hex {mybus {scalar1 vector1 scalar2}

Creates a user-defined bus named "mybus" consisting of three signals. Scalar1 and scalar2 are of type std_logic and vector1 is of type std_logic_vector (7 downto 1). The bus is displayed in hex.

Slices and arrays may be added to the bus using either VHDL or Verilog syntax. For example:

add wave {vector3(1)}

add wave {vector3[1]}

add wave {vector3(4 downto 0)}

add wave {vector3[4:0]}

add wave vec1 -hex vec2 -dec vec3 vec4

Adds the item vec1 to the Wave window using symbolic values, adds vec2 in hexadecimal, and adds vec3 and vec4 in decimal.

See also

add list, log, "Extended identifiers" , "Concatenation directives"


Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase