MATLAB to HLS Code Generation Options
MATLAB to HLS Code Generation
The MATLAB to HLS Workflow task in the HDL Workflow Advisor generates HLS code from MATLAB® code. You can also simulate and verify the generated HLS code.
HLS Code Generation: Target Tab
Select target hardware and required outputs.
Input Parameters
- Language
Select the HLS output language.
Target language is
SystemC
when Synthesis tool is set toNo synthesis tool specified
orCadence Stratus
. Target language isSynthesizableC++
when Synthesis tool is set toXilinx Vitis HLS
.Default:
SystemC
- Check HDL Conformance
Enable HDL conformance checking.
Default: Off
- Generate Report
Select to generate HLS code generation report. Selecting Generate report enables traceability.
Default: On
- Enable traceability
Enable to trace the MATLAB code and the generated HLS code.
Default: On
HLS Code Generation: Coding Style Tab
Parameters that affect the style of the generated code.
Input Parameters
- Preserve MATLAB code comments
Include MATLAB code comments in generated code.
Default: On
- Include MATLAB source code as comments
Include MATLAB source code as comments in the generated code. The comments precede the associated generated code. Includes the function signature in the function banner.
Default: Off
- Emit time/date stamp in the header
Select to include time and date in output file header.
Default: Off
- Comment in header
Specify comments to include in the headers of generated HLS and test bench files.
Default: None
The code generator adds leading comment characters for the target language. When you include newline or linefeed characters the code generator produces a single-line comment for each newline or linefeed.
- Complex real part postfix
Specify text to append to the real part of complex signal names.
Default:
_re
- Complex imaginary part postfix
Specify text to append to the imaginary part of complex signal names.
Default:
_im
- Reserved word postfix
Specify text to append to variable names, constants, or other MATLAB code element names that are HLS reserved words.
Default:
_rsvd
- Create Regions automatically in the generated code
Select to create regions in the generated HLS code. Use these regions to perform design space exploration using the HLS tools. The generated region labels are stored in the
ml.tcl
file.Default: Off
HLS Code Generation: Clocks & Ports Tab
Clocks & Ports settings
Input Parameters
- Max number of I/O pins for FPGA deployment
Specify the maximum number of I/O pins for your target FPGA. If the DUT pin count in the generated code exceeds the value of this parameter, HDL Coder™ generates the message specified by the Check for DUT pin count exceeding I/O Threshold parameter in the Conformance Report.
Default:
5000
- Check for DUT pin count exceeding I/O Threshold
Specify the type of message to return if the DUT pin count exceeds the I/O threshold set by the Max number of I/O pins for FPGA deployment parameter.
Default:
Error
HLS Code Generation: Optimizations Tab
Optimization settings
Input Parameters
- Map persistent array variables to RAMs
Select to map persistent array variables to RAMs instead of mapping to shift registers.
Default: Off
Dependencies:
RAM Mapping Threshold
Persistent variable names for RAM Mapping
- RAM Mapping Threshold
Specify the minimum RAM size required for mapping persistent array variables to RAMs.
Default: 256
- Initialize Block Ram
Select to initialize the RAM elements to zero.
Default: off
- Saturate on integer overflow
Select to generate code to handle integer overflow. Overflows saturate to either the minimum or maximum value that the data type can represent.
If you clear this option, the code generator does not produce code to handle integer overflow. Instead, integer values wrap on overflow.
This parameter applies only to MATLAB built-in integer types. It does not apply to doubles, singles, or fixed-point data types.
Default: on
HLS Code Generation: Advance Tab
Advanced settings
Input Parameters
- Generate instantiable code for functions
Select to generate the same function hierarchy in the generated HLS code as in the MATLAB code.
Default: off
- Array Layout
Generate HLS code that uses column-major layout or row-major layout.
Default:
Column Major