Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎09-18-2013

ZC702 Targeted Reference Design: Cosimulation error

Hello everybody,


As I try to understand the TRD for my Evaluation Kit, I tried to run the Cosimulation in Vivado HLS for the sobel function. The Test Bench is provided with the project, so I tried to simply "Run C/HDL Cosimulation".


At first, I got an error because the sobel_filter function in sobel.c does not have the same prototype than in sobel.h. I assume you did changes without running the cosimultion again. Thus I edited sobel.h, and changed the sobel_filter function header to put default values for XR0C0, ...YR2C2, c_high_thesh, c_low_thresh, c_invert. I took these parameters in xsobel.c.

So my new function header is:

void sobel_filter(
    int rows,
    int cols,
    int C_XR0C0 = 0x1       ,
    int C_XR0C1 = 0x0       ,
    int C_XR0C2 = 0xFFFFFFFF,
    int C_XR1C0 = 0x2       ,
    int C_XR1C1 = 0x0       ,
    int C_XR1C2 = 0xFFFFFFFE,
    int C_XR2C0 = 0x1       ,
    int C_XR2C1 = 0x0       ,
    int C_XR2C2 = 0xFFFFFFFF,
    int C_YR0C0 = 0x1       ,
    int C_YR0C1 = 0x2       ,
    int C_YR0C2 = 0x1       ,
    int C_YR1C0 = 0x0       ,
    int C_YR1C1 = 0x0       ,
    int C_YR1C2 = 0x0       ,
    int C_YR2C0 = 0xFFFFFFFF,
    int C_YR2C1 = 0xFFFFFFFE,
    int C_YR2C2 = 0xFFFFFFFF,
    int c_high_thesh = 200,
    int c_low_thresh = 100,
    int c_invert = 0


Now, it runs! But the cosimulation finally failed, because the output result_1080p.bmp is not the same as result_1080p_golden.bmp. As you can see with attached file, it is true :-)
I have the feeling - but I may be wrong - that result_1080p_golden.bmp is outdated, and was not outputted by the current sobel_filter function with the default parameters from xsobel.c


Could you confirm me that the reference picture is outdated? If so, could you provide an up-to-date picture to have a correct cosimulation?


Thank you very much,


Simon D.

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
Registered: ‎03-24-2010

The sobel_filter funtion in head file and testbench is inconsistent with the function body in sobel.cpp. Before it's been modified, the example from XAPP890 can be used instead.

Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos