With the code generation capabilities from MathWorks® products, you can generate code from MATLAB® code or Simulink® models. Instead of writing thousands of lines of code by hand, you can increase your productivity and improve the quality of your code. You can generate code for use in applications such as signal processing, industrial controls, embedded vision, and deep learning. Generate C, C++, CUDA®, Verilog®, VHDL®, and PLC code or generate code for middleware architecture and standards such as AUTOSAR or DDS. To qualify your code for certification, verify it against standards such as ISO26262 and DO-178C.
Products for Code Generation
C2000 Microcontroller Blockset
Design, simulate, and implement applications for Texas Instruments C2000 microcontrollers
DO Qualification Kit
Qualify Simulink and Polyspace verification tools for DO-178, DO-278, and DO-254
C/C++ Code Generation
- Code Generation by Using Embedded Coder (Embedded Coder)
MathWorks code generation technology produces C or C++ code and executable programs for algorithms.
- Deploy Algorithm Model for Real-Time Rapid Prototyping (Simulink Coder)
Deploy algorithm model for testing in real time.
- Generate C Code by Using the MATLAB Coder App (MATLAB Coder)
Generate C/C++ code from MATLAB code by using the MATLAB Coder™ app.
HDL Code Generation
- Generate Code and Synthesize on FPGA Using HDL Workflow Advisor (HDL Coder)
The HDL Workflow Advisor guides you through the stages of generating HDL code for a Simulink subsystem and the FPGA design process, such as:
- Basic HDL Code Generation and FPGA Synthesis from MATLAB (HDL Coder)
This example shows how to create a HDL Coder™ project, generate code for your MATLAB® design, and synthesize the HDL code.
- Verify HDL Design Using SystemVerilog DPI Test Bench (HDL Coder)
This example shows how to use SystemVerilog DPI test bench for verification of HDL code where a large data set is required.
GPU Code Generation
- Code Generation by Using the GPU Coder App (GPU Coder)
Generate CUDA code from MATLAB code by using the GPU Coder™ app.
- Code Generation from Simulink Models with GPU Coder (GPU Coder)
Generate CUDA code from Simulink models by using GPU Coder.
- Code Generation for Deep Learning Networks (GPU Coder)
Get started with CUDA code generation for image classification networks such as
PLC Code Generation
- Generating Ladder Diagram Code from Simulink (Simulink PLC Coder)
Generate Ladder Diagram code (L5X) from Simulink.
- Generate Structured Text Code for a Simple Simulink Subsystem (Simulink PLC Coder)
This example shows how to select the target IDE for a Simulink® model, generate code, and view generated files.
- Model, Simulate, and Generate Code for Ladder Logic-Based Elevator Controller (Simulink PLC Coder)
Rapidly prototype the ladder logic-based controller for a single car elevator by using Simulink® PLC Coder™ to model and simulate the ladder logic.
Code Generation for Middleware Architectures
- Generate AUTOSAR C Code and XML Descriptions (AUTOSAR Blockset)
Generate AUTOSAR-compliant C code and export AUTOSAR XML (ARXML) descriptions from AUTOSAR component model.
- Generate AUTOSAR Adaptive C++ Code and XML Descriptions (AUTOSAR Blockset)
Generate AUTOSAR-compliant C++ code and export AUTOSAR XML (ARXML) descriptions from AUTOSAR adaptive component model.
- DDS Blockset Shapes Demo (DDS Blockset)
DDS Blockset implementation of Shapes Demo.
Certification and Standards
- Highway Lane Following: A Model-Based Design Example for ISO 26262:2018 (IEC Certification Kit)
Demonstrates the use of Simulink to apply a Model-Based Design workflow to an ISO 26262 ASIL D project.
- Helicopter Flight Control: A Model-Based Design Example for DO-178C and DO-331 (DO Qualification Kit)
Demonstrates the use of the DO-178C project template in a helicopter flight control project.