Skip to content

Instantly share code, notes, and snippets.

@salehjg
Created June 25, 2020 13:28
Show Gist options
  • Save salehjg/9e61c07c567e056528d20d038cf2a505 to your computer and use it in GitHub Desktop.
Save salehjg/9e61c07c567e056528d20d038cf2a505 to your computer and use it in GitHub Desktop.
void myfunc(
int *inputTn1,
int *inputTn2,
int *outputTn,
int len) {
#pragma HLS INLINE
for(int idx=0; idx<len; idx++){
#pragma HLS PIPELINE II=1
outputTn[idx] = inputTn1[idx] + inputTn2[idx];
}
}
extern "C" {
void topfunc(
int *inputTn1,
int *inputTn2,
int *outputTn,
int len) {
#pragma HLS INTERFACE m_axi port=inputTn1 offset=slave bundle=gmem1 max_read_burst_length=256 max_write_burst_length=256
#pragma HLS INTERFACE s_axilite port=inputTn1 bundle=control
#pragma HLS INTERFACE m_axi port=inputTn2 offset=slave bundle=gmem2 max_read_burst_length=256
#pragma HLS INTERFACE s_axilite port=inputTn2 bundle=control
#pragma HLS INTERFACE m_axi port=outputTn offset=slave bundle=gmem1
#pragma HLS INTERFACE s_axilite port=outputTn bundle=control
#pragma HLS INTERFACE s_axilite port=len bundle=control
#pragma HLS INTERFACE s_axilite port=return bundle=control
myfunc(inputTn1, inputTn2, outputTn, len);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment