The set of generator output files includes ANSI C declaration header (*.h) as well as definition source (*.c) files, which are partially dependent on each other. With respect to older C compilers, all source file names are limited to 8 characters.
The figure below demonstrates a complete project of code generator output files with appropriate dependencies.
Including different generic template functions and a set of boolean switches, the configuration files (CFG_Base.h, CFG_OS.c, CFG_IO.c) are used for code customization. This customization set provides all setup options for an optimized and successful execution on a specific run-time system.
In case the selected target code compiler supports strictly conform ANSI C code, only these files are meant to be modified after code generation.
All global data types and structures are separately implemented (Types.h, Types.c), because these types are included in any other target code section. The data type implementation includes all C structures and functions, in conjunction with input model composite data structures and enumerations. Furthermore, multiple used internal RTOS types are defined within these files.
The complete state transition diagram representation of an instantiated FSM model and all associated instances are implemented by a separate FSM source file. Additionally, this set of state machine related source files includes an FSM base implementation (FSM_Base.h, FSM_Base.c) for commonly used code sections, like the ANSI C implementation of action built-in functions.
Almost the complete RTOS functionality, as task and interface interaction, timelines and DE scheduler, is implemented by a single source file (OS_Main.c). Only EventQ handling and custom memory management are outsourced to an operating system base implementation (OS_Base.h, OS_Base.c). These parts are to be shared with FSMs in case timer events are present.
Many embedded and real-time systems require that the C application main function is implemented at top of the appropriate source file, to setup the instruction pointer at the right position. Thus, a generated source code project includes a separate source file (Main.c) for this function. Like configuration files, this file is optionally backuped in terms of an additional main function customization, for instance, to handle application arguments.
An additional makefile can be configured and used for comfortable compilation of the generated source files.