SYNAPTICADcolon Timing Diagram Editors

Batch Mode Example: Comparing VCD files

SynaptiCAD products that have the compare option added can run comparisons on files using batch mode execution. Batch mode execution is particularly useful for automating waveform comparisons when performing regression simulation runs after a design change. If there are differences in the files, then a file named timingDiagramName_diff.txt is created that lists the differences in the time order in which they occur.

This example shows a batch file that will compare two VCD files. The following code contains 3 lines of code and a number of comments that describe the functionality of the script. The code can be copied in to a *.bat file and executed:

@echo off

REM This batch file performs two vcd files automatically. Comparison requires
REM that the second file loaded (the file selected during "Compare file" operation) must be
REM a btim file, so we first convert this file from vcd to btim.

set syncad=c:\src\newt\syncad.exe
set product=wfp
set referencefile=tb_gate_add4a.vcd
set basename=tb_gate_add4b

echo This assumes that the files are in the current directory.

echo WARNING: in Windows 9x, this will launch two conversions
echo at once because batch files don't wait for subprocesses to
echo complete before they continue to the next step. This isn't
echo really a problem -- multiple copies of WaveFormer Pro can be
echo run at the same time -- as long as there is no dependency
echo between the first step and the second step. In our case,
echo the second invocation depends on the btim file
echo generated by the first step, so we've got a problem.
echo We're cheating here and putting a pause statement between the
echo two commands and leaving it up to the user to separate the
echo commands. In a real app you'd need to do something more
echo .

echo .
echo Converting %basename%.vcd to btim format for use as compare file
%syncad% -p%product% --batch-mode --eval-perl-string twf::SetFilterFile(undef);

echo Press ENTER when you think the conversion to BTIM format might be done

echo .
echo Now we invoke WaveFormer Pro to do the comparison
echo and display the results.
REM NOTES: that the argument to CompareFile must be a .tim/.btim file, so if
REM you have, for example, a .cbc and a .tim, do the OpenFile on the
REM .cbc and the Compare on the .tim; doing it in the other order
REM will fail. If neither of the files is a .tim file, you need to
REM convert one of them to a .tim/.btim file first.

%syncad% -p%product% --eval-perl-string twf::SetFilterFile(undef);

Return to the Batch Main Page