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 zasxcd
Observer
1,499 Views
Registered: ‎05-28-2017

Issues with BRAM Interface

I have written a code to copy 1-D array (X) from BRAM1 and store it in (res)BRAM2. But I'm not getting the expected results as my res[100] array gives all zeros. I feel the core is not able to read from BRAM1. What might be the reason for this? 

HLS Code:

void core(float x[100],float res[100])
{
#pragma HLS INTERFACE s_axilite port=return bundle=CRTL_BUS
#pragma HLS INTERFACE bram port=x
#pragma HLS INTERFACE bram port=res
for (int idx = 0; idx < 100; idx++)
{
res[idx] =x[idx] ;
}

}

In SDK, I have defined pointers to both the memory locations:

float *XHW= (float *)0x40000000;
float *resHW=(float *)0x40010000;

PS is giving input to XHW and it is also able to access resHW: 

for(i=0;i<100;i++)
{
XHW[i]=i;
resHW[i]=i; //this is just to check if resHW is being accessed
}

int k;
print("Input Before...");
for(k=0;k<100;k++)
{
printf("SW=%f\t,HW=%f\t,resHW=%f\n",XSW[k],XHW[k],resHW[k]);
}

Core(XSW,resSW);
XCore_Start(&doCore);
while(!XCore_IsDone(&doCore));
print("Output");
for(k=0;k<100;k++)
{
printf("SW=%f\t,HW=%f\n",resSW[k],resHW[k]);
}

Before the core runs, the values are in image1.

After the core runs, the values are in image2. 

 

I am not able to figure out why is this happening?

I forced a constant value into resHW into the core and it was working fine. This means core is able to write to the resHW properly.

Why is it not reading the input properly? What is that I missed? Kindly Help.

Thanks in Advance. 

 

 

Before.PNG
After.PNG
0 Kudos