UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer garryc3
Observer
2,480 Views
Registered: ‎11-20-2017

Errors while trying to run co-simulation Vivado HLS

I'm getting the following errors while trying to run co-simulation in Vivado HLS

 

INFO: [HLS 200-10] Setting target device to 'xc7z020clg484-1'
INFO: [COSIM 212-47] Using XSIM for RTL simulation.
INFO: [COSIM 212-14] Instrumenting C test bench ...
ERROR: [COSIM 212-44] Input file: C:/Users/cgarry/workspace/xilinx_hls/motorWayMonitor/proj_axi_lite/solution1/./sim/autowrap/testbench/vehicleCount_tb.cpp_pre.cpp.line.cpp
Output file: C:\Users\cgarry\workspace\xilinx_hls\motorWayMonitor\proj_axi_lite\solution1\sim\autowrap\testbench\vehicleCount_tb.cpp_pre.cpp.tb.cpp.line
Done.
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
ERROR: [COSIM 212-44] Input file: C:/Users/cgarry/workspace/xilinx_hls/motorWayMonitor/proj_axi_lite/solution1/./sim/autowrap/testbench/motorwayTraffic.cpp_pre.cpp.line.cpp
Output file: C:\Users\cgarry\workspace\xilinx_hls\motorWayMonitor\proj_axi_lite\solution1\sim\autowrap\testbench\motorwayTraffic.cpp_pre.cpp.tb.cpp.line
Done.
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
ERROR: [COSIM 212-44] Input file: C:/Users/cgarry/workspace/xilinx_hls/motorWayMonitor/proj_axi_lite/solution1/./sim/autowrap/testbench/vehicleCount.cpp_pre.cpp.line.cpp
Output file: C:\Users\cgarry\workspace\xilinx_hls\motorWayMonitor\proj_axi_lite\solution1\sim\autowrap\testbench\vehicleCount.cpp_pre.cpp.tb.cpp.line
Done.
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Build using "C:/Xilinx/Vivado/2017.4/msys/bin/g++.exe"
Compiling apatb_vehicleCount.cpp
Compiling motorwayTraffic.cpp_pre.cpp
Compiling vehicleCount.cpp_pre.cpp
Compiling vehicleCount_tb.cpp_pre.cpp
Generating cosim.tv.exe
INFO: [COSIM 212-302] Starting C TB testing ...
Result is: 8
ERROR: [COSIM 212-330] Aborting co-simulation: top function 'vehicleCount' is not invoked in the test bench.
ERROR: [COSIM 212-4] *** C/RTL co-simulation finished: FAIL ***
command 'ap_source' returned error code
while executing
"source C:/Users/cgarry/workspace/xilinx_hls/motorWayMonitor/proj_axi_lite/solution1/cosim.tcl"
invoked from within
"hls::main C:/Users/cgarry/workspace/xilinx_hls/motorWayMonitor/proj_axi_lite/solution1/cosim.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 hls::main {*}$args"
(procedure "hls_proc" line 5)
invoked from within
"hls_proc $argv"
Finished C/RTL cosimulation.

 

The C simulation and RTL synthesis are working fine but when I run co-simulation I seems to get these two errors although it does seems to run as an image is displayed and result printed. The second error seems to complain the top function "vehicleCount" is not invoked but I do call this in the testbench. 

 

Can anyone provide some extra information about these issues?

0 Kudos
19 Replies
Moderator
Moderator
2,436 Views
Registered: ‎02-07-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hi @garryc3, can you submit the files so I can have a look at the issue as first hand? If necessary, this can be done through a PM or EZmove.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer garryc3
Observer
2,422 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

I'm seeing the issue with multiple IP I'm designing in HLS. I have attached a simple RGB to grayscale filter which gets a similar error as the other IP

 

