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: 
Newbie johsk
Newbie
533 Views
Registered: ‎11-03-2017

low axi stream throughput

Hi.

I am trying to parallelize an axi stream for further processing but is not able to reach reasonable speed when Reading from an axi stream interface.

I have tried a number of different approaches but is never able to read more than 1/2 Word per clock cycle.

The best working code so far looks like this:

 

#include "ap_int.h"

#define BUF_LEN 10

void axis_to_mem(ap_uint<9> din,volatile unsigned char *dout) {
static int dcnt=0;
static unsigned char buf[BUF_LEN];
#pragma HLS DATAFLOW
#pragma HLS interface ap_ctrl_hs port=return
#pragma HLS INTERFACE axis port=din
#pragma HLS INTERFACE m_axi port=dout

buf[dcnt++]=din;
if(dcnt==BUF_LEN)
 {
  *dout=buf[5];
  dcnt=0;
 }
}

 

This code is able to read 10 Words in about 20 Clock cycles followed by a pause when the result is stored. Is there anything I can do to read 10 words in 10 clock cycles? Is it possible read more data when the previous result is stored? I am using vivado 2017.2.

0 Kudos
1 Reply
Scholar u4223374
Scholar
493 Views
Registered: ‎04-26-2015

Re: low axi stream throughput

I suspect it'll work much better if you wrap "din" into a hls::stream type, and then use a loop to read data (rather than calling the function hundreds of times).

 

The ideal structure would be an outer loop that runs some large number of times (eg. until it finds TLAST in the input stream), and then inside that a function to read data (reads BUF_LEN elements and then returns) and a second function to write data (writes data from the previous read). HLS will be able to run the two functions in parallel easily, and pipeline them both to run at II=1 (plus minor overhead).

0 Kudos