Main Content

Code Generation Goal Summary

Use this table to find Embedded Coder® information based on your project goals.

GoalsRelated Information
Get familiar with the product by using tutorials and learning about concepts.

Avoid or minimize project rework by considering code generation from the beginning of the model design process

  • Divide software problem into parts and map aspects of your system architecture to Simulink modeling environment elements.

  • Model software interfaces.

  • Modularize design by using Simulink component-based modeling options and reuse techniques.

  • Import external MATLAB®, C, or C++ code.

  • Design timer and scheduling support.

  • Design models based on recommended guidelines and for generating code that complies with industry standards.

  • Use blocks for embedded processors and operating systems.

Architecture and Component Design

Generate code from model design.

  • Configure code interfaces.

  • Check whether model is ready for code generation.

  • Generate source code.

  • Compile generated source code and link object code.

  • Generate shared libraries and reusable utility code.

  • Generate reports of code generation results.

Code Generation

Deploy generated code.

  • Integrate generated callable function code into a main program.

  • Adapt a generated program to run without an external real-time executive or operating system on target hardware.

  • Integrate a generated program with an operating system or board support package.

  • Relocate static and generated code files for a model to another development environment.

  • Use a generated shared library in application code.

  • Package and share artifacts generated for a model with a third party without revealing intellectual property.

  • Run accelerated simulations and deploy standalone simulations outside of the MATLAB and Simulink® environment.

Deployment, Integration, and Supported Hardware

Optimize generated code by minimizing memory requirements and speeding up execution.

  • Optimize use of RAM, ROM, and stack space by generated code.

  • Improve execution speed of generated code.

  • Reduce data copies.

  • Apply code replacement libraries.

  • Make tradeoffs when generating optimized code.

  • Generate code for high-throughput computing applications.

Code Efficiency

Customize generated code and code generation tools for project or organization.

  • Customize data representation to ease integration with external code and support interactivity and instrumentation.

  • Create code interface definitions for standardization and software architecture conformance.

  • Create and maintain code replacement libraries.

  • Customize how the code generator produces code.

  • Define code generation behavior for custom blocks.

  • Use the Target Language Compiler to customize generated code, inline code generated for custom blocks, and generate additional or different types of files.

  • Capture target hardware information for MathWorks® software.

  • Provide the code generator with information about a target platform and required code features.

  • Customize the compilation stage of the build process.

  • Create software for deploying MATLAB and Simulink designs to hardware platforms.

Code and Tool Customization

Verify and test generated code.

  • Monitor signals and tune model parameters in your target application.

  • Profile code execution to determine whether generated code meets performance requirements.

  • Test numeric equivalence.

  • Test integrated component software in the target environment.

  • Check for unintended functionality by comparing model and code coverage.

  • Verify generated code by using code analysis tools.

  • Qualify Embedded Coder for IEC certification.

Verification, Testing, and Certification

Integrate generated code from previous releases with generated code from the current release.

Cross-Release Support

Generate C/C++ code from MATLAB code for embedded systems.

  • Control the appearance of identifiers, code style, comments, and function and file banners in generated code.

  • Control the representation of global variables.

  • Verify numerical equivalence between MATLAB code and generated code.

  • Improve efficiency of generated code.

  • Create and maintain code replacement libraries.

Code Generation from MATLAB Code