Verify Numerical Equivalence with CGV
Before verifying numerical equivalence:
Configure your model for SIL or PIL simulation.
cgv.Configclass of the CGV API to verify the model configuration for SIL or PIL simulation.
Configure your model for code generation. For more information, see Configure Model for Code Generation Objectives by Using Code Generation Advisor.
Save your model. If you modify a model without saving it, CGV can issue an error.
To verify numerical equivalence:
Set up the tests for the first execution environment. For example, simulation.
runto run the tests for the first execution environment.
Set up the tests for the second execution environment. For example, top-model PIL.
cgv.CGV.runto run the tests for the second execution environment.
getOutputDatato get the output data for each execution environment.
getSavedSignalsto display the signal names in the output data. (optional)
Build a list of signal names for input to other
createToleranceFileto create a file correlating tolerance information with output signal names. (optional)
compareto compare the output signals of the first and second execution environments for numerical equivalence.
Simulink® Test™ is a separate product that provides additional capabilities for SIL and PIL testing, for example, test sequence construction and test management.