SYNAPTICADcolon TIMING DIAGRAM EDITORS
 

Batch Mode Operation

All SynaptiCAD products have several command-line parameters that enable the product to perform certain functions non-interactively. Running the product in batch mode execution is especially useful when combined with the Comparison Option. Files from different simulation runs or from logic analyzer capture runs can compared automatically using a bath file. Some examples of batch files that our customers have written:


When the product is launched from the start menu or desktop, no command line options are used. If you launch the product from a command window you can use one or more command line options to control how the product runs.

Most of the command-line parameters have both a short form and a long form. If the short form is -a and the long form is --argument and the argument takes a string as a parameter, then the following are equivalent:

	syncad.exe --argument foo
	syncad.exe --argument=foo
	syncad.exe +argument foo
	syncad.exe +argument=foo
	syncad.exe -a foo
	syncad.exe -afoo

Below is a list of command line parameters. Each of these is described in detail later in this section.

Long Option Short Option Argument Type Description
--product -p String Select which product to run
--simulator -S String Controls simulator used for new projects
--eval-perl-file -s Filename Invoke a perl script
--eval-perl-string -t String Invoke a perl command
--batch-mode -b . Run without displaying the main window
--quit -q Boolean Quit after processing command-line parameters
--input -i Filename Select a file to load
--import -m String Specify the file format of the file to load
--filter -f Filename Specify a filter file to be used when loading files
--output -o Filename Specify the output file for batch conversion
--export -e String Specify the output file format for batch conversion

If more than one command line option is used, we recommend that you put the commands in perl script and call it using the -s scriptname option. This will let you explicitly control the sequence of events. However, if more than one command line option is specified, they will be executed in this sequence:

  • If a filter file is specified on the command line, it will be set
  • If an input file is specified on the command line, it will be loaded (using the input file format specified on the command line, if any)
  • If a perl string is specified, it will be evaluated
  • If a perl file is specified, it will be evaluated
  • If an output file and output file format are specified, the current timing diagram will be saved to that file in that format. It is an error to specify the file and not the format.

See Chapter 15: Writing Waveperl Scripts for more information in the on-line help.


1) Product Command Line Parameter (-p)
All SynaptiCAD products are distributed as one executable image (syncad.exe on Windows and syncad on UNIX). When you run syncad.exe, it will launch one of SynaptiCAD's products, depending on what command line arguments were present. If the executable is invoked as syncad.exe --product testbencherpro it will load TestBencher Pro. The valid values for this option are:

Product Valid Values
WaveFormer Lite wfl, wflite, waveformlite, or waveformerlite
Timing Diagrammer Pro td, tdp, timing, or timingdiagrammerpro
WaveFormer Pro wf, wfp, waveform, or waveformerpro
Bughunter Pro bughunter, bughunterpro, bh, bhp
DataSheet Pro ds, dsp, datasheet, or datasheetpro
Transaction Tracker tracker, transactiontracker, tt
TestBencher Pro tb, tbp, tbench, testbencher, or testbencherpro

If no product option is specified on the command line, then it will load whatever it was run as last.


2) Default Simulator for new projects (-S)
This option controls the simulator that is used for new projects. If not specified, new projects will default to using the last selected simulator. The valid values for this option are:

Product Valid Values
VeriLogger Pro vlogcmd
VeriLogger Extreme verilogger_extreme
Active-HDL VHDL active_vhdl, Active-HDL
Active-HDL Verilog active_verilog
ModelSIM SE VHDL modelsim_vhdl_se
ModelSIM VHDL (non-SE) modlesim_vhdl_nonse
ModelSIM Verilog modelsim_verilog
NC VHDL ncvhdl
NC Verilog ncverilog
VCS vcs
VCSI vcsi
Verilog XL verilogxl

