Community
cancel
Showing results for 
Search instead for 
Did you mean: 
kiiii
Beginner
147 Views

Intel HLS 18.1 C++/RTL result does not match

Hi,

I am having this simple C++ program that is triggering different C++ and RTL simulation result. I called build.bat test-x86-64 to generate the C++ executable, and build.bat test-fpga to generate the RTL executable. The C++ result is B, whereas the RTL simulation result is 0. I am not really sure what is causing the difference here. Any idea would be helpful! Thanks!

 

 

#include <stdint.h>
#include <stdio.h>


static volatile int32_t a[6][1][7] = {{{0L,1,2,3,4,0L,1}},{{1,(-3L),(-1L),1,1L,6L,(-3L)}},{{1,0L,0L,1,0L,0L,2}},
{{0L,(-3L),1,0L,1,0L,0L}},{{8,1,6L,(-3L),(-3L),6L,1}},{{(-3L),1,1,1,1,0L,1}}};

/* ---------------------------------------- */
component unsigned int result() 
{
    int i, j, k;
    a[5][0][0] = 1;
    a[5][0][0] = a[5][0][0];
    a[5][0][0] = 1;
    a[5][0][0] = a[5][0][0];
    
	unsigned int tmp = 1;
    for (i = 0; i < 6; i++)
    {
        for (j = 0; j < 1; j++)
        {
            for (k = 0; k < 7; k++)
            {
	            tmp ^=a[i][j][k];
            }
        }
    }
	return tmp;
}

int main(void) 
{
	unsigned int resultOut = result();
	printf("%X\n", resultOut);
	return 0;
}

 

 

0 Kudos
1 Reply
100 Views

Hi ,

Please try with latest version 20.2 of HLS. We have tested the code which you have provided and the results are consistent. We are getting B on both scenarios.

Thanks and Regards

Anil


Reply