Main Content

Model Architecture and Design

Design models intended for C or C++ code generation

When developing Simulink® models for generated C or C++ production code, consider:

  • Modelings styles that meet common code generation requirements.

  • Data and function interface requirements.

  • Application objectives, such as efficiency and traceability.

  • Standards and guidelines compliance.

  • Scheduling requirements and relevant modeling techniques.

  • Modeling patterns for C code.

  • Products and blocks that support code generation.

  • Code generation treatment of Simulink modeling semantics.

Represent multiple algorithms with and generate code from a single model or multiple models. Decide whether to represent components as subsystems, reference models, or Stateflow® charts. Consider whether you want to generate reusable code. For an automotive system, you can use AUTOSAR software components that you develop with AUTOSAR Blockset.

Configure test or production hardware or control the location of generated code files.

As you evolve your model, use the Model Advisor to check whether the model is ready for code generation.