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

Comparescan User Guide

6

Writing Comparescan Rules

This chapter describes the syntax and semantics of Comparescan rules files.

A rules file is a text file that contains a set of Comparescan commands that specify the files or signals that you want to compare and how you want to compare them. You can limit a comparison to a portion of the design hierarchy or to a portion of simulation time. You can also define complicated functions, such as timing checks.

For an example of a rules file, see “Reviewing the demo.rules Rules File” on page 31.

Note: Rules and options that you specify in the rules file override the options that you specify on the Compare Options form.

If you do not specify a rules file on the command line or set your options on the Compare Options form, Comparescan uses a set of default rules. See “Default Comparison Rules” on page 56 for a listing of these default rules.

This chapter discusses the following topics:

“Default Comparison Rules” on page 56

“Absolute and Clocked Comparisons” on page 56

“Rules File Parsing and Execution” on page 57

“Command Syntax and Options” on page 58

December 2000

55

Product Version 1.9

Comparescan User Guide

Writing Comparescan Rules

Default Comparison Rules

Comparescan uses the following default comparison rules whenever you compare two simulation results databases without specifying a rules file on the command line or setting options on the Compare Options form and you have no ~/.comparescan.state file:

nosequencetime

compare . -depth 1 -internal -maxerrors 10

These two rules turn sequence timing off and then compare all of the internal signals in the main module of your designs. If there are more than 10 errors on any signal, Comparescan skips to the next signal.

See Table 6-2 on page 61 for a list of the default values for the compare command options.

Absolute and Clocked Comparisons

Comparescan supports two types of comparisons, absolute compare and clocked compare. An absolute compare finds all of the differences between two signals at any point in time. A clocked compare checks signal values only on the clock edges.

A clocked compare is much faster than an absolute compare and is therefore more commonly used.

An absolute compare (compare) is 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.

A clocked compare (clkcompare) is a clock-edge sample comparison and stability check. A clocked compare is very useful for comparing signals that have many uninteresting transitions before stabilizing.

The compare and clkcompare commands can take several options. You can use the -tol, -pos and -neg options to specify the window of tolerance for a comparison. The -pos option specifies the positive tolerance, or the amount of time before the edge, and the -neg option specifies the negative tolerance, or the amount of time after the edge. The -tol option specifies both the positive and negative tolerances.

When you use the clkcompare command, you must specify an additional signal as the clock signal. By default, a comparison occurs on the rising edge (-posedge) of the clock, but you can cause the comparison to occur on the falling edge or on both edges by using the

-negedge or -bothedge option.

December 2000

56

Product Version 1.9

Comparescan User Guide

Writing Comparescan Rules

The clkcompare command can also take options to perform setup and hold timing checks.

If you specify these options, Comparescan automatically checks the setup and hold times for the signals that you specify.

If you only want to check for setup and hold violations without performing any comparisons, you can use the stability command.

You can also add the when statement to your comparison commands to qualify errors. If you use the when statement, Comparescan only reports errors when the expression that you specify in the when statement evaluates to true.

Rules File Parsing and Execution

A rules file is a text file that contains a set of Comparescan commands or rules. Comparescan parses the rules file using a simple white space parser. White space is any of the following: space, tab, carriage return, or newline. A command in the rules file is made up of tokens separated by white space.

When Comparescan parses a command from the rules file, the rule interpreter executes that command immediately — that is, the effect of each command and option is immediate.

Comparescan processes options from left to right. You can specify options in any order. Options that are entered further to the right on the command line override any conflicting options that are further to the left on the same command line.

You can enter commands in any order in the rules file, with the following exceptions:

All datafile1 and datafile2 commands must precede any compare, clkdef, clkcompare, or stability commands.

If you use a clkdef command to define a clock signal, then that clkdef command must precede any use of that defined clock signal, such as in a clkcompare or stability command.

You should compare an object only once in a rules file. If you compare a signal or variable more than once in the same rules file, the error reports may be confusing. For example, if you compare top.a to top.b, and then compare top.a to top.c, Comparescan may produce error messages that are hard to understand, since the tool compares top.a twice.

December 2000

57

Product Version 1.9

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