By default, the AMD 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:
- 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 Vitis HLS tool will index the C source files automatically when you first open the project. If some settings are incomplete, you can manually index the C source files to allow the tool to jump to the right definition of the variables, functions, and data types.
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 , 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 , click General, and make sure Disable Parsing All Header Files is deselected.