Main Content

Shared code placement


Specify the location for generating utility functions, exported data type definitions, and declarations of exported data with custom storage class.

Category: Code Generation > Interface


Default: Auto


The code generator places utility code within the codeGenFolder/slprj/target/_sharedutils (or codeGenFolder/targetSpecific/_shared) folder for a model that contains Existing Shared Code (Embedded Coder) or at least one of the following blocks:

  • Model blocks

  • Simulink Function blocks

  • Function Caller blocks

  • Calls to Simulink Functions from Stateflow or MATLAB Function blocks

  • Stateflow graphical functions when you select the Export Chart Level Functions parameter

If a model does not contain one of the above blocks or Existing Shared Code (Embedded Coder), the code generator places utility code in the build folder (generally, the folder that contains model.c or model.cpp).

Shared location

Directs code for utilities to be placed within the codeGenFolder/slprj/target/_sharedutils (or codeGenFolder/targetSpecific/_shared) folder.

Command-Line Information

Parameter: UtilityFuncGeneration
Type: character vector
Value: 'Auto' | 'Shared location'
Default: 'Auto'

Recommended Settings

DebuggingShared location (GRT)
No impact (ERT)
TraceabilityShared location (GRT)
No impact (ERT)
EfficiencyNo impact (execution, RAM)
Shared location (ROM)
Safety precautionNo impact

Related Topics