Main Content

Source files


Specify customized name for generated source files.

Category: Code Generation > Code Placement


Default: $R$E

Enter a macro that specifies whether, and in what order, certain text is to be included in the generated identifier. The macro can include a combination of custom user text and these format tokens:


Insert the file type. $E represents these instances of file types:

  • capi

  • capi_host

  • dt

  • testinterface

  • private

  • types



Insert root model name into identifier, replacing unsupported characters with the underscore (_) character.

Required for model referencing.


Insert text that you specify for the $U token. To specify this text, use the Custom token text parameter.

Custom naming is supported only for .c and .cpp files. When you have model hierarchy, custom naming is applicable to only the root model.


This parameter:

  • Appears only for ERT-based targets.

  • Requires Embedded Coder® when generating code.

Command-Line Information

Parameter: ERTSourceFileRootName
Type: character vector
Value: Valid combination of tokens and custom text
Default: $R$E

Recommended Settings

DebuggingNo impact
TraceabilityUse default
EfficiencyNo impact
Safety precautionNo recommendation

Related Topics