cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pablo1610
Visitor
Visitor
419 Views
Registered: ‎10-21-2020

AXI DMA diferent transfer sizes send/receive

Hi,

I am wondering how can I sent over the DMA a 9 element (32 bits per element) vector and receive only 1 elements?

I want to receive only 1 elements because I am sending the data from memory over the axi strem interface of the DMA to an accumulator so the result its only one 32 bit number.

I want also to do it by polling mode and a simple DMA, but it gets stuck in the busy DMA while loop

 

Status = XAxiDma_SimpleTransfer(&AxiDma,(UINTPTR) RxPtr,
                                9, XAXIDMA_DEVICE_TO_DMA);
if (Status != XST_SUCCESS) {
	return XST_FAILURE;
}
Status = XAxiDma_SimpleTransfer(&AxiDma,(UINTPTR) TxPtr,
		         	1, XAXIDMA_DMA_TO_DEVICE);

if (Status != XST_SUCCESS) {
	return XST_FAILURE;
}
while ((XAxiDma_Busy(&AxiDma,XAXIDMA_DEVICE_TO_DMA)) ||
        (XAxiDma_Busy(&AxiDma,XAXIDMA_DMA_TO_DEVICE))) {
	/* Wait */
}

 

 

 

0 Kudos
5 Replies
dgisselq
Scholar
Scholar
413 Views
Registered: ‎05-21-2015

@Pablo1610 ,

Hold TLAST high, and you'll only ever transfer a single stream element.

Dan

0 Kudos
Pablo1610
Visitor
Visitor
398 Views
Registered: ‎10-21-2020

@dgisselq

I cannot hold TLAST high because it is the signal to know when the accumulator has all the values to compute the output.

0 Kudos
dgisselq
Scholar
Scholar
391 Views
Registered: ‎05-21-2015

@Pablo1610 ,

This would be on the accumulator's output, not it's input.

Dan

0 Kudos
Pablo1610
Visitor
Visitor
385 Views
Registered: ‎10-21-2020

@dgisselq 

 

Okey, you are rigth, becuase it will say it is always the unique and last element. But I think, it won't fit when I will increase the output to more than one element in order to increase the throughtput.

0 Kudos
dgisselq
Scholar
Scholar
373 Views
Registered: ‎05-21-2015

@Pablo1610 ,

The S2MM controller you are using was designed for handling network packets where the outgoing length is unknown.  Just make sure that the S2MM controller is set for a greater (or equal) length than you need, then set TLAST on the last word of the packet.  The S2MM controller will then stop early.  This is what you want, right?

You'll also want to make certain that the outgoing TVALID isn't set until you get to the value you actually want to send.

Dan

0 Kudos