Resolving References and Viewing #include Files - 2024.1 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
Release Date
2024.1 English

The Vitis unified IDE 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 Go to Declaration command to open the included file. You can also select a function name, variable, or data type and use the Go to Definition 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.

If all your project settings (like the include path) are properly defined, by default the tool will index the C source files automatically. 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 the tool 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 edit the syn.cflags or syn.file_cflags to specify directives to be used during compilation and simulation commands for the source file as discussed in HLS General Options.