Code Generation Process

ANSI C code synthesis for either an FSM module or single FSM model can be activated by the Generate ANSI C Code icon available in the Modeling toolbar or model context menu.

Directly after code generation has been activated, the given generator input model is first checked for design errors and inconsistencies. Additionally, the input model is hierarchically parsed for design elements, not supported by the code generator. Corresponding error and warning messages are shown in the Log Window of the Console View. In this context, code generation aborts, if error messages are present. Else, if just warning messages are present, the user is prompted by an additional dialog box to choose to continue or to abort code synthesis. Otherwise, in case a given input model satisfies all generator conditions and limitations, code generation automatically continues and the configuration dialog box is shown.

Code Generator Configuration Dialog

After all settings are done, ANSI C code generation for the selected input model can be started by the Generate button. In case the code generation fails, for instance, the output source files could not be saved due to insufficient disk space, a message box is prompted, showing internal generator problems. Otherwise, the user is informed about successful code generation and the output source files are available in the selected directory.