Model Configuration

Configure models for simulation and code generation

The model configuration parameters for code generation define how the code generator produces code and builds an executable from your model. The Model Advisor checks that your model meets standards and guidelines and is ready to generate code. The Code Generation Advisor reviews your model based on objectives that you specify. To extend capabilities beyond the predefined efficiency, traceability, Safety precaution, and debugging objectives, create custom objectives.

Blocks

expand all

Custom MATLAB fileUpdate active configuration parameters of parent model by using file containing custom MATLAB code
ERT (optimized for fixed-point)Update active configuration parameters of parent model for ERT fixed-point code generation
ERT (optimized for floating-point)Update active configuration parameters of parent model for ERT floating-point code generation
GRT (debug for fixed/floating-point)Update active configuration parameters of parent model for GRT fixed-point or floating-point code generation
GRT (optimized for fixed/floating-point)Update active configuration parameters of parent model for GRT fixed-point or floating-point code generation

Classes

expand all

rtw.codegenObjectives.ObjectiveCustomize code generation objectives

Topics

Getting Started

Code Generation Configuration

Modify the model configuration parameters specific to code generation from the Configuration Parameters Dialog box.

Code Generation Configuration

Configure Code Generation Parameters for Model Programmatically

Modify the model configuration parameters specific to code generation from the MATLAB® command line.

Generate Code by Using the Quick Start Tool

Prepare a model for quickly generating readable, efficient code.

Configuration Variations

Retarget code generation from a model with multiple configuration sets.

Use Configuration Reference to Select Code Generation Target

Select a code generation target for a model reference hierarchy without modifying individual models.

Configure and Optimize Model with Configuration Wizard Blocks

Easily configure and optimize code generation options with Configuration Wizard blocks and scripts.

Model Advisor

Check Your Model Using the Model Advisor

Use the Model Advisor to check a model or subsystem for conditions and configuration settings that you select, including conditions that cause inaccurate or inefficient simulation.

Check Model and Configuration for Code Generation

Assess model readiness to generate code by using the Model Advisor and Code Generation Advisor.

Embedded Coder Model Advisor Checks for Standards, Guidelines, and Code Efficiency

Use Embedded Coder® Model Advisor checks to assess model readiness to generate code.

Simulink Coder Model Advisor Checks for Standards and Code Efficiency

Use Simulink® Coder™ Model Advisor checks to assess model readiness to generate code.

Modeling Guidelines for Model Configuration

When you develop models and generate code, use the modeling guideline configuration recommendations.

Code Generation Advisor

Configure Model for Code Generation Objectives by Using Code Generation Advisor

Use the Code Generation Advisor to check your model against code generation objectives.

Configure Code Generation Objectives Programmatically

Configure your code generation objectives from the MATLAB command line.

Create Custom Code Generation Objectives

Create predefined code generation objectives to meet your requirements.

Recommended Settings Summary for Model Configuration Parameters

Summary of code generation parameters for tuning model and target configurations.

Code Generation Advisor Checks

Facilitate designing Simulink models and subsystems and troubleshooting code generation by using Code Generation Advisor checks.

Model Configuration Parameters: Code Generation

Model Configuration Parameters: Code Generation

General parameters for defining code generation for a model's active configuration set, including target selection, documentation, and build process.

Model Configuration Parameters: Code Generation Optimization

Parameters for configuring code optimization.

Model Configuration Parameters: Code Generation Report

Parameters for configuring code generation reports.

Model Configuration Parameters: Comments

Parameters for controlling the comments that you want to automatically generate and insert into the generated code.

Model Configuration Parameters: Code Generation Identifiers

Parameters for selecting automatically generated naming rules for identifiers in code generation.

Model Configuration Parameters: Code Generation Custom Code

Parameters for creating a list of custom C code, folders, source files, and libraries to include in generated files.

Model Configuration Parameters: Code Generation Interface

Parameters for selecting the target software environment, output variable name modifier, and data exchange interface.

Model Configuration Parameters: Code Style

Parameters for controlling the automatically generated code style for readability.

Model Configuration Parameters: Code Generation Verification

Code verification and performance analysis parameters for SIL and PIL simulations.

Model Configuration Parameters: Code Generation Templates

Parameters for customizing generated code organization.

Model Configuration Parameters: Code Generation Code Placement

Parameters for specifying data placement in the generated code.

Model Configuration Parameters: Code Generation Data Type Replacement

Parameters for replacing built-in data type names with user-defined replacement data type names in the generated code.

Model Configuration Parameters: Code Generation AUTOSAR

Parameters for controlling AUTOSAR code generation.

Related Information

Featured Examples