HDLCoder Design Patterns and Examples
Version 4.0 (9.66 MB) by
Kiran Kintali
Several tutorials in this submission show how to generate HDL from MATLAB code, Simulink models, and Simscape models.
This submission has examples showing how to generate HDL Code from MATLAB code, Simulink models and Simscape models using HDL Coder.
About HDL Coder:
HDL Coder™ enables high-level design for FPGAs, SoCs, and ASICs by generating portable, synthesizable Verilog® and VHDL® code from MATLAB® functions, Simulink® models, and Stateflow® charts. You can use the generated HDL code for FPGA programming, ASIC prototyping, and production design.
HDL Coder automates prototyping generated code on Xilinx®, Intel®, and Microchip boards and generates IP cores for ASIC and FPGA workflows. You can optimize for speed and area, highlight critical paths, and generate resource utilization estimates before synthesis. HDL Coder provides traceability between Simulink models and generated Verilog and VHDL code, enabling code verification for high-integrity applications adhering to DO-254 and other standards.
This submission has examples showing how to generate HDL code from MATLAB code, Simulink models, and Simscape models using HDL Coder.
MATLAB to HDL (matlabhdl/): 21 application domains including DSP filters (FIR, IIR, LMS), image processing (Sobel, median filter, HDR, JPEG, corner detection), communications (Viterbi, AES, data packet), radar (Kalman filter, beamformer, matched filter), FFT, math operations, controls (PID), finance (Black-Scholes), frame-based processing (fog rectification, demosaicing), float-to-fixed-point conversion, HDL optimizations (pipelining, sharing, RAM mapping), System Objects, HW/SW co-design (IP core, FIFO), and HLS/Vitis targets (BNN, SpGEMM, 3D rendering).
Simulink to HDL (simulinkhdl/): Design pattern models for counters, delays, FSMs, bit operations, saturation, CORDIC, FFT, FIR (fixed/single/half precision), Viterbi, OFDM, LED blinking, and frame-based processing (blur, optical flow, Harris corner detection, histogram equalization, adaptive median filter).
Simscape to HDL (rcphil/): 35+ power electronics converter models for FPGA hardware-in-the-loop simulation covering DC-DC (buck, boost, flyback, LLC), AC-DC (rectifiers, Vienna, Swiss, NPC), DC-AC (inverters, MMC), motor drives (PMSM, DC motor), and transformers, with synthesis benchmarks.
Use hdl_demo_setup('keyword') to search and open any MATLAB example by keyword.
Cite As
Kiran Kintali (2026). HDLCoder Design Patterns and Examples (https://www.mathworks.com/matlabcentral/fileexchange/50098-hdlcoder-design-patterns-and-examples), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2025b
Compatible with any release to R2012b
Platform Compatibility
Windows macOS LinuxCategories
- Code Generation >
- Code Generation > HDL Coder >
- FPGA, ASIC, and SoC Development > HDL Coder >
- FPGA, ASIC, and SoC Development >
Find more on Code Generation in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 4.0 | Update to R2025b Release. Significant bug fixes and improvements. |
||
| 3.0 | Updated MATLAB examples with R2023a release. Also attached new design pattern models with Simulink, Stateflow, MATLAB Function Blocks and Simscape. |
||
| 2.0 | Significant improvements and several new examples. |
||
| 1.1.0.1 | Updated license |
||
| 1.1.0.0 | minor update: cleanup few mlint messages. |
