Created
March 27, 2017 17:27
-
-
Save ciniml/30754c3f45b217ffeb310b6a6be2770c to your computer and use it in GitHub Desktop.
Vivado HLS AXI master read burst
This file contains 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
#include "simple_dma.hpp" | |
void simpleDma(const InputData* input, hls::stream<OutputStreamData>& outputStream, AddressOffset offset, TransferCount transferCount) | |
{ | |
#pragma HLS INTERFACE s_axilite port=transferCount bundle=control | |
#pragma HLS INTERFACE s_axilite port=offset bundle=control | |
#pragma HLS INTERFACE s_axilite port=return bundle=control | |
#pragma HLS INTERFACE m_axi depth=TestDataCount port=input offset=off | |
#pragma HLS INTERFACE axis port=outputStream | |
for(size_t index = 0; index < transferCount; ++index) { | |
#pragma HLS PIPELINE ii=1 | |
OutputStreamData outputData; | |
outputData.data = input[offset + index]; | |
outputData.user = index == 0 ? 1 : 0; | |
outputData.last = index == transferCount-1 ? 1 : 0; | |
outputStream.write(outputData); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment