
- •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
loaddata
loaddata filename
The loaddata command opens a Comparescan binary error database file that was previously saved with the -save command-line option, the savedata rules file command, or the File—Save or File—Save as GUI menu command.
Note: You rarely need to use the loaddata command. Most often, you choose File—Open from the Comparescan menu to load a previously saved database from within Comparescan, or use a command such as the following at the operating system command line, where error_data.csd is a Comparescan error database:
comparescan error_data.csd
loaddata Command Example
To load the error database that was saved to file test1.csd, use the following command in a rules file:
loaddata test1.csd
December 2000 |
93 |
Product Version 1.9 |

Comparescan User Guide
Writing Comparescan Rules
translate
translate [-f] input_filename [SST2_output_filename]
The translate command translates a simulation results database file into SST2 database format.
If you do not specify the SST2_output_filename, Comparescan generates a filename automatically, based on the input_filename that you specify. The automatically generated SST2 output filenames are the same as the input_filename, after removing any extension and adding the .trn and .dsn extensions.
For example, the following command:
translate /simresults/cpu1/test1.dump
generates files named:
/simresults/cpu1/test1.trn
/simresults/cpu1/test1.dsn
You can also use the translate command to give the new file any name and location you wish, as follows:
translate /tmp/xyz.dump ~/designs/cpu1/SST2/xyz
If the file SST2_output_filename is newer than the file input_filename, Comparescan does not generate the output files.
If the file SST2_output_filename already exists, Comparescan does not overwrite the existing output files unless you specify the -f option with the translate command. The -f option forces Comparescan to write to the specified output files, even if they already exist.
For example, the following command translates the VCD file test1.vcd into SST2 format and writes it to the files mydesign.trn and mydesign.dsn:
translate /simresults/cpu1/test1.vcd mydesign
The following command translates the VCD file test2.vcd into SST2 format and overwrites the SST2 files that the previous command created:
translate -f /simresults/cpu1/test2.vcd mydesign
Generally, the translate command supports all of the formats that are supported by Signalscan Waves, including VCD format.
Note: Normally, you do not need to use the translate command. You can specify a file in any supported simulation results format with the datafile1 and datafile2 commands in the rules file, on the command line, or in the GUI options settings. If Comparescan finds a file
December 2000 |
94 |
Product Version 1.9 |

Comparescan User Guide
Writing Comparescan Rules
that is not in SST2 format, Comparescan automatically translates that file into SST2 format.
The comparison then proceeds, using the generated SST2 files.
For example, the following rules file specification:
datafile1 golden.vcd
datafile2 test.vcd
compare . -maxerrors 20
is equivalent to the following:
translate golden.vcd
translate test.vcd
datafile1 golden.trn
datafile2 test.trn
compare . -maxerrors 20
Translating Large Files
When you need to translate large simulation files, you may want to create a rules file that translates the simulation files and another rules file that runs the comparison. Using two different rules files gives you more flexibility in deciding how Comparescan generates your files.
For example, you can create a rules file similar to the following to translate your simulation files:
translate xyz.vcd /tmp/bigspace/xyz.trn
translate abc.vcd /tmp/bigspace/abc.trn
You can then create a second rules file similar to the following to compare your translated files:
datafile1 /tmp/bigspace/xyz.trn
datafile2 /tmp/bigspace/abc.trn
compare .
Then you can run Comparescan twice, once to translate the files and once to compare the files, as follows:
%comparescan -batch xlat.rules
%comparescan -run comp.rules
Translating Files Without Using the translate Command
You can translate your files and compare them using a single rules file. There are two ways to do this. First, you can issue the translate command within your rules file and then
December 2000 |
95 |
Product Version 1.9 |

Comparescan User Guide
Writing Comparescan Rules
specify your comparison commands. Or you can let the datafile1 and datafile2 commands translate your files automatically (without using a translate command).
Using a translate command is convenient because you can choose where your output
files are located.
Letting datafile1 and datafile2 translate your simulation results has the following features:
■Comparescan always generates the output files (the SST2 Database) in the same directory as the input file, and the output file always has the same base filename as the input file.
■If the output files already exist, Comparescan checks their timestamp against the timestamp of the input file. If the existing SST2 database file is newer, Comparescan does not perform a translation.
For example, the datafile commands in the following rules file automatically translate the specified VCD files into SST2 format before comparing the two files:
datafile1 xyz.vcd
datafile2 abc.vcd
compare .
December 2000 |
96 |
Product Version 1.9 |