Verify Numerical Equivalence with CGV
Before verifying numerical equivalence:
- Configure your model for SIL or PIL simulation. 
- Use the - 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. 
- Use - runto run the tests for the first execution environment.
- Set up the tests for the second execution environment. For example, top-model PIL. 
- Use - cgv.CGV.runto run the tests for the second execution environment.
- Use - getOutputDatato get the output data for each execution environment.
- Use - getSavedSignalsto display the signal names in the output data. (optional)
- Build a list of signal names for input to other - cgv.CGVmethods. (optional)
- Use - createToleranceFileto create a file correlating tolerance information with output signal names. (optional)
- Use - compareto compare the output signals of the first and second execution environments for numerical equivalence.
Note
Simulink® Test™ is a separate product that provides additional capabilities for SIL and PIL testing, for example, test sequence construction and test management.