Main Content

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:

  1. Develop a component model and generate source code for production.

    For information on building in scheduling and real-time system support, see:

  2. 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.

  3. 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.

  4. 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.

  5. Simulate the integrated model.

  6. Generate code for the integrated model.

  7. 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 rtwdemo_capi and rtwdemo_asap2.

  8. Customize and control the build process, as required. See Customize Post-Code-Generation Build Processing, and example rtwdemo_buildinfo .

  9. 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.