Include MATLAB code in models that generate embeddable C code (HDL Coder)
The MATLAB Function block is available with Simulink®.
For information about the simulation behavior and block parameters, see MATLAB Function in Simulink documentation.
Canonical signed digit (CSD) or factored CSD optimization. The
default is none
. See also ConstMultiplierOptimization.
Number of registers to place at the outputs by moving existing delays within your design. Distributed pipelining does not redistribute these registers. The default is 0. See also ConstrainedOutputPipeline.
Pipeline register distribution, or register retiming. The default
is off
. See also DistributedPipelining.
Number of input pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is 0. See also InputPipeline.
Generate a VHDL® entity
or Verilog® module
for
each function. The default is off
. See
also InstantiateFunctions.
Unroll, stream, or do not optimize loops. The default is none
.
See also LoopOptimization.
Map persistent arrays to RAM. The default is off
.
See also MapPersistentVarsToRAM.
Number of output pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is 0. See also OutputPipeline.
Suppress reset logic generation. The default is default
,
which generates reset logic. See also ResetType.
Number of functionally equivalent resources to map to a single shared resource. The default is 0. See also Resource Sharing.
Generate 2-D matrices in HDL code. The default is off
.
See also UseMatrixTypesInHDL.
Warning
|
Insert a pipeline register at the output of the specified MATLAB® variable or variables. Specify the list of variables as a character vector, with spaces separating the variables.
This block supports code generation for complex signals.
See also Complex Data Type Support.
HDL Coder™ supports both tunable and non-tunable parameters with the following data types:
Scalar
Vector
Complex
Structure
Enumeration
When using tunable parameters with the MATLAB Function block:
The tunable parameter should be a Simulink.Parameter
object with the StorageClass
set to ExportedGlobal
.
x = Simulink.Parameter
x.Value = 1
x.CoderInfo.StorageClass = 'ExportedGlobal'
In the Ports and Data Manager dialog box, select the tunable check box.
For details, see Generate DUT Ports for Tunable Parameters.
If the block contains a System object™, block inputs
cannot have non-discrete (constant or Inf
) sample
time.
HDL Coder does not support a MATLAB Function that contains the same variable as the input and output of the function. For example, this MATLAB code is not supported.
function y = myFun(y) %#codegen y = 3 * y;
For the MATLAB language subset supported for HDL code generation from a MATLAB Function block, see: