The class functions can be categorized into three groups: 1) data editing, 2) execution, and 3) evaluation, depending on the time and opportunity that these functions are called. The parenthesized names, starting with a SG_x prefix, are the actual function names in the implementation. For simulation developers, the function names are appended with the class path, such as SG_xEval_Base_MyComponentClass. If the class path contains any non-alphanumeric characters, they will be changed into underscores in the function name. SansGUI generates skeleton code of the functions in the supported languages for all the classes during the compilation of Schema Definitions. For simulation users who write overriding routines, these are the exact function names to be used, no class path name mingling. Sample source files that provide the skeleton for the overriding functions can be found as SGover.cpp (for C/C++) and SGover.f (for Fortran) in the inc subdirectory of the SansGUI installation directory.
The descriptions for the functions listed here are general. The semantics of these functions may be different, depending upon the SansGUI Simulation Control (see next chapter) and the algorithms used in the simulators.
End Edit Check (SG_xEndEdit): is called when the simulation user click on the Check Data button in a Properties dialog. It can be used for cross-field data validation and calculated data fields population.
Resize for Loading Data (SG_xLoadSize): is called when the simulation user clicks on the Load Data button in a Properties dialog. This function normally implements data array resizing for the Load Data (SG_xLoad) function below.
Load Data (SG_xLoad): is called immediately after the Resize for Loading Data (SG_xLoadSize) functions returns. This function is normally used to populate data.
Resize for Initialization (SG_xInitSize): is called before the Initialization (SG_xInit) function for resizing data arrays as needed.
Initialization (SG_xInit): is called immediately after the Resize for Initialization (SG_xInitSize) function returns. This function is normally used to populate data during the program initialization.
Begin Run (SG_xBgnRun): is called at the beginning of a simulation run.
Begin Case (SG_xBgnCase): is called at the beginning of a case.
End Case (SG_xEndCase): is called at the end of a case, normally used for the case summary.
End Run (SG_xEndRun): is called at the end of a simulation run, normally used for the simulation run summary. This function will be called after the user clicks on the Stop button, giving the simulator an opportunity to clean up and release resources. A SG_STAT_STOP bit is set in the iStatus member of the simulation control object to indicate that the simulation is stopped by the user.
Pre-Evaluation (SG_xPreEval): is called to prepare for evaluation.
Evaluation (SG_xEval): the main simulation function which is called during evaluation.
Post-Evaluation (SG_xPostEval): is called after evaluation.
All the DLL function names are case-sensitive, both in C and in Fortran. One way to check the entry points in a Windows DLL is to issue the following command:
where <mycode.dll> is to be substituted with the name of the DLL file that contains the implementation of the DLL functions.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.