ERROR: [COSIM 212-44] Input file: C:/Users/cgarry/workspace/xilinx_hls/grayscale/proj_axi_lite/solution1/./sim/autowrap/testbench/main_tb.cpp_pre.cpp.line.cpp
Output file: C:\Users\cgarry\workspace\xilinx_hls\grayscale\proj_axi_lite\solution1\sim\autowrap\testbench\main_tb.cpp_pre.cpp.tb.cpp.line
Done.
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
ERROR: [COSIM 212-44] Input file: C:/Users/cgarry/workspace/xilinx_hls/grayscale/proj_axi_lite/solution1/./sim/autowrap/testbench/rgb2grayscale.cpp_pre.cpp.line.cpp
Output file: C:\Users\cgarry\workspace\xilinx_hls\grayscale\proj_axi_lite\solution1\sim\autowrap\testbench\rgb2grayscale.cpp_pre.cpp.tb.cpp.line
Done.
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Build using "C:/Xilinx/Vivado/2017.4/msys/bin/g++.exe"
Compiling apatb_rgb2grayScale_filter.cpp
Compiling main_tb.cpp_pre.cpp
Compiling rgb2grayscale.cpp_pre.cpp
Generating cosim.tv.exe
INFO: [COSIM 212-302] Starting C TB testing ...
Simulaton Start Time: Tue Jun 12 15:44:33 2018

Image converted to gray
Simulaton End Time: Tue Jun 12 15:44:40 2018

ERROR: [COSIM 212-330] Aborting co-simulation: top function 'rgb2grayScale_filter' is not invoked in the test bench.
ERROR: [COSIM 212-4] *** C/RTL co-simulation finished: FAIL ***
command 'ap_source' returned error code
while executing
"source C:/Users/cgarry/workspace/xilinx_hls/grayscale/proj_axi_lite/solution1/cosim.tcl"
invoked from within
"hls::main C:/Users/cgarry/workspace/xilinx_hls/grayscale/proj_axi_lite/solution1/cosim.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 hls::main {*}$args"
(procedure "hls_proc" line 5)
invoked from within
"hls_proc $argv"

0 Kudos
Observer garryc3
Observer
2,421 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

forgot testbench, this was *.cpp file but for some reason it won't let me upload it as *.cpp so I changed it to *.c

0 Kudos
Xilinx Employee
Xilinx Employee
2,385 Views
Registered: ‎05-06-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hello @garryc3,

 

Did you get Csim to pass on the code?

 

I do not get Csim to pass.

 

Thanks,
Chris

0 Kudos
Observer garryc3
Observer
2,371 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

Yes I did, what error are you receiving on the csim? Missing image file maybe?

 

Thanks,

 

Cathal

0 Kudos
Xilinx Employee
Xilinx Employee
2,360 Views
Registered: ‎05-06-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hello @garryc3,

 

You are correct.  I am missing the image files.  Can you share them or PM with them?

 

Thanks,
Chris

0 Kudos
Observer garryc3
Observer
2,339 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

I can't seem to attach an image to the reply but an image that 720p format should work, this is just a simple RGB to grayscale conversion.

 

Thanks,

 

Cathal

0 Kudos
Moderator
Moderator
2,281 Views
Registered: ‎02-07-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hi @garryc3, I too encounter C-Simulation errors. To view C-Simulation errors with the attached files:

 

1) Navigate to /v2017.4.1/

2) Run: vivado_hls -f script.tcl

 

Can you provide a similar test case so the issue can be reproduced locally?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Xilinx Employee
Xilinx Employee
2,250 Views
Registered: ‎05-06-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hello @garryc3,

 

I used an image that I had, but now I get the following warnings in Csim:

WARNING: Hls::stream 'hls::stream<ap_axiu<32, 1, 1, 1> >.1' is read while empty, which may result in RTL simulation hanging.

WARNING: Hls::stream 'hls::stream<ap_axiu<32, 1, 1, 1> >.1' is read while empty, which may result in RTL simulation hanging.

 

Any suggestions to get around them?

 

Thanks,
Chris

0 Kudos
Observer garryc3
Observer
2,207 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

Hi Peadard,

 

How do you generate the tcl script in HLS? I know how to generate it in Vivado but not HLS.

 

Thanks,

 

Cathal

0 Kudos
Observer garryc3
Observer
2,204 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

This error usually means that something isn't connected right like an input or output to a function either in the custom IP or the testbench. I reviewed the custom IP I sent and that seems fine but it might have something to do with the testbench. Can you try this simpler testbench instead of the previous one.

 

Thanks,

 

Cathal

0 Kudos
Moderator
Moderator
2,198 Views
Registered: ‎02-07-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hi @garryc3, if using the Vivado HLS GUI, a tcl script (script.tcl) is automatically generated by Vivado HLS. Check the solution1 directory. You can then copy and modify the script accordingly to create a project and run it through C-Simulation, C-Synthesis....

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer garryc3
Observer
2,195 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

Please see attached zip file which includes 

 

- setup script

- C++ files

- 720p image file

 

The testbench needs to be updated to point to this image file but bases this it should work.

 

Thanks,

 

Cathal

0 Kudos
Moderator
Moderator
2,172 Views
Registered: ‎02-07-2008

Re: Errors while trying to run co-simulation Vivado HLS

Hi @garryc3, thanks for the files however, C-Simulation still fails:

 

C:/Xilinx/Vivado/2017.4/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition
../../../../srcs/main_tb.cpp: In function 'int main()':
../../../../srcs/main_tb.cpp:253:38: warning: unknown escape sequence: '\c' [enabled by default]
../../../../srcs/main_tb.cpp:253:38: warning: unknown escape sequence: '\J' [enabled by default]
../../../../srcs/main_tb.cpp:253:38: warning: unknown escape sequence: '\g' [enabled by default]
../../../../srcs/main_tb.cpp:253:38: warning: unknown escape sequence: '\s' [enabled by default]
../../../../srcs/main_tb.cpp:253:38: warning: unknown escape sequence: '\M' [enabled by default]
../../../../srcs/main_tb.cpp:254:38: error: 'GOLDEN_IMAGE' was not declared in this scope
../../../../srcs/main_tb.cpp:282:15: error: 'OUTPUT_IMAGE' was not declared in this scope
make: *** [obj/main_tb.o] Error 1
ERROR: [SIM 211-100] 'csim_design' failed: compilation error(s).
INFO: [SIM 211-3] *************** CSIM finish ***************

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer garryc3
Observer
2,167 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

The error is saying it is missing golden image, you can set this to point to the same image as the input image. The file path to the golden image should be defined at the top of the testbench file.

 

Regards,

 

Cathal

0 Kudos
Observer garryc3
Observer
2,118 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

Did you have any luck getting this to run?

 

Regards,

 

Cathal

0 Kudos
Observer garryc3
Observer
1,934 Views
Registered: ‎11-20-2017

Re: Errors while trying to run co-simulation Vivado HLS

Can anyone help with this issue?

 

Cathal

0 Kudos
Moderator
Moderator
1,852 Views
Registered: ‎10-04-2011

Re: Errors while trying to run co-simulation Vivado HLS

Hello @garryc3,


Looking at this I see you are using 2017.4 from this line in your log:
Build using "C:/Xilinx/Vivado/2017.4/msys/bin/g++.exe"

 

I also set the input vectors to the following in order to bypass the errors that Chris and Peadar were getting, as well as added the image to the Test Bench section of the Explorer:

    IplImage *im_rgb = cvLoadImage("M6_Traffic.jpg");
    IplImage *im_golden = cvLoadImage("M6_traffic.jpg");

 

There have been a few errors that match this signature [COSIM 212-44], and nearly all have all been repaired as of the 2018.2 release, with the remaining scheduled for 2018.3 . Unfortunately, there were not good details on what the source of the error was and how these fixes resolved it.

 

That being said, I tested your design, with the golden and input vectors set to be identical as you suggested, and this passes in CoSim in 2018.2 on Windows.

 

Image converted to gray
Simulaton End Time: Thu Aug 09 15:40:52 2018

INFO: [COSIM 212-1000] *** C/RTL co-simulation finished: PASS ***

 

So, based on this, can I ask you to test your design in 2018.2 to see if that resolved it?

 

OK, I hope this helps!

Scott

1,702 Views
Registered: ‎11-10-2017

Re: Errors while trying to run co-simulation Vivado HLS

This is a response to the original problem (Errors while trying to run co-simulation, ERROR: [COSIM 212-44]):

 

I think HLS may be treating the "Picked up _JAVA_OPTIONS" line as an error.  I had a similar error, but a different java option.  When I entered "unset _JAVA_OPTIONS" before starting vivado_hls, the problem went away.

 

Jason

 

0 Kudos