Native Floating Point Support for Simulink Blocks
You can use HDL Coder™ native floating-point to generate target-independent HDL code from a floating-point design. Floating-point designs have better precision, higher dynamic range, and a shorter development cycle than fixed-point designs. If your design has complex math and trigonometric operations, use native floating-point technology.
This page lists the Simulink® blocks and parameter settings that you can use with HDL Coder native floating point.
HDL Floating Point Operations Library
In the HDL Floating Point Operations library, HDL Coder supports blocks that have
single
and double
data types in the native
floating-point mode. For certain blocks, such as Discrete-Time Integrator and
Discrete PID Controller, use zero latency strategy.
When you use half
types, HDL Coder supports native floating-point for these blocks:
Support for Simulink Blocks in Math Operations Library
In the Math Operations library, HDL Coder supports native floating-point for these blocks and data types:
Block Name | Half Data Type Support | Single Data Type Support | Double Data Type Support | Complex Data Support | Remarks |
---|---|---|---|---|---|
Abs | Yes | Yes | Yes | Yes | |
Add | Yes | Yes | Yes | Yes | |
Assignment | No | Yes | Yes | Yes | |
Bias | No | Yes | Yes | Yes | |
Complex to Real-Imag | No | Yes | Yes | Yes | |
Divide | Yes | Yes | Yes | No | |
Dot Product | Yes | Yes | Yes | No | |
Gain | Yes | Yes | Yes | Yes | |
MinMax | No | Yes | Yes | No | |
Multiply-Add | Yes | Yes | Yes | Yes | |
Product | Yes | Yes | Yes | Yes | If you configure the block to perform matrix multiplication by setting the
Multiplication block parameter to
Matrix(*) , the
DotProductStrategy must be set to Fully
Parallel . |
Product of Elements | Yes | Yes | Yes | Yes | |
Real-Imag to Complex | No | Yes | Yes | No | |
Reciprocal Sqrt | No | Yes | Yes | No | |
Reshape | Yes | Yes | Yes | Yes | |
Sqrt | No | Yes | Yes | No | |
Subtract | Yes | Yes | Yes | Yes | |
Sum | Yes | Yes | Yes | Yes | |
Sum of Elements | Yes | Yes | Yes | Yes | |
Trigonometric Function | No | Yes | No | No | |
Unary Minus | Yes | Yes | Yes | Yes | |
Vector Concatenate, Matrix Concatenate | Yes | Yes | Yes | Yes |
Support for Functions in Math Function Block
In the Math Function block, HDL Coder supports native floating-point for these functions:
Math Functions | Floating-Point Support | Complex Data Support | ||
---|---|---|---|---|
Half Data Type | Single Data Type | Double Data Type | ||
exp
| No | Yes | No | No |
log
| No | Yes | Yes | No |
10^u
| No | Yes | No | No |
log10
| No | Yes | No | No |
magnitude^2
| No | Yes | Yes | Yes |
square
| No | Yes | No | Yes |
pow
| No | Yes | No | No |
conj
| No | Yes | No | Yes |
reciprocal
| Yes | Yes | Yes | No |
hypot
| No | Yes | No | No |
rem
| No | Yes | No | No |
mod
| No | Yes | No | No |
transpose
| Yes | Yes | Yes | Yes |
hermitian
| No | Yes | No | Yes |
Support for Simulink Blocks in Other Libraries
HDL Coder supports native floating-point for these HDL Coder block libraries.
Block Library | Half Data Type Support | Single Data Type Support | Double Data Type Support |
---|---|---|---|
Discrete |
|
|
|
HDL Operations | Blocks in this library are not supported. | All blocks are supported. | All blocks are supported. |
HDL RAMs | Blocks in this library are not supported. | All blocks are supported. | All blocks are supported. |
HDL Subsystems | All blocks are supported. | All blocks are supported. | All blocks are supported. |
Logic and Bit Operations |
| All blocks are supported. | All blocks are supported. |
Lookup Tables | Blocks in this library are not supported. | All blocks are supported. | All blocks are supported. |
Model Verification | Blocks in this library are not supported. | All blocks are supported. | All blocks are supported. |
Model-Wide Utilities | Blocks in this library are not supported. | All blocks are supported. | All blocks are supported. |
Ports & Subsystems |
|
|
|
Signal Attributes |
| All blocks are supported. | All blocks are supported. |
Signal Routing | All blocks are supported. | All blocks are supported. | All blocks are supported. |
Sources | Inport, Constant, and Ground blocks. | Inport, Constant, and Ground blocks. | Inport, Constant, and Ground blocks. |
Sinks | All blocks are supported. | All blocks are supported. | All blocks are supported. |
User-Defined Functions | MATLAB Function blocks. | MATLAB Function blocks. | MATLAB Function blocks. |
Support for Stateflow Charts
HDL Coder supports Stateflow® charts with these data types when generating code in native floating-point mode:
Floating-point constants
Floating-point inputs
Function calls with floating-point arguments
Floating-point arithmetic operations
These chart types are supported:
Classic charts
Mealy charts
State transition tables
Truth tables
Requirement tables
Stateflow charts and Moore charts with conditional transitions are not supported. For more information on conditional transitions in Stateflow charts, see Transition Between Operating Modes (Stateflow).
Simulink Block Restrictions
HDL Coder does not support native floating-point for these blocks or block architectures:
Dot Product blocks that have complex-valued input or output data with the Architecture parameter set to
Tree
orLinear
Dead Zone and Dead Zone Dynamic blocks
Polar to Cartesian blocks
For the Data Type Conversion block:
The Input and output to have equal parameter cannot be set to
Stored Integer (SI)
.The Saturate on integer overflow check box must be left cleared.