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!
08-01-2017 03:48 AM
There is a little information about Application Debug in the SDAccel Environment in the SDAccel_User_Guide.I‘m doing some sw_emu in SDAccel,the program runs,but with a wrong result.CPU prepares the right initial data,but when trans to the FPGA,data goes wrong.(DATA are 100 structures in a vector).I want to know how to debug the program in GUI mode and cmd line with Gdb,please give me some help,thx
08-01-2017 08:57 PM
I mean the host.cpp code not the debug information.
Anyay, you may also use xcl_memcpy_to_device() instead of the object copy function.
Which should be easier to make it work.
There is also a custom data structure example in the sdaccel github example.
it is located at /kernel_to_gmem/custom_datatype_ocl
Check it and see if it helps.
08-01-2017 04:37 AM
I am not expert on sdaccel either, but would like to share with my limited experience.
You can do sw_emu, hw_emu and hw in SDAccel. Make sure sw_emu mode works first.
In sw_emu, you can use gdb following the guide below.
Also note that printf is helpful particularly for the kernel code debugging in both sw_emu and hw_emu mode.
Sometimes, sw_emu works but hw_emu may still fail. I see this problem while developing using hls instead of pure opencl.
In this case, I find printf is the only thing that helps.
I haven't seen the scenario that hw_emu works but hw fails.
Check the online document here and search for the debug part.
Here is instructions of using gdb in sdaccel project.(I copied from the website)
You can launch GBD standalone to debug the host program if the host program was built with debug information (built with the -g flag).
gdb --args host.exe test.xclbin
08-01-2017 06:29 PM
Thans for replying, I've tried your advice, but didn't work.
I think something is wrong when data trans to FPGA,I use function "enqueueMigrateMemObjects",trans 100 structures whthin a vector ,each structure is composed of 5 double vars.I printf() one of the vars,named "S" and found that only part of the values are correct,the others are "-nan" or "0.000000"or a large value.
who have solved such a problem, I need help,thx
08-01-2017 07:23 PM
Hi, @luckyxiuxiu
That sounds strange.
You may post your code or a simplified version.
That will be easier to discuss.
Regards,
Cheng Liu
08-01-2017 07:58 PM
Hi,liucheng
CPU initial data (type double),as follows(printf):
S=406.300000
X=330.00000
u=1.004029
e_rt_p=0.498992
e_rt_q=0.501002
I use "q.enqueueMigrateMemObjects(inBufVec,0)"to trans initial data from cpu to FPGA,inBufVec is a vector , wiht 100 structures in it.Each structures if composed of S,X,u,e_rt_p,e_rt_q.
the data in FPGA(printf)
some are :(comes late)
S=406.300000
X=330.00000
u=1.004029
e_rt_p=0.498992
e_rt_q=0.501002
some are (comes early)
S=-nan
X=-nan
u=-nan
e_rt_p=-nan
e_rt_q=-nan
some are (comes in the middle)
S=-nan
X=-nan
u=0.00000
e_rt_p=0.00000
e_rt_q=0.00000
some are :(comes in the middle)
S=0.00000
X=0.00000
u=-nan
e_rt_p=-nan
e_rt_q=-nan
08-01-2017 08:57 PM
I mean the host.cpp code not the debug information.
Anyay, you may also use xcl_memcpy_to_device() instead of the object copy function.
Which should be easier to make it work.
There is also a custom data structure example in the sdaccel github example.
it is located at /kernel_to_gmem/custom_datatype_ocl
Check it and see if it helps.
08-04-2017 01:54 AM
Thx for replying.I have fixed my code as the example tells,but it still does not work .Most of the examples use enqueueMigrateMemObjects. It's too strange why my enqueueMigrateMemObjects does not work.
08-04-2017 09:56 PM
The example helps a lot