3) Evaluate Perl Script Command Line Parameter (-s)
TestBencher Pro has a Perl interpreter built in, to enable easy customization. The --eval-perl-script filename option allows you to have TestBencher Pro run an arbitrary perl script after it loads. The filename argument can be either an absolute path to the script or a path relative to the directory from which TestBencher Pro was run.

The script can be any valid perl script. The script will have access to all of the functions in TestBencher Pro's perl interface.
The perl script is evaluated in the main thread of TestBencher Pro; the application will be unresponsive while the script is running. If you create an infinite loop, TestBencher Pro will hang indefinitely.

Below is an example of a Perl Script that could be called using the -s command line option. This code passes a filter file called "filterfile.tim" to the program, then loads a vcd file called "basename.vcd". The filter file lists the names of the signals to read out of the vcd file. Next the script exports the waveform information to a spreadsheet format and saves the information in a file called basename.cbc.

#open a filter file that defines what signals to read from the input file
# as well as other information such as signal direction
twf::SetFilterFile("filterfile.tim");

#import the signals from a vcd file named "basename.vcd"
twf::OpenFile("basename.vcd");

#export the signals to a test vector spreadsheet file named "basename.cbc"
twf::SaveFile("basename.cbc","tvectorclocked.epl");


4) Evaluate Perl String Command Line Parameter (-t)
This is similar in function to the --eval-perl-script except that it evaluates its argument as if it were the contents of a script.

For example, the following command would launch TestBencher Pro and notepad at the same time:

syncad.exe --product testbencherpro
--eval-perl-string "system(qw(notepad.exe))"

To compare the file test.txt with test2.tim you could use the following commands:

     syncad.exe -ptbp --eval-perl-string 
     "twf::OpenFile(qw(C:\temp\test.txt),qw(TVECTOR_To_IF));
     twf::CompareFile(qw(C:\temp\test2.tim));"

Another way to automatically compare these files is to embed the commands into a perl file:

     syncad.exe -ptbp --eval-perl-file temp.pl

if tmp.pl contained

     twf::OpenFile('C:\temp\test.txt', "TVECTOR_To_IF");
     twf::CompareFile('C:\temp\test2.tim);

5) Enable Batch Mode Command Line Parameter (-b)
If Batch mode is specified, TestBencher Pro will run in batch mode, in which it will not display anything on the screen. This is useful when you want to invoke TestBencher Pro from within another program to convert a file from one format to another (or do some other automated processing).
This option interacts with the --quit option.


6) Exit After Processing Arguments Command Line Parameter (-q)
Setting this parameter's value to true causes TestBencher Pro to exit after it has carried out all the actions specified on the command line (anything triggered by the --input,--output, --eval-perl-*, etc). If it is set to false, TestBencher Pro will continue into interactive mode.
If you do not specify this argument on the command line, then it will determine what to do from the --batch-mode flag. If batch mode is enabled, it will default to true. If batch mode is not enabled, it will default to false. This is usually what you want, because if it is set to false in batch mode, TestBencher Pro will continue to run (invisibly) after doing all of the work you specified. (But then you could write a server in perl which would, say, accept requests on a socket, and you would want that to stick around after the initial processing was completed).


7) Input File (deprecated) Command Line Parameter (-i)
This option specifies a file to load on startup. The filename can be either relative to the current directory or absolute. Normally, this option will cause the file to load and display for interactive use, just as if you had started TestBencher Pro and then opened the file from the File | Open menu. However, if you are doing a batch file conversion, the file will not be displayed -- it will be used as the input for the file conversion. For more information on batch file conversions, see the --export option.

The --import and --filter files alter how the file is loaded.
Note: the preferred way to specify an input file is by using a perl script. The OpenFile( ) function should do what you want.


8) Import Format (deprecated) Command Line Parameter (-m)
This option specifies the file format of the input file. If this is left unspecified, TestBencher Pro will attempt to automatically determine what file format to use. This works for most files, but there are some formats which it cannot discriminate. This option is case-sensitive.

You can get the complete list of the valid values for this option by going to the Export | Add or Execute Script menu and selecting the script type Import from the resulting dialog box. The valid values will be listed in the first column. As of this writing, the valid values are

AUTO_EXT_To_IF, TIM_To_IF, TDML_To_IF, FREEPARM_To_IF, FREETEXT_To_IF, WFM_To_IF, HPL_To_IF, POD_To_IF, ADPLD_To_IF, VCD_To_IF, HPWave_To_IF, AWF_To_IF, VHDL_To_IF, ALT_To_IF, GERMAN_To_IF, HPFASTBIN_To_IF, CSDF_To_IF, OSCOPE_To_IF, TECTRONIX_To_IF, TVECTOR_To_IF, chro.ipl, dworks.ipl, and acco.ipl.

Note: the preferred way to specify the input file format is by using a perl script. The (optional) second parameter to the OpenFile( ) function should do what you want.


9) Input File Filter (deprecated) Command Line Parameter (-f)
This command-line argument sets the filter file used when loading a diagram or performing a batch file conversion. Specifying the empty string ("") for a filter file forces TestBencher Pro not to use a filter file. This option does the same thing as the Options | Set Filter File. menu item does during interactive use.

Filter files behave a little oddly, though. If you set a filter file during interactive an interactive session, it will be used each time you run TestBencher Pro until you specifically tell it not to use the filter file. If you don't specify a filter file on the command line and the user was using a filter file the last time they shut down TestBencher Pro, it also will be applied to input files specified on the command line. This is usually what you want it to do, unless you are doing batch file conversions. If you want to make sure that no filter is applied to files, use this option but specify the empty string ("") as the filter.

Note: the preferred way to specify a filter file is to use the perl interface. The SetFilterFile( ) function does this. The call to SetFilterFile( ) should be placed before the call to OpenFile( ) in order to have the same effect as this option does.


10) Output File (deprecated) Command Line Parameter (-o)
This option specifies the output file when doing file format conversions. If you specify this option, you must also specify output format.

Note: the preferred way to output data to a file is to use the SaveFile( ) function from the perl interface.


11) Output File Format (deprecated) Command Line Parameter (-e)
This command-line argument sets the format of the output file. This option is only useful in batch mode, where it decides the format for the file specified by the --output argument. You can get the complete list of the valid values for this option by going to the Export | Add or Execute Script menu and selecting the script type Export from the resulting dialog box. The valid values will be listed in the first column.

-e options Valid Values
IF_To_TIM Timing Diagram (*.tim)
IF_To_TIMBINARY Timing Diagram - Binary (*.btim)
IF_To_FILTERTIM Waveform Filter - Binary (*.tim)
IF_To_FREEPARM Free Parm (*.fp)
IF_To_FREETEXT Text Free Parm (*.txt)
IF_To_FREETEXTMARGIN Text Free Parm with Margins (*txt)
IF_To_PARMCALCREPORT Timing Analysis Report (*.txt)
IF_To_VHDL VHDL (*.vhd)
IF_To_VHDL_with_TB VHDL w/ Top Level Test Bench (*.vhd)
IF_To_VERILOG Verilog (*.v)
IF_To_VERILOG_with_TB Verilog w/ Top Level Test Bench (*.v)
IF_To_SYSTEMC_TRANSACTOR SystemC Transactor (*.cpp)
IF_To_CMD Workview CMD (*.cmd)
IF_To_TDML TDML (*.tdml;*.tdm)
IF_To_PIPAT PI-2005 Pattern Generator (*.txt)
HP_PatGen_Binary Agilent 167xx Pattern Generator (binary)(*.pgb)
HP_Matrix_PatGen_Binary Agilent 169xx Pattern Generator Full Mode (*.pgb)
HP_Matrix_Half_Mode_PatGen_Binary Agilent 169xx Pattern Generator Half Mode (*.pgb)

Note: the preferred way to specify an output format is to use the (optional) second parameter to the SaveFile( ) function provided by the perl interface.