Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


compare add

The compare add command compares signals in a reference design against signals in a test design. You can specify whether to compare two signals, all signals in the region, or just ports or a subset of ports. Constant signals such as parameters and generics are ignored. See Waveform Comparison chapter for a general overview of waveform comparisons.

Syntax

compare add

-clock <name> [-help] [-label <label>] [-list] [-<mode>] [-nowin]
[
-rebuild] [-recursive] [<referencePath>] [<testPath>]
[
-separator <string>] [-tolLead <delay>] [-tolTrail <delay>] [-verbose]
[
-wavepane <n>] [-wave] [-when {<expression>}] [-win <wname>]

Arguments

-clock <name>

Specifies the clock definition to use when sampling the specified regions. Required for a clocked comparison; not used for asynchronous comparisons.

-help

Lists the description and syntax for the compare add command in the Transcript window. Optional.

-label <label>

Specifies a name for the comparison when it is displayed in the Wave window. Optional.

-list

Causes specified comparisons to be displayed in the default List window. Optional.

-<mode>

Specifies the mode of signal types that are compared. Optional. The actual values the option may take are -in, -out, -inout, -internal, -port, and -all. You can use more than one mode option in the same command.

-nowin

Specifies that compare signals shouldn't be added to any window. Optional. By default, compare signals are added to the default Wave window. See -wave below.

-rebuild

Rebuilds a fragmented bus in the test design region and compares it with the corresponding bus in the reference design region. Optional. If a signal is found having the same name as the reference signal, the -rebuild option is ignored. When rebuilding the test signal, the name of the reference signal is used as the wildcard prefix.

-recursive

Specifies that signals should also be selected in all nested subregions, and subregions of those, etc. Optional.

<referencePath>

A full path to the reference signal, region, or glob expression. Optional. If not specified, ModelSim uses the top region of the reference dataset. If the reference path is a region or glob expression, then the test path must be a region (or left blank). If the reference path is a signal, the test path can be a signal or a region.

<testPath>

A full path to the test signal or region. Optional if the test path is the same as the reference path except for the dataset name.

-separator <string>

Used with the -rebuild option. When a bus has been broken into bits (bit blasted) by a synthesis tool, ModelSim expects a separator between the base bus name and the bit indication. This option identifies that separator. The default is "_". For example, the signal "mybus" might be broken down into "mybus_0", "mybus_1", etc.

-tolLead <delay>

Specifies the maximum time a test signal edge is allowed to lead a reference edge in an asynchronous comparison. Optional. The default is 0. If a unit (e.g., ps) is used with the time value, the time must be placed in curly braces.

-tolTrail <delay>

Specifies the maximum time a test signal edge is allowed to trail a reference edge in an asynchronous comparison. Optional. The default is 0. If a unit is used (e.g., ps) with the time value, the time must be placed in curly braces.

Graphical representation of tolLead and tolTrail

-verbose

Prints information in the Main window confirming the signals selected for comparison and any type conversions employed. Optional.

-wavepane <n>

Specifies the pane of the Wave window in which the differences will be viewed. Optional.

-wave

Specifies that compare signals be added automatically to the default Wave window. Optional. Default.

-when {<expression>}

Specifies a conditional expression that must evaluate to "true" or "1" for differences to be reported. Optional. The expression is evaluated at the start of an observed difference. See "GUI_expression_format" for legal expression syntax.

-win <wname>

Specifies a particular window to which to add items. Optional. Used to specify a particular window when multiple instances of that window type exist.

Examples

compare add

Selects signals in the reference and test dataset top region according to the default mode. Uses asynchronous comparison with the default tolerances. Assumes that the top regions of the reference and test datasets have the same name and contain the same signals with the same names.

compare add -port -clock myclock10 gold:.test_ringbuf.ring_inst

Selects port signals of instance .test_ringbuf.ring_inst in both datasets to be compared and sampled on strobe myclock10.

compare add -all -r gold:/top/cpu test:/testbench/cpu

Selects all signals in the cpu section to be compared asynchronously using the default tolerances. Requires that the reference and test relative hierarchies and signal names within the cpu section be identical, but they need not be the same above the cpu section.

compare add -clock clock12 gold:.top.s1

Specifies that signal gold:.top.s1 should be sampled at clock12 and compared with test:.top.s1, also sampled at clock12.

compare add -tolLead {3 ns} -tolTrail {5 ns} gold:/asynch/abc/s1 sim:/flat/sigabc

Specifies that signal gold:/asynch/abc/s1 should be compared asynchronously with signal sim:/flat/sigabc using a leading tolerance of 3 ns and a trailing tolerance of 5 ns.

compare add -rebuild gold:.counter1.count test:.counter2.cnt

Causes signals test:.counter2.cnt_dd to be rebuilt into bus test:.counter2.cnt[...] and compared against gold:.counter1.count.

See also

compare annotate, compare clock, compare configure, compare continue, compare delete, compare end, compare info, compare list, compare options, compare reload, compare reset, compare run, compare savediffs, compare saverules, compare see, compare start, compare stop, compare update, and Waveform Comparison chapter


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