
- •Contents
- •Introducing Comparescan
- •Features
- •Applications
- •Organization of this Guide
- •Getting Started
- •Starting Comparescan
- •Specifying Input Files
- •Specifying Simulation Results Databases for Comparison
- •Specifying a Comparescan Rules File
- •Specifying a Comparescan Error Database for Viewing
- •Using Automatically Generated Files
- •Using the State File
- •Using the Preferences File
- •Using X Resources
- •Understanding Comparescan Exit Status Codes
- •Comparescan Tutorial
- •Accessing the Tutorial Source Files
- •Simulation Results Databases
- •Comparescan Rules Files
- •Generating a Comparescan Error Database
- •Viewing a Comparescan Error Database
- •Viewing Errors in Hierarchical Order
- •Viewing Errors in Signalscan Waves
- •Viewing Multiple Objects in Signalscan Waves
- •Viewing Errors in Time Order
- •Exiting Comparescan
- •Giving More Information in the Rules File
- •Reviewing the demo.rules Rules File
- •Using the demo.rules Rules File
- •Viewing Clocked Miscompares in Signalscan Waves
- •Comparescan Graphical User Interface
- •Comparescan Window
- •Menu Bar
- •File Menu
- •Tools Menu
- •View Menu
- •Window Menu
- •Button Bar
- •Application Examples
- •Making Absolute Comparisons
- •Specifying the Filename of an Object
- •Comparing Two Objects from the Same File
- •Comparing Two Objects on a Condition
- •Making Clocked Comparisons
- •Using One Clock and Two Simulation Files
- •Using One Clock and One Simulation File
- •Using Two Clocks and Two Simulation Files
- •Using Two Clocks and One Simulation File
- •Performing a Clock Compare with Timing Checks
- •Checking Stability
- •Specifying Objects in the Design Hierarchy
- •Command Option Examples
- •Specifying Start and End Times for Golden and Test Files
- •Specifying Start and End Times for Comparison
- •Specifying a Time Shift
- •Specifying compare Command Tolerance Windows
- •Special Syntax Examples
- •Commenting
- •Continuing Long Lines
- •Specifying Both a Golden and a Test File
- •Specifying Filenames Using UNIX Filename Syntax
- •Writing Comparescan Rules
- •Default Comparison Rules
- •Absolute and Clocked Comparisons
- •Rules File Parsing and Execution
- •Command Syntax and Options
- •General Command Syntax
- •Command Summary
- •General Command Options
- •datafile1
- •datafile2
- •compare
- •clkdef
- •clkcompare
- •stability
- •sequencetime
- •nosequencetime
- •statemapping
- •threshold
- •report
- •savedata
- •loaddata
- •translate
- •Frequently Asked Questions
- •Comparescan Input
- •Comparescan Output
- •How do I view a comparison report that I have generated?
- •Can I print a report of my errors?
- •Can I run the tool in batch mode?
- •Graphical User Interface (GUI)
- •How do I run the program without the user interface?
- •Why can’t Comparescan allocate colors?
- •How do I change the colors in the GUI?
- •Why can’t I read the text in the GUI?
- •Comparescan Features
- •How can I compare a digital simulation with an analog simulation?
- •How do I match an X value?
- •How do I compare only the top-level signals in my design?
- •How do I compare modules at different levels in the hierarchy?
- •What if I want a different tolerance window for every signal?
- •Comparescan Error Messages
- •What does “Out of Memory” mean?
- •What does “fork failed” mean?
- •Index

Comparescan User Guide
Writing Comparescan Rules
threshold
threshold thresholdMapName \ digitalValue1(analogValue1) \ [digitalValue2(analogValue2) \ digitalValueN(analogValueN)]
The threshold command maps an analog value to a single bit. Once you have defined this mapping using the threshold command, you can use the mapping in a comparison by using the -threshold option to the compare command.
threshold Command Syntax
The syntax of the threshold command maps an analog value to a single bit. The bit is named first, followed by the analog value in parentheses. The analog value can be either a single value or a range of values. To define a range of values, use <, >, =, or : symbols, as shown in the examples below.
It is an error to redefine a threshold map, so it is an error to use the same thresholdMapName with more than one threshold command in one Comparescan comparison.
threshold Command Examples
The following example maps any real value from 0 to 2.0 to 0, maps any real value from 3.0 to 5.0 to St1, and maps the value 2.5 to SuX.
threshold XXX \
0(0:2.0) \
St1(3.0:5.0) \
SuX(2.5)
// INCORRECT. Repeated threshold table. Results in error message.
threshold XXX 0(0:3.0)
The following example maps any real value less than 2.5 to 0, maps any real value greater than 3.0 to St1, and maps the value 2.5 to Sux.
threshold YYY \
0(<2.5) \
St1(>3.0) \
Sux(2.5)
December 2000 |
89 |
Product Version 1.9 |

Comparescan User Guide
Writing Comparescan Rules
threshold Example in a Rules File
datafile1 analog.trn datafile2 digital.trn threshold HH \
0(0:2.0) \ St1(3.0:5.0) \ Sux(2.5)
threshold ZZZ \ 0(<=2.5) \ St1(>3.0)
// Width mismatch.
compare top.real_signal1 top.digital_signal1 -threshold HH compare top.real_signal2 top.digital_signal2 \
-threshold1 HH \
-threshold2 ZZZ
December 2000 |
90 |
Product Version 1.9 |

Comparescan User Guide
Writing Comparescan Rules
report
report {-r1 | -r2} [-values] [filename]
The report command generates a summary report (-r1) or a full report (-r2) and then outputs that report either to a file or to the standard output. If you do not specify a filename,
Comparescan prints the report to the standard output.
A summary report contains the number and type of compare errors that occur during the comparison, along with the first maxerrors errors, sorted by time.
A full report contains the number and type of compare errors that occur during the comparison, along with a complete listing of every error in the database, sorted by time.
Use the -values option to include the value of in the report.
report Command Examples
To generate a summary report on the standard output, use the -r1 option as follows:
report -r1
To write a full report to a file, specify a filename with the -r2 option as follows:
report -r2 full.rpt
To write both a summary report and a full report to one file, specify a filename with both the -r1 and the -r2 options on one report command as follows:
report -r1 -r2 all.rpt
Note: Multiple report commands are not allowed in the rules file.
To write a report that includes the actual values of mismatched variables, specify the -values option, as follows:
report -r2 -values test.rpt
This produces report entries in the following style:
:"eprom_array(0)":addr value = UUUUUUUUUUUUUUUU: Signal compare mismatch with :"eprom_array(0)":addr value = 0000000000000000, between 10ns and 20ns
:"eprom_array(0)":ce value = 0: Signal compare mismatch with :"eprom_array(0)":ce value = 1, between 20ns and 70ns
December 2000 |
91 |
Product Version 1.9 |

Comparescan User Guide
Writing Comparescan Rules
savedata
savedata filename
The savedata command saves a Comparescan error database to a file for later viewing.
savedata test1.csd
savedata design1.csd
Note: To ensure that you can always view the results of any comparison that you perform, you should use the savedata command in each rules file that you create.
savedata Command Example
When you perform a comparison in batch mode that you want to examine at a later time, you can use a rules file similar to the following to save the resulting error database file:
datafile1 golden.trn
datafile2 test.trn
compare .
savedata c1.csd
Later, you can view the database file that results from the above comparison by using the File—Open menu command in the GUI, or by specifying the database file on the command line:
comparescan c1.csd
You can also view a database file by using the loaddata command in a rules file:
loaddata c1.csd
December 2000 |
92 |
Product Version 1.9 |