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
Scheduling algorithms
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:
Time-Based Scheduling and Code Generation and Modeling for Multitasking Execution. For an example, open
rtwdemos
and navigate to the Multirate Support folder.Asynchronous Events and example
rtwdemo_async
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.
Customize post code generation build processing to accommodate third-party tools and processes, as required. See Customize Post-Code-Generation Build Processing and example
rtwdemo_buildinfo
.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 rtwdemos
and navigate to the Custom Code folder.Mixed code integration Generate Component Source Code for Export to External Code Base and example
rtwdemo_exporting_functions
Configure Generated C Function Interface for Model Entry-Point Functions, Interactively Configure C++ Interface, and example rtwdemo_fcnprotoctrl
What Is Code Replacement?, What Is Code Replacement Customization?, and example Optimize Generated Code by Developing and Using Code Replacement Libraries - Simulink
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 Generate ASAP2 and CDF Calibration Files.
Customize and control the build process, as required. See Customize Post-Code-Generation Build Processing, and example
rtwdemo_buildinfo
.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
rtwdemo_buildinfo
.