All fixed-point blocks support code generation, except particular simulation features. The sections that follow describe the code generation support that the Fixed-Point Designer™ software provides. You must have a Simulink® Coder™ license to generate C code or a HDL Coder™ license to generate HDL code.
C code generation is supported with the use of Simulink Coder. HDL code generation is supported with the use of HDL Coder.
Fixed-point code generation supports all integer and fixed-point data types that are supported by simulation. Word sizes of up to 128 bits are supported in simulation. See Supported Data Types.
All rounding modes—
Zero — are supported.
Saturation and wrapping are supported.
Wrapping generates the most efficient code.
Currently, you cannot choose to exclude saturation code automatically when hardware saturation is available. Select wrapping in order for the Simulink Coder product to exclude saturation code.
All blocks generate code for all operations with a few exceptions.
The Lookup Table Dynamic block generates code for all
lookup methods except
The Simulink Block Data Type Support table summarizes characteristics of blocks in the Simulink block library, including whether they support fixed-point data types and any limitations that apply for C code generation. To view the table, enter the following command at the MATLAB® command line:
Any binary-point-only scaling and [Slope Bias] scaling that is supported in simulation is supported, bit-true, in code generation.