Real-Time Software Component Verification
One approach to verifying a software component is to build the component into a complete software system that can execute in real time in the target environment. A complete software system includes:
Algorithm for the software component
Calls to drivers for board-specific devices
This single build approach is more time consuming to set up, but makes it easier to get the complete application running in the target environment.
The following figure shows code generated for an algorithm being built into a complete system executable for the target environment.
The workflow for testing component software as part of a complete real-time target environment is:
Develop a component model and generate source code for production.
For information on building in scheduling and real-time system support, see:
Workflows for AUTOSAR (AUTOSAR Blockset) and example Develop a Model That Complies with the AUTOSAR Standard.
Optimize generated code for a specific run-time environment, using specialized function libraries. For more information, see What Is Code Replacement?, What Is Code Replacement Customization?, and Optimize Generated Code by Developing and Using Code Replacement Libraries - Simulink.
Integrate external code, for example, for device drivers and a scheduler, with the generated C or C++ code for your component model. For more information, see S-Functions and Code Generation. For more specific references depending on your verification goals, see the following table.
For... See... ANSI® C/C++ code integration Integrate C Functions Using Legacy Code Tool. Also, open
rtwdemosand navigate to the Custom Code folder.
Mixed code integration
Generate Component Source Code for Export to External Code Base and example
Simulate the integrated model.
Generate code for the integrated model.
Connect to data interfaces for the generated C code data structures. See Exchange Data Between Generated and External Code Using C API and Export ASAP2 File for Data Measurement and Calibration. Also see examples
Create a zip file that contains generated code files, static files, and dependent data to build the generated code in an environment other than your host computer. See Relocate or Share Generated Code, and example