Specify where to place definitions of global variables.
Category: Code Generation > Code Placement
Default:
Auto
Auto
Lets the code generator determine where the definitions should be located.
Data defined in source
file
Places definitions in .c
source files where functions are located. The code
generator places the definitions in one or more
function .c
files, depending on
the number of function source files and the file
partitioning previously selected in the
Simulink® model.
Data defined in a single
separate source file
Places definitions in the source file specified in the Data definition filename field. The code generator organizes and formats the definitions based on the data source template specified by the Source file (*.c) template parameter in the data section of the Templates pane.
Limitation
This parameter applies to data with storage classes except these:
ExportedGlobal
ImportedExtern
ImportedExternPointer
BitField
FileScope
Localizable
Struct
CompilerFlag
In the Embedded Coder® Dictionary, the Header File value for unsupported storage classes is empty. You cannot specify default file placement for unsupported storage classes.
This parameter enables Data definition filename.
Parameter:
GlobalDataDefinition |
Type: character vector |
Value:
'Auto' |
'InSourceFile' |
'InSeparateSourceFile' |
Default:
'Auto' |
Application | Setting |
---|---|
Debugging | No impact |
Traceability | A valid value |
Efficiency | No impact |
Safety precaution | No impact |