Last active
June 29, 2020 17:26
-
-
Save Neelam96/d7f8c1714411a3ecbe24ad3e7235f70a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define H 3 | |
float sum_arr(float* A) | |
{ | |
//interfaces | |
#pragma HLS INTERFACE m_axi depth=9 port=A offset=slave | |
#pragma HLS INTERFACE s_axilite port=return | |
int i,j; | |
static float Ain[H*H]; | |
//copying values from memory | |
for(i=0; i<H; i++) | |
{ | |
#pragma HLS pipeline | |
for(j=0; j<H; j++) | |
{ | |
#pragma HLS unroll | |
Ain[i+(H*j)]=*(A+H*i+j); | |
} | |
} | |
float sum=0; | |
//computing sum | |
for(i=0; i<H; i++) | |
{ | |
for(j=0; j<H; j++) | |
{ | |
#pragma HLS pipeline | |
sum = sum+ Ain[i+(H*j)]; | |
} | |
} | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment