pragma HLS top - 2021.1 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2021-06-16
Version
2021.1 English

Description

Attaches a name to a function, which can then be used with the set_top command to synthesize the function and any functions called from the specified top-level. This is typically used to synthesize member functions of a class in C/C++.

Specify the TOP pragma in an active solution, and then use the set_top command with the new name.

Syntax

Place the pragma in the C source within the boundaries of the required location.

#pragma HLS top name=<string>

Where:

name=<string>
Specifies the name to be used by the set_top command.

Examples

Function foo_long_name is designated the top-level function, and renamed to DESIGN_TOP. After the pragma is placed in the code, the set_top command must still be issued from the Tcl command line, or from the top-level specified in the IDE project settings.

void foo_long_name () {
  #pragma HLS top name=DESIGN_TOP
  ...
}

Followed by the set_top DESIGN_TOP command.