Main Content

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 NameHalf Data Type SupportSingle Data Type SupportDouble Data Type Support Complex Data SupportRemarks
AbsYesYesYesYes 
AddYesYesYesYes 
AssignmentNoYesYesYes 
BiasNoYesYesYes 
Complex to Real-ImagNoYesYesYes 
DivideYesYesYesNo 
Dot ProductYesYesYesNo 
GainYesYesYesYes 
MinMaxNoYesYesNo 
Multiply-AddYesYesYesYes 
ProductYesYesYesYesIf 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 ElementsYesYesYesYes 
Real-Imag to ComplexNoYesYesNo 
Reciprocal SqrtNoYesYesNo 
ReshapeYesYesYesYes 
SqrtNoYesYesNo 
SubtractYesYesYesYes 
SumYesYesYesYes 
Sum of ElementsYesYesYesYes 
Trigonometric FunctionNoYesNoNo 
Unary MinusYesYesYesYes 
Vector Concatenate, Matrix ConcatenateYesYesYesYes 

Support for Functions in Math Function Block

In the Math Function block, HDL Coder supports native floating-point for these functions:

Math FunctionsFloating-Point SupportComplex Data Support
Half Data TypeSingle Data TypeDouble Data Type
exp NoYesNoNo
log NoYesYesNo
10^u NoYesNoNo
log10 NoYesNoNo
magnitude^2 NoYesYesYes
square NoYesNoYes
pow NoYesNoNo
conj NoYesNoYes
reciprocal YesYesYesNo
hypot NoYesNoNo
rem NoYesNoNo
mod NoYesNoNo
transpose YesYesYesYes
hermitian NoYesNoYes

Support for Simulink Blocks in Other Libraries

HDL Coder supports native floating-point for these HDL Coder block libraries.

Block LibraryHalf Data Type SupportSingle Data Type SupportDouble Data Type Support

Discrete

  • The set of delay blocks including the synchronous blocks

  • Integer Delay

  • Tapped Delay

  • Zero Order Hold

  • Set of delay blocks including the synchronous blocks, and Integer Delay, and Tapped Delay.

  • Zero Order Hold

  • Set of delay blocks including the synchronous blocks, and Integer Delay, and Tapped Delay.

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

  • Compare to Constant

  • Relational Operator

  • Logical Operator

  • Detect Change

  • Detect Increase

  • Detect Decrease

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

  • Enable, reset, input, and output ports

  • Model references

  • Subsystems

  • Enable, reset, input, and output ports

  • Model references

  • Subsystems

  • Enable, reset, input, and output ports

  • Model references

  • Subsystems

Signal Attributes

  • Data Type Conversion

  • Data Type Duplicate

  • Rate Transition

  • Signal Specification

  • Signal Conversion

  • Bus to Vector

  • Probe

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 or Linear

  • 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.

See Also

Modeling Guidelines

Functions

Topics