Closed gabrielrodcanal closed 11 months ago
hi, @gabrielrodcanal , I can not replay your error with vitis_hls 2022.2 :
my test case : $ cat a.cpp
void dut() {
hls::stream
$ cat run_hls.tcl open_project -reset proj
set_top dut add_files a.cpp
can you provide the complete case ? what version vitis_hls did you use ?
Hi @wansheg, I am using Vitis 2021.2.
The case is
$ cat stream.cpp
#include <hls_stream.h>
void my_kernel() {
hls::stream<int> inStream1;
}
You have to process it with Xilinx's clang for it to appear, not with vitis_hls. Note that I am including the stream headers from the Vitis HLS install directory. The full command is:
/home/nx08/nx08/s2081362-2/HPE/HLS/hls-build/bin/clang stream.cpp -c -emit-llvm -I/home/nx08/shared/fpga/xilinx/2021.2/Vitis_HLS/2021.2/include/ -fhls
Note: by running your run_hls.tcl script with vitis_hls the kernel is processed fine.
hi, @gabrielrodcanal , I think your commandline option is wrong , without '-triple=fpga64-xilinx-linux-gnu' option, clang will use host machine as target machine , and cause this strange error .
you should use following command line :
$BLD1/bin/clang -cc1 a.cpp -I/proj/xcohdstaff2/shengw/Rodin1/HEAD/prep/rdi/vitis_hls/common/technology/autopilot -fhls -S -emit-llvm -triple=fpga64-xilinx-linux-gnu -hls-platform-db-name=/proj/xcohdstaff2/shengw/Rodin1/HEAD/prep/rdi/vitis_hls/common/technology/xilinx/common/platform.db -hls-platform-name=zynq_slow
with abov command line , the error doesn't appear ( BTW , I used debug building version also )
you can find above command from any hls project's ${your_simple_hls_application}/project/solution/.db/autopilote/autopilote.flow.log
file
for example , in my local machine , there is one simple project 'top_arg_error'
and I have 'autopilote.flow.log' file in
top_arg_error/proj/solution1/.autopilot/db]$ vi autopilot.flow.log
there are the following explain in the command line:
all the above knowledge is from 'autopilote.flow.log' file, this file show clearly the HLS flow .
@gabrielrodcanal , hi, I suggest you should use latest hls clang to hack , because, before 22.2 , there were a lot changes on clang : such as :
@wansheg hi, that solved the error, indeed. Thank you!
The latest clang release in the repository is 2021.2. Where can I get 2022.2?
Hi, I am working on a project with the Xilinx's LLVM frontend. At this point I was testing the generation of LLVM IR with HLS streams. It turns out the compilation with Xilinx's clang fails. The error message says: clang-7.0: /home/nx08/nx08/s2081362-2/HPE/HLS/hls-llvm-project/clang/lib/CodeGen/CGCall.cpp:2561: void clang::CodeGen::CodeGenFunction::EmitFunctionProlog(const clang::CodeGen::CGFunctionInfo&, llvm::Function*, const clang::CodeGen::FunctionArgList&): Assertion `NumIRArgs == 1 && "AST argument and LLVM IR arg is not one to one mapping, can not handle it "' failed.
I am getting this error even with the minimal example:
This only happens when I enable the option -fhls (which I take it is necessary, as otherwise HLS pragmas are ignored).
The compile command used was: /home/nx08/nx08/s2081362-2/HPE/HLS/hls-build/bin/clang stream.cpp -c -emit-llvm -I/home/nx08/shared/fpga/xilinx/2021.2/Vitis_HLS/2021.2/include/ -fhls