Main Content


Define stable inputs in MATLAB design



coder.hdl.stable(var_name) enables you to define stable inputs in your MATLAB® code and thus facilitate area optimization of the synthesized SystemC™ code. This pragma can be used 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. The specified stable inputs are stored inside the ml.tcl file that is read by the Cadence® Stratus importer.

This pragma does not affect MATLAB simulation behavior.


collapse all

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

function out = myFun(in1, in2) 
    out = int16(in1); 
    for i = 1:100 
        out = out + in2; 

Input Arguments

collapse all

Name of the input variable, specified as a character vector.

Example: 'in2'

Version History

Introduced in R2022b