取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
Highlighted
803 次查看
注册日期: ‎08-04-2018

HLS在C仿真时报错,找不到头文件

我在学习HLS遇到如下问题,工程已经添加自定义的.h文件。但是在c仿真时报错

:   Compiling ../../../src/vectorAdd_tb.cpp in debug mode
../../../src/vectorAdd_tb.cpp:6:23: fatal error: vectorAdd.h: No such file or directory
compilation terminated.image.png

 

 

 

0 项奖励
1 回复
Highlighted
Xilinx Employee
Xilinx Employee
774 次查看
注册日期: ‎07-17-2008

不需要将.h加入工程,工具会自动将/vector/src设为include文件夹。如果.h和.cpp在同一文件夹,那么不需要额外操作就可以关联头文件。如果.h位于工程自动包含的文件夹之外的位置,则需要设置CFLAGS,用-I选项指定其文件夹。

以下描述摘自UG902文档:

IMPORTANT: Do not add header files (with the .h suffix) to the project using the Add Files button (or with the associated add_files Tcl command).

Vivado HLS automatically adds the following directories to the search path:
• Working directory
Note: The working directory contains the Vivado HLS project directory.
• Any directory that contains C files added to the project
Header files that reside in these directories are automatically included in the project.

You must specify the path to all other header files using the Edit CFLAGS button.
The Edit CFLAGS button specifies the C compiler flags options required to compile the C code. These compiler flag options are the same used in gcc or g++. C compiler flags include the path name to header files, macro specifications, and compiler directives, as shown in the following examples:
-I/project/source/headers: Provides the search path to associated header files
Note: You must specify relative path names in relation to the working directory not the project
directory.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------