Main Content

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

Check HDL Conformance

Enable HDL conformance checking.

Default: Off

Generate Report

Enable to generate HLS code generation report. When you enable Generate report it automatically 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

Enable to include time and date in output file header..

Default: Off

Comment in header

Specify comment lines in header of generated HLS and test bench files.

Default: None

Text entered in this field as a character vector generates a comment line in the header of the generated code. The code generator adds leading comment characters for the target language. When newlines or linefeeds are included in the text, the code generator emits single-line comments for each newline.

Complex real part postfix

Specify a character vector to append to the real part of complex signal names.

Default: _re

Complex imaginary part postfix

Specify a character vector to append to the imaginary part of complex signal names.

Default: _im

Reserved word postfix

Specify a character vector to append to value names, postfix values, or labels that are HLS reserved words.

Default: _rsvd

Create Regions automatically in the generated code

Enable to create regions in the generated HLS code. These regions can be used to perform design space exploration using the HLS tools. The generated region labels are stored inside 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

Enable to initialize the RAM elements to zero.

Default: off

HLS Code Generation: Advance Tab

Advance settings

Input Parameters

Generate instantiable code for functions

Enable to generate the function hierarchy in the generated HLS code as in the MATLAB code.

Default: off

See Also

Functions

Related Topics