Model with Persistent Variables
R2026bPersistent variables enable you to model registers. Use persistent variables and System objects to model state and delays in a MATLAB design for HDL code generation.
Persistent array variables enable you to model RAM. By default, the HDL Coder™ software optimizes the area of your design by mapping persistent array variables to RAM.
Topics
- Map Persistent Variables and Persistent Arrays to RAM
MATLAB persistent variable and persistent array variable language support for HDL and High-Level Synthesis (HLS) code generation.
- Generate Hardware Instances for Local Functions
The following example shows how to use local functions in MATLAB, so that each execution of a local function corresponds to a separate hardware module in the generated HDL code.
- Map Persistent Arrays and dsp.Delay Objects to RAM
If your MATLAB code or Simulink MATLAB Function block contains long persistent arrays or
dsp.DelaySystem object™ objects, you can reduce the FPGA resources that your design uses by mapping them to block RAM. - Map Matrices to ROM
Map matrices to implement ROM in MATLAB and Simulink.

