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: 
Visitor gordienkoa1
Visitor
1,367 Views
Registered: ‎10-25-2017

HLS-internal AXIS Fifo

Jump to solution

Hello! I have a question about the implementation of the FIFO module in Vivado hls I read the document UG902 but could not find the answer there. I need to implement a fifo module with a buffer size of 42,000. I can not figure out how to do this in HLS.

Sync.png

static void FifoBuffer(AXI_STREAM &src, AXI_STREAM &dst)
{

    AXI_STREAM internal_stream;

	#pragma HLS STREAM variable= internal_stream depth= 42000

	  for (int i = 0; i <42000; i ++) {
	#pragma HLS PIPELINE
	        AXI_VALUE in_value = src.read();
	        AXI_VALUE out_value = in_value;
	        internal_stream.write(out_value);
	  }
}


void FifoSplitter(hls::stream<AXI_VALUE> &src, hls::stream<AXI_VALUE> &dst)
{
#pragma HLS INTERFACE axis port=&src
#pragma HLS INTERFACE axis port=&dst
#pragma HLS DATAFLOW
    FifoBuffer(src, dst);
}

This is about how I understand how it should be, but I can not synthesize normally, I ask for help.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Visitor gordienkoa1
Visitor
1,720 Views
Registered: ‎10-25-2017

Re: HLS-internal AXIS Fifo

Jump to solution

I found a solution! I used a full and empty variable of type axi stream. This solution synthesizes a fifo that does not block the exchange while it is not full:

static void FifoBuffer(AXI_STREAM &src, AXI_STREAM &dst)
{
	static AXI_STREAM_DATA temp;
	AXI_VALUE tmp,tmp2;
	#pragma HLS STREAM variable=temp depth=42000 dim=1
	#pragma HLS data_pack variable=temp
	while (!temp.full())
	   {
	#pragma HLS PIPELINE
		  tmp.data = src.read().data;
		  temp << tmp.data;
	   }
	while (!temp.empty())
	   {
	#pragma HLS PIPELINE
		  tmp2.data = temp.read();
		  dst << tmp2;
	   }
}

 

0 Kudos
1 Reply
Visitor gordienkoa1
Visitor
1,721 Views
Registered: ‎10-25-2017

Re: HLS-internal AXIS Fifo

Jump to solution

I found a solution! I used a full and empty variable of type axi stream. This solution synthesizes a fifo that does not block the exchange while it is not full:

static void FifoBuffer(AXI_STREAM &src, AXI_STREAM &dst)
{
	static AXI_STREAM_DATA temp;
	AXI_VALUE tmp,tmp2;
	#pragma HLS STREAM variable=temp depth=42000 dim=1
	#pragma HLS data_pack variable=temp
	while (!temp.full())
	   {
	#pragma HLS PIPELINE
		  tmp.data = src.read().data;
		  temp << tmp.data;
	   }
	while (!temp.empty())
	   {
	#pragma HLS PIPELINE
		  tmp2.data = temp.read();
		  dst << tmp2;
	   }
}

 

0 Kudos