Code Generation

Generate HDL code and test bench, export design for system integration

Apps

HDL Coder Generate HDL code from MATLAB code

Functions

codegenGenerate HDL code from MATLAB code
coder.configCreate HDL Coder code generation configuration objects
hdlcoder.CodingStandardCreate HDL coding standard customization object
hdlsetuptoolpathSet up system environment to access FPGA synthesis software

Classes

coder.HdlConfigHDL codegen configuration object

Objects

hdl.BlackBoxBlack box for including custom HDL code

Properties

Examples and How To

Code Generation

Create and Set Up Your Project

At the MATLAB® command line, enter:

HDL Code Generation from System Objects

This example shows how to generate HDL code from MATLAB® code that contains System objects.

Generate Instantiable Code for Functions

You can use the Generate instantiable code for functions option to generate a VHDL® entity or Verilog® module for each function.

Integrate Custom HDL Code Into MATLAB Design

Include pre-existing HDL code in your MATLAB design

Specify the Clock Enable Rate

Configure clock enable to run at design base rate or input data rate.

Minimize Clock Enables

Generate code for registers without clock enables

Coding Standards

Generate an HDL Coding Standard Report from MATLAB

How to generate a coding standard report for a model

Generate an HDL Lint Tool Script

How to generate lint tool scripts and integrate with third-party tools

External Component Generation

Enable MATLAB Function Block Generation

During HDL code generation, your MATLAB algorithm must go through the floating-point to fixed-point conversion process, even if it is already a fixed-point algorithm.

System Design with HDL Code Generation from MATLAB and Simulink

This example shows how to generate a MATLAB Function block from a MATLAB® design for system simulation, code generation, and FPGA programming in Simulink®.

Generate Board-Independent IP Core from MATLAB Algorithm

Board-independent IP core generation from MATLAB

Concepts

Reports

HDL Coding Standards

Learn about HDL coding standards and the various kinds of rules.

HDL Coding Standard Report

What is an HDL coding standard report, the rule summary, and how you can fix warnings or errors related to rule violations.

Code Generation Reports

View code generation results.

HDL Coding Standard Rules Reference

Basic Coding Practices

Contains a list of various kinds of rules related to basic coding practices, the rule description, and how you can fix warnings or errors resulting from rule violations.

RTL Description Techniques

Contains a list of various kinds of rules related to RTL description techniques, the rule description, and how you can fix warnings or errors resulting from rule violations.

RTL Design Methodology Guidelines

Contains a list of various kinds of rules related to RTL design methodology, the rule description, and how you can fix warnings or errors resulting from rule violations.

Code Generation and External Component Generation

Custom IP Core Generation

Using the HDL Workflow Advisor, you can generate a custom IP core from a model or algorithm.

HDL Workflow Advisor

Overview of the HDL Workflow Advisor

Featured Examples