Architecture of Generated C Code

Architecture of Generated C Code

 

This section describes the architecture of the generated C code including how the Code Generator structures the modules.

The Rational Statemate Code Generator generates fully functional code, based on the Activity-charts and Statecharts in the Rational Statemate model. The generated modules are partitioned according to a compilation profile, which allows you to generate code for a complete Rational Statemate model or just a part of one.

Each generated module reflects the state, timing, and scheduling logic of the model that is included in the compilation profile. This allows a suitable set of components to be built that reflect the system logic (behavior).

The generated code uses runtime modules for timing and scheduling. Requests are generated to the timing module for timeouts and scheduled events, and to the scheduler module to control handwritten tasks that are connected to basic and external activities. In addition, the data elements are double buffered, so data assignments are synchronized to prevent racing conditions among the “concurrent” behavioral components.

Note: In some cases where there are no racing conditions, you may want to disable double buffering. For more information, refer to Optimizing Double Buffers.