Main Content

File packaging format

Description

Specify whether code generation modularizes the code components into many files or compacts the generated code into a few files. You can specify a different file packaging format for each referenced model.

Category: Code Generation > Code Placement

Settings

Default: Modular

Modular

  • Outputs model_data.c, model_private.h, and model_types.h, in addition to generating model.c and model.h. For the contents of these files, see the table in Generated Code Modules.

  • Supports generating separate source files for subsystems. For more information on generating code for subsystems, see Control Generation of Functions for Subsystems.

  • If you specify Shared code placement as Auto on the Code Generation > Interface pane of the Configuration Parameter dialog box, some utility files are in the build directory. If you specify Shared code placement as Shared location, separate files are generated for utility code in a shared location.

Compact (with separate data file)
  • Conditionally outputs model_data.c, in addition to generating model.c and model.h.

  • If you specify Shared code placement as Auto on the Code Generation > Interface pane of the Configuration Parameter dialog box, utility algorithms are defined in model.c. If you specify Shared code placement as Shared location, separate files are generated for utility code in a shared location.

  • Does not support separate source files for subsystems.

  • Does not support models with noninlined S-functions.

Compact
  • The contents of model_data.c are in model.c.

  • The contents of model_private.h and model_types.h are in model.h or model.c.

  • If you specify Shared code placement as Auto on the Code Generation > Interface pane of the Configuration Parameter dialog box, utility algorithms are defined in model.c. If you specify Shared code placement as Shared location, separate files are generated for utility code in a shared location.

  • Does not support separate source files for subsystems.

  • Does not support models with noninlined S-functions.

Command-Line Information

Parameter: ERTFilePackagingFormat
Type: character vector
Value: 'Modular' | 'CompactWithDataFile' | 'Compact'
Default: 'Modular'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Related Topics