Code Generation Basics : Generating Native Code

Generating Native Code

Generating code for a native environment is the simplest code generation task. The more complex task of generating code for an embedded development system environment is inherently more complex and is presented later in this manual.

The more complex a simulation model becomes, the more difficult it can be to “step through” the animated model. The ability to generate and compile code that will execute all or part of the simulation makes the over-all design process more efficient. Individual portions of the larger model can be refined to a point of design stability and stored as compiled code modules. These modules can be linked into a larger and more complex model as though they were “black boxes,” thereby limiting the “under development” elements of the larger model that must be tested and refined.

It is also conceivable that an entire design can be compiled into an executable file that can be run on a system other than the development system. This allows sharing the model with others interested in the end result of the design effort.

Code generation within Rational Statemate follows a rather consistent process. This process is described in the following flow chart. It is important to note that most of the process occurs within the Code Generation Profile Editor window. However, it is also necessary to access the Workarea Browser in order to select the specific Activity Charts and Panels that are to be brought into the scope of the generated code.