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

Comparescan User Guide

Application Examples

Making Absolute Comparisons

This section contains example code for rules that use the compare command. See “compare” on page 67 for more information about this command.

The following rule compares signalA in golden.trn with signalA in test.trn for an exact match (a match within a window of 0 time units). Comparescan reports an error if golden.trn or test.trn does not exist or if signalA does not exist in both databases.

datafile1 golden.trn

datafile2 test.trn

compare signalA

The following rule compares signalB in golden.trn with signalB in test.trn for a match within a window of 5 time units after the golden signal.

compare signalB -pos 5

The following rule compares signalC in golden.trn with signalC in test.trn for a match within a window of 10 time units before the golden signal.

compare signalC -neg 10

The following rule compares signalD in golden.trn with signalE in test.trn for a match within a tolerance window of [-10,5]. Comparescan reports an error if signalD and signalE are not the same in both databases.

compare signalD signalE -pos 5 -neg 10

Specifying the Filename of an Object

For a description of the :: notation used in this example, see “Variable and Module Naming in Different Files” on page 70. The notation 1:: refers to datafile1, and 2:: refers to datafile2.

// The following rules are equivalent:

compare signalA signalB

compare 1::signalA 2::signalB

compare

signalA

2::signalB

compare

1::signalA

signalB

// The following rules are legal but not equivalent: compare 1::signalA 1::signalB

compare 2::signalA 2::signalB compare 2::signalA 1::signalB

See “Specifying Filenames Using UNIX Filename Syntax” on page 53 for more information on specifying filenames in rules files.

December 2000

47

Product Version 1.9

Comparescan User Guide

Application Examples

Comparing Two Objects from the Same File

//Compares signalA with signalB in test.trn: datafile1 test.trn

compare signalA signalB

//Compares signalA with signalB in test.trn: datafile1 golden.trn

datafile2 test.trn

compare 2::signalA 2::signalB

Comparing Two Objects on a Condition

The following rules compare signalA in datafile1 with signalB in datafile2 only at times when the condition inside the quotation marks is true in datafile1. All when evaluations are performed in datafile1.

compare signalA signalB when "data[23:32] == 1"

compare signalA signalB when \

"(data[23:32] == addr[23:32]) && !reset && (cnt > 10)"

For more information on the when statement, see “Using when Statements with Verilog or VHDL Expressions” on page 75.

Creating Clock Definitions

This section contains example code for rules that use the clkdef command. See “clkdef” on page 77 for more information on this command.

The following rule defines two symbolic clocks, c1 and c2, to be used in a later clkcompare statement. These two clocks are based on the same signal from the simulation, but have different setup times.

clkdef c1 top.clockgen.clk1 -setup 100

clkdef c2 top.clockgen.clk1 -setup 200

The following rule defines a clock named c3 from datafile1.

clkdef c3 1::top.clockgen.clk3

The following rule defines a clock named c4 from datafile2.

clkdef c4 2::top.clockgen.clk3

In the following rules, a clock comparison triggers on the positive edge of the symbolic clock c5, on the negative edge of c6, and on both edges of c7.

December 2000

48

Product Version 1.9

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