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: 
Highlighted
Observer varun.nagpal
Observer
140 Views
Registered: ‎11-20-2018

C/RTL Co-simulation error [COSIM 212-360] on HLS 2018.1 (CentOS Linux ) but not on HLS 2018.2(windows)

I am getting some bizarre issue in getting C/RTL Co-simulation working. Below is summary of the problem

  • Platform: Windows 7 x64
  • Vivado HLS version: 2018.2
  • C-simulation: PASS
  • C-synthesis: PASS
  • C/RTL Co-simulation: FAIL. The error generated is as follows:
ERROR: [COSIM 212-360] Aborting co-simulation: C TB simulation failed.
ERROR: [COSIM 212-320] C TB testing failed, stop generating test vectors. Please check C TB or re-run cosim.
command 'ap_source' returned error code
    while executing
"source D:/hls/k/solution1/cosim.tcl"
    invoked from within
"hls::main D:/hls/k//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.

 

I had gone through many posts on this forum related to above error, and I tried all of those on my Vivado HLS on Windows but none seemed to work. And then I tried everything else, but nothing was working.

Lastly it seemed to me maybe this is an issue with windows vs linux platform. And then I took my HLS code to CentOS. 

  • Platform: Centos 6.1
  • Vivado HLS version: 2018.1
  • C-simulation: PASS
  • C-synthesis: PASS
  • C/RTL Co-simulation: PASS only if I set CFLAGS for testbench cpp file -std=c++0x, otherwise FAIL.

On Linux initially I also got errors running co-simulation, but it gave me a different error(note: function and file names are mangled in the log below to XXXXXXX)

WARNING: [COSIM 212-369] AXI_master port 'hp0_data' has a depth of '1114129'. Insufficient depth may result in simulation mismatch or freeze.
   Build using "/opt/xilinx_vivado_18.1/Vivado/2018.1/lnx64/tools/gcc/bin/g++"
   Compiling apatb_XXXXXXX.cpp
   Compiling XXXXXXX.cpp_pre.cpp.tb.cpp
   Compiling XXXXXXX_tb.cpp_pre.cpp.tb.cpp
/opt/k/XXXXXXX_tb.cpp: In function ‘void XXXXXXX(const volatile int*, tb_data_t, volatile tb_data_t*)’:
/opt/k/XXXXXXX_tb.cpp:71:12: error: ‘begin’ is not a member of ‘std’
/opt/k/XXXXXXX_tb.cpp:71:42: error: ‘end’ is not a member of ‘std’
make: *** [obj/KXXXXXXX_tb.cpp_pre.cpp.tb.o] Error 1
ERROR: [COSIM 212-317] C++ compile error.
ERROR: [COSIM 212-321] EXE file generate failed.
ERROR: [COSIM 212-321] EXE file generate failed.
ERROR: [COSIM 212-331] Aborting co-simulation: C simulation failed, compilation errors.
ERROR: [COSIM 212-4] *** C/RTL co-simulation finished: FAIL ***
command 'ap_source' returned error code
    while executing
"source /opt/k/solution1/cosim.tcl"
    invoked from within
"hls::main /opt/k/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.

After  going through the problem (error: ‘begin’ is not a member of ‘std’) , I found that perhapps I need to add compiler flag for c++11 support. And so I added -std=c++0x CFLAGS option to my testbench file. And then C/RTL Co-simulation worked on Centos. However, I also tried to do the same on Windows HLS but this time it gave me very strange errors (not sharing here) and C/RTL co-simulation continues to fail on Windows. It also fails on Vivado HLS 2019.1 on Windows.

I have attached a zip file with my HLS CPP, Testbench CPP and other headers. If someone can have a look at my code and let me know whether the issue is in my hls or testbench code or is it something to do with C++11/14/17 support missing on mingw mysys port of g++/gcc compiler on windows ?

0 Kudos