Resolving References and Viewing #include Files - 2022.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2022-12-07
Version
2022.2 English

By default, the Vitis HLS GUI continually parses all header files to resolve coding references. Valid references allow the code to compile correctly of course, but also let you right-click on an #include statement to use the Open Declaration command to open the included file. You can also select a function name, variable, or data type and use the Open Declaration command to view its definition.

The GUI highlights unresolved references, as shown in the following figure:

Figure 1. Unresolved References
  • Left sidebar: Highlights unresolved references at the line number of the source code.
  • Right sidebar: Displays unresolved references relative to the whole file.

Unresolved references occur when code defined in a header file (.h or .hpp extension) cannot be resolved. The primary causes of unresolved references are:

  • The code was recently added to the file.

    If the code is new, ensure the header file is saved. After saving the header file, Vitis HLS automatically indexes the header files and updates the code references.

  • The header file is not in the search path.

    Ensure the header file is included in the C code using an #include statement, and the header file is found in the same directory as the source C file, or the location to the header file is in the search path.

    Tip: To explicitly add the search path for a source file, select Project > Project Settings, click Synthesis or Simulation, and use the Edit CFLAGs or Edit CFLAGs commands for the source file as discussed in Creating a New Vitis HLS Project.
  • Automatic indexing has been disabled.

    Ensure that Vitis HLS is parsing all header files automatically. Select Project > Project Settings, click General, and make sure Disable Parsing All Header Files is deselected.

Tip: To manually force Vitis HLS to index all C files, select the Project > Index C Source command from the main menu. This enables the tool to open the declaration of a selected function, variable, or data type if it occurs in an included file.