Main Content

coder.hdl.stable

Define stable inputs in MATLAB design

Since R2022b

Description

coder.hdl.stable(var_name) enables you to define stable inputs in your MATLAB® code and facilitate area optimization of the synthesized High-Level Synthesis (HLS) code. You can use this pragma when an input port holds a stable value during MATLAB simulation. When you define a variable as stable, it is stored in the hardware ports instead of memory (RAM).

You must insert this pragma at the start of the MATLAB design.

This pragma does not affect MATLAB simulation behavior.

Note

For Cadence® Stratus synthesis tool, the specified stable inputs are stored inside the ml.tcl file that is read by the Cadence Stratus importer.

example

Examples

collapse all

In the MATLAB function myFun, declare the input array in2 stable by using the coder.hdl.stable pragma.

function out = myFun(in1, in2) 
    coder.hdl.stable('in2'); 
    out = int16(in1); 
    for i = 1:100 
        out = out + in2; 
    end 
end 

Input Arguments

collapse all

Input variable name, specified as a character vector.

Example: 'in2'

Version History

Introduced in R2022b

expand all