Skip to content

Instantly share code, notes, and snippets.

@ciniml
Created March 27, 2017 17:27
Show Gist options
  • Save ciniml/30754c3f45b217ffeb310b6a6be2770c to your computer and use it in GitHub Desktop.
Save ciniml/30754c3f45b217ffeb310b6a6be2770c to your computer and use it in GitHub Desktop.
Vivado HLS AXI master read burst
#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