External process simulators are implemented as executable programs running in an external process. SansGUI uses an invocation script to start the simulator in a process, external to SansGUI. After the process starts, SansGUI does not wait for the process to finish; therefore, the user can move on to other tasks in the SansGUI environment. To obtain the Project Model built by the user, an external process simulator needs to read a textual Model File described in the next chapter, SansGUI Model File Format. SansGUI does not have any flow control mechanism for the simulation run; it is totally up to the external program. The following section explains the code in the invocation script.
The invocation script for the Windows environment is implemented in a batch command file named SGxProc.bat. It can be found in the bin subdirectory of the SansGUI installation directory. The usage of the invocation script is given as the following:
SGxProc <XProcPath> <OptionCode> <Drive> <WorkDirNoDrive> <DataFile> <FileType> {ExtraParams}
<XProcPath>: the external process simulator program path. It may have the default program path, or a path specified by the user in the simulation control object.
<OptionCode>: the option code from the Project Model. A simulator may be defined for various options, representing different capabilities of the simulator made available to the simulation user. If there is no option code, <OptionCode> will contain an empty string enclosed by a pair of double quotes "".
<Drive>: the hard disc drive label, if any. It is used for changing the logged drive. If there is no drive specification, 0 will be supplied.
<WorkDirNoDrive>: the current working directory for the simulation project without the hard disc drive label. The invocation script changes the current working directory to this one specified.
<DataFile>: the data file name used to generate the textual Model File. The simulator needs to open this file and read it for the the configuration and input data of the model.
<FileType>: the format of the textual Model File. In the current version of SansGUI, the value 0 stands for Tabular Data Blocks and 1 stands for XML Model Data.
{ExtraParams}: optional parameters, defined by the simulator and not processed by SansGUI. This is taken exactly from the Command Parameters field of the Default external process simulation control object.
When customization of the invocation script is necessary, make a copy of the original invocation script and store it in a different directory for making changes. Use the simulation control object to specify the customized invocation script path.
With the default invocation script, an external process simulator should be implemented to process the following command line arguments:
ProgramName <OptionCode> <DataFile> <FileType> {ExtraParams}
These command line arguments will receive the parameters passed by the invocation script. The definitions of the parameters are the same.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.