Top - Top - 2026.1 English - UG1399

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2026-06-23
Version
2026.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

Form Syntax
Pragma #pragma HLS top name=<string>
Config File syn.directive.top=[OPTIONS] <loc> name=<string>
Tcl set_directive_top [OPTIONS] -name <string>

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

#pragma HLS top name=<string>
name=<string>
Specifies the name to be used by the set_top command.

Options

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

Example

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.