Architecture of Generated C Code : Main Task: Partition and Flow Control for C : Structure of a Behavioral Module

Structure of a Behavioral Module

In this example, the module is called light.c:

#include “types.h”
#include “<gds_name>.h”
#include “light.h”
#include “<compilation_profile_name>main.h”
#include “user_activities.h”

Headers of other modules:

types.h — Basic type definitions for condition, events, data-items etc.
<gds_name>.h — If you used Global Definition Sets in the design, the GDSs will have corresponding header files in the generated code. They are included by all modules in the code.
light.h Header file for the local module.
<compilation_profile_name>main.h - Definition of all intermodules shared data. Note that all the data elements shared by more than one module are defined in the main module.
user_activities.h - Prototypes for the user-written activities for which stubs were requested in the profile.