Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
dsd1-10 / dsd-07=Verilog / comparescan.pdf
Скачиваний:
95
Добавлен:
05.06.2015
Размер:
760.57 Кб
Скачать

Comparescan User Guide

Writing Comparescan Rules

Command Syntax and Options

The following sections describe the commands that you can use in the rules file that you specify with a given comparison. General command syntax and options are described first, followed by specific syntax, options, and examples for each command.

General Command Syntax

Comparescan rules have the form:

command arguments [options] [{#|//} comment]

Arguments are usually module names or signal names that you want to compare.

Options set the values for comparison parameters. For example, to change the setup time from the default of 0 to 20ns, use the option -setup 20ns.

Comments begin with a comment character (# or //) and continue to the end of the line.

Example

The following rule compares two signals, with a tolerance window of 35ns. The signal names are arguments, and the tolerance setting is an option.

compare top.signal1 top.signal2 -tol 35ns # sample rule

Implied Arguments

Sometimes arguments can be implied so that you do not have to explicitly enter them. For example, if you specify only one object for comparison, Comparescan looks for an object that has the same name in each of the files that you are comparing.

//Implied arguments. The following two rules are equivalent: compare top.signal1 top.signal1

compare top.signal1

//Similarly, the following two rules are equivalent: clkcompare top.clk top.signal1 top.clk top.signal1 clkcompare top.clk top.signal1

Option Order

You can specify options in any order.

// Option order. The following two rules are equivalent:

December 2000

58

Product Version 1.9

Comparescan User Guide

Writing Comparescan Rules

compare top.signal1 -setup 10 -hold 20 compare top.signal1 -hold 20 -setup 10

// Similarly, the following two rules are equivalent: datafile1 golden.trn -start 300 -end 2000

datafile1 golden.trn -end 2000 -start 300

Commenting

A comment begins with a comment character: either # or //. A comment can begin at the beginning of a line or at the end of a rule. Comparescan ignores all text from a comment character to the end of that line.

# Comment to the end of the line. // Comment to the end of the line.

datafile1 golden.trn # Comment to the end of the line. datafile2 test.trn // Comment to the end of the line.

Continuing Long Lines

Use a backslash character (\) at the end of a line to continue that statement on the next line. The backslash must be the last character on the continued line.

compare top.module1.module2.module25.signalA \

top.module1.module4.module25.signalZ \

-neg 10 -pos 20 // These three lines are all one rule.

Command Summary

Table 6-1 on page 59 lists all of the Comparescan commands that you can use in rules files.

Table 6-1 Comparescan Rules File Commands

Command

Description

 

 

datafile1

Specifies the golden simulation file.

datafile2

Specifies the secondary or test simulation file.

compare

Performs an event-matching comparison. Every event in the

 

golden simulation must match an event in the test simulation.

 

You can specify a tolerance window to facilitate this type of

 

matching.

December 2000

59

Product Version 1.9

 

Comparescan User Guide

 

Writing Comparescan Rules

 

Table 6-1 Comparescan Rules File Commands

 

 

Command

Description

 

 

clkdef

Defines a name for a clock that you want to use in a clock

 

comparison.

clkcompare

Performs a clock-edge sample comparison and stability

 

check. A clock compare is very useful for comparing signals

 

that have many uninteresting transitions before stabilizing.

stability

Performs a clock-edge stability check, but does not perform a

 

clock-edge sample comparison.

sequencetime

Includes sequence time in the event stream.

nosequencetime

Ignores sequence time events.

report

Generates ASCII comparison reports.

savedata

Saves the error database into a file for later viewing.

loaddata

Loads the error database into a Comparescan window for

 

viewing.

statemapping

Defines a mapping between logic states.

threshold

Defines a mapping from analog values to logic states.

translate

Translates a simulation results database file to SST2

 

database format.

 

 

December 2000

60

Product Version 1.9

Comparescan User Guide

Writing Comparescan Rules

General Command Options

Option values that you specify in a Comparescan rules file override any option values that you specify on the Compare Options form.

Note: To ensure that the your comparison behaves in the same way each time you run it, you should specify all of the options for a comparison in a rules file.

You may want to use the Compare Options form to create global option settings that apply to all rules for which you have not set some other value in the rules file.

Comparescan applies the option values that you specify in a rules file according to an algorithm. See “Setting compare Command Options” on page 71 and “Setting clkcompare Command Options” on page 79 for a description of this algorithm.

You can use the options that are listed below with any command in the rules file. Options that apply only to specific commands are described in the sections for those commands below.

Table 6-2 Global Options

Option

Description

Default Value

-maxerrors N

(Error Count Limit Per Signal on the Compare Options form)

-totalerrors N

(Error Count Limit on the Compare Options form)

Stop processing a signal when N errors

-maxerrors 10

are found on that signal. Processing

 

continues with the next signal or rule.

 

-maxerrors 0 means report all of the

 

errors on each signal.

 

Stop processing the rules file when N

-totalerrors 100

errors are found. Rules file processing

 

does not continue, and the comparison

 

ends.

 

-totalerrors 0 means report all

 

errors.

 

-start N

Specifies the simulation time at which

-start

(Start Time on the

the comparison begins.

SimStartTime

 

 

Compare Options form)

 

 

-end N

Specifies the simulation time at which

-end SimEndTime

(End Time on the

the comparison stops.

 

 

 

Compare Options form)

 

 

December 2000

61

Product Version 1.9

Comparescan User Guide

Writing Comparescan Rules

Table 6-2 Global Options, continued

Option

Description

Default Value

 

 

 

-shift N

Specifies the amount by which the time

-shift 0

(Time Shift on the

is shifted.

 

 

 

Compare Options form)

 

 

-shift1 N

Specifies the amount by which the time

-shift1 0

 

is shifted in the golden simulation.

 

-shift2 N

Specifies the amount by which the time

-shift2 0

 

is shifted in the test simulation.

 

-clockshift N

Specifies the amount by which the time

-clockshift 0

 

is shifted for the clocks that are defined

 

 

within a clkcompare command.

 

 

This option shifts the times in both the

 

 

golden file and the test file.

 

-clock1shift N

Specifies the amount by which the time

-clock1shift 0

 

is shifted for the clocks that are defined

 

 

in the golden file.

 

-clock2shift N

Specifies the amount by which the time

-clock2shift 0

 

is shifted for the clocks that are defined

 

 

in the test file.

 

-ignorestrength

Specifies that this comparison ignores

-ignorestrength

 

all signal strengths.

 

-checkstrength

Specifies that this comparison requires

-ignorestrength

 

all signal strengths to match exactly.

 

-tol N

Specifies both the positive and negative

-tol 0

 

tolerance for a matching event.

 

 

The tolerance is the window of time

 

 

during which a signal may match. The

 

 

default positive and negative tolerance

 

 

is 0. This means that by default, each

 

 

golden event must match each test

 

 

event exactly.

 

December 2000

62

Product Version 1.9

Comparescan User Guide

Writing Comparescan Rules

Table 6-2 Global Options, continued

Option

Description

Default Value

-pos N

(Positive Tolerance on the Compare Options form)

-neg N

(Negative Tolerance on the Compare Options form)

Specifies the positive tolerance for a -pos 15 matching event. This is the window of

time after a golden event during which a test event may match.

Specifies the negative tolerance for a -neg 15 matching event. This is the window of

time before a golden event during which a test event may match.

Specifying Units on Time Options

You can specify time units whenever you specify a time. If you do not specify units with a given time, Comparescan uses the simulation time unit setting for that time. For a list of the valid time units that you can specify, see Table 6-3 on page 63.

Note: If the timescale of a simulation is larger than the result of a timescaled option value, Comparescan reads that time value as zero. For example, if the simulation timescale is in seconds, and you specify the option -pos 10ms, the actual time value that Comparescan uses is 0.

Below are some examples of the use of time units in a rules file:

compare top.signal -tol 20ns

clkdef clk top.clk -sample 15ns

clkcompare top.clk top -pos 10ps -neg 100ps

Use the strings that are shown in the Time Unit column below with your time options.

Table 6-3 Time Units and Scale Factors

Time

Time Unit

Power of Ten

 

 

 

attoseconds

as

-18

femtoseconds

fs

-15

picoseconds

ps

-12

nanoseconds

ns

-9

microseconds

us

-6

December 2000

63

Product Version 1.9

 

Comparescan User Guide

 

 

Writing Comparescan Rules

 

 

 

Table 6-3 Time Units and Scale Factors, continued

 

 

 

 

Time

Time Unit

Power of Ten

 

 

 

milliseconds

ms

-3

centiseconds

cs

-2

deciseconds

ds

-1

seconds

s

0

decaseconds

Ds

1

hectoseconds

hs

2

kiloseconds

ks

3

megaseconds

Ms

6

gigaseconds

Gs

9

teraseconds

Ts

12

petaseconds

Ps

15

exaseconds

Es

18

December 2000

64

Product Version 1.9

Соседние файлы в папке dsd-07=Verilog