Package: cgv
Superclasses:
Verify numerical equivalence of results
Executes a model in different environments such as, simulation,
Software-In-the-Loop (SIL), or Processor-In-the-Loop (PIL) and stores
numerical results. Using the cgv.CGV
class methods,
you can create a script to verify that the model and the generated
code produce numerically equivalent results.
cgv.CGV
and cgv.Config
use
two of the same properties. Before executing a cgv.CGV
object,
use cgv.Config
to verify the model configured for
the mode of execution that you specify. If the top model is set to
normal simulation mode, referenced models set to PIL mode are changed
to Accelerator mode.
creates
a handle to a code generation verification object using the default
parameter values. cgvObj
= cgv.CGV(model_name
)model_name
is the name of the
model that you are verifying.
constructs
the object using the parameter values, specified as cgvObj
= cgv.CGV(model_name
,Name
,Value
)Name,Value
pair
arguments. Parameter names and values are not case sensitive.
|
Name of the model that you are verifying. |
Optional comma-separated pairs of Name,Value
arguments,
where Name
is the argument name and Value
is
the corresponding value. Name
must appear inside
single quotes (''
). You can specify several name-value
pair arguments in a variety of orders, such as Name1,Value1,…,NameN,ValueN
.
|
Define the SIL or PIL approach
If mode of execution is simulation ( Default: topmodel | ||||||||
|
Specify mode of execution
|
|
Specify a description of the object. Default: |
|
Specify a name for the object. Default: |
activateConfigSet | Activate configuration set of model |
addBaseline | Add baseline file for comparison |
addConfigSet | Add configuration set |
addHeaderReportFcn | Add callback function to execute before executing input data in object |
addInputData | Add input data |
addPostExecFcn | Add callback function to execute after each input data file is executes |
addPostExecReportFcn | Add callback function to execute after each input data file executes |
addPostLoadFiles | Add files required by model |
addPreExecFcn | Add callback function to execute before each input data file executes |
addPreExecReportFcn | Add callback function to execute before each input data file executes |
addTrailerReportFcn | Add callback function to execute after the input data executes |
compare | Compare signal data |
copySetup | Create copy of cgv.CGV object |
createToleranceFile | Create file correlating tolerance information with signal names |
getOutputData | Get output data |
getSavedSignals | Display list of signal names to command line |
getStatus | Return execution status |
plot | Create plot for signal or multiple signals |
run | Execute CGV object |
setMode | Specify mode of execution |
setOutputDir | Specify folder |
setOutputFile | Specify output data file name |
Handle. To learn how handle classes change copy operations, see Copying Objects in the MATLAB® Programming Fundamentals documentation.
The general workflow for testing a model for numerical equivalence
using the cgv.CGV
class is to:
Create a cgv.CGV
object, cgvObj
,
for each mode of execution and use the cgv.CGV
set
up methods to configure the model for each execution. The set up methods
are:
addInputData
addPostLoadFiles
setOutputDir
setOutputFile
addCallBack
addConfigSet
Run the model for each mode of execution using the cgvObj.run
method.
Use the cgv.CGV
access methods to
get and evaluate the data. The access methods are:
getOutputData
getSavedSignals
plot
compare
An object should be run only once. After the object is run, the set up methods are not used for that object. You then use the access methods for verifying the numerical equivalence of the results.
Note
Simulink® Test™ is a separate product that provides additional capabilities for SIL and PIL testing, for example, test sequence construction and test management.