FinalProcess

The FinalProcess column allows you to specify a SIMetrix script to be run immediately after the normal DVM processing for a test. Final-process scripts can make measurements on waveforms that are created or modified by normal DVM processing. The FinalProcess statement can be blank.

For example, the following line might appear at the end of a testplan to call a script to run just before the end of the simulation:

*?@ Analysis   Objective   Source   Source   Load   Label   Create   FinalProcess 
 NoSimulation           Steady-State|Generate Efficiency Curves     ..\scripts\8.1_efficiency_and_powerloss_post_process.sxscr

The final-process script can perform any actions supported by the script language and can return scalar and specification values to DVM for inclusion in the report. A standard interface helps to make final-process scripts easier to configure. The interface includes five arguments, which are described in the following table.

Argument Description
retval Return value for the script:
  • For pre-process scripts, the return value at index=0 is logged in the test log file.
  • For post-process and final-process scripts, scalars, specifications, statistics and statistical specifications are returned on the indexes described in the following table.
    retval Description
    retval[0] Scalar values measured during the test
    retval[1] Specification values measured during the test
    retval[2] Statistical values measured during the test
    retval[3] Statistical specification values measured during the test

For additional information, see 7.3 User-Defined Scalar and Spec Values.

label Label for the currently executing test. Since the label is passed to both the pre-process and post-process scripts, the script can decode the label and determine which test is currently executing. This allows the script to modify values or make measurements based on the currently executing test.
report_dir Base directory for simulation results
log_file Location of the overview log file
controlhandle Value of the Handle property for the DVM control symbol on the top-level schematic. The PropValues2 Function can read values from the DVM control symbol using the this value.

Multiple pre- and post-process scripts can be assigned using the testplan headers Preprocess , PostProcess , and FinalProcess. If multiple scripts are assigned, the order of their execution is as assigned in the testplan from left to right within the test definition row.

To use this interface, place the following line at the top of your FinalProcess script.

Arguments @retval label report_dir log_file controlhandle

For more information, see the following topics:

For an example of a testplan using the FinalProcess statement, see 8-1 Adding Power Losses_to_a Testplan in the DVM tutorial.