cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
simozz
Scholar
Scholar
238 Views
Registered: ‎05-14-2017

AXI DMA SG IRQ Threshold

I have the following SG map:

[0] address = 0x70000000
[0][NXTDESC] = 0x70000040
[0][NXTDESC_MSB] = 0x00000000
[0][BUFFER_ADDRESS] = 0x74000000
[0][BUFFER_ADDRESS_MSB] = 0x00000000
[0][CONTROL] = 0x03FFFFFF

[1] address = 0x70000040
[1][NXTDESC] = 0x70000080
[1][NXTDESC_MSB] = 0x00000000
[1][BUFFER_ADDRESS] = 0x74800000
[1][BUFFER_ADDRESS_MSB] = 0x00000000
[1][CONTROL] = 0x03FFFFFF

[2] address = 0x70000080
[2][NXTDESC] = 0x700000C0
[2][NXTDESC_MSB] = 0x00000000
[2][BUFFER_ADDRESS] = 0x75000000
[2][BUFFER_ADDRESS_MSB] = 0x00000000
[2][CONTROL] = 0x03FFFFFF

[3] address = 0x700000C0
[3][NXTDESC] = 0x70000100
[3][NXTDESC_MSB] = 0x00000000
[3][BUFFER_ADDRESS] = 0x75800000
[3][BUFFER_ADDRESS_MSB] = 0x00000000
[3][CONTROL] = 0x03FFFFFF

[4] address = 0x70000100
[4][NXTDESC] = 0x70000140
[4][NXTDESC_MSB] = 0x00000000
[4][BUFFER_ADDRESS] = 0x76000000
[4][BUFFER_ADDRESS_MSB] = 0x00000000
[4][CONTROL] = 0x03FFFFFF

[5] address = 0x70000140
[5][NXTDESC] = 0x70000180
[5][NXTDESC_MSB] = 0x00000000
[5][BUFFER_ADDRESS] = 0x76800000
[5][BUFFER_ADDRESS_MSB] = 0x00000000
[5][CONTROL] = 0x03FFFFFF

[6] address = 0x70000180
[6][NXTDESC] = 0x700001C0
[6][NXTDESC_MSB] = 0x00000000
[6][BUFFER_ADDRESS] = 0x77000000
[6][BUFFER_ADDRESS_MSB] = 0x00000000
[6][CONTROL] = 0x03FFFFFF

[7] address = 0x700001C0
[7][NXTDESC] = 0x70000200
[7][NXTDESC_MSB] = 0x00000000
[7][BUFFER_ADDRESS] = 0x77800000
[7][BUFFER_ADDRESS_MSB] = 0x00000000
[7][CONTROL] = 0x03FFFFFF

----

[8] address = 0x70000200
[8][NXTDESC] = 0x70000240
[8][NXTDESC_MSB] = 0x00000000
[8][BUFFER_ADDRESS] = 0x78000000
[8][BUFFER_ADDRESS_MSB] = 0x00000000
[8][CONTROL] = 0x03FFFFFF

[9] address = 0x70000240
[9][NXTDESC] = 0x70000280
[9][NXTDESC_MSB] = 0x00000000
[9][BUFFER_ADDRESS] = 0x78800000
[9][BUFFER_ADDRESS_MSB] = 0x00000000
[9][CONTROL] = 0x03FFFFFF

[10] address = 0x70000280
[10][NXTDESC] = 0x700002C0
[10][NXTDESC_MSB] = 0x00000000
[10][BUFFER_ADDRESS] = 0x79000000
[10][BUFFER_ADDRESS_MSB] = 0x00000000
[10][CONTROL] = 0x03FFFFFF

[11] address = 0x700002C0
[11][NXTDESC] = 0x70000300
[11][NXTDESC_MSB] = 0x00000000
[11][BUFFER_ADDRESS] = 0x79800000
[11][BUFFER_ADDRESS_MSB] = 0x00000000
[11][CONTROL] = 0x03FFFFFF

[12] address = 0x70000300
[12][NXTDESC] = 0x70000340
[12][NXTDESC_MSB] = 0x00000000
[12][BUFFER_ADDRESS] = 0x7A000000
[12][BUFFER_ADDRESS_MSB] = 0x00000000
[12][CONTROL] = 0x03FFFFFF

[13] address = 0x70000340
[13][NXTDESC] = 0x70000380
[13][NXTDESC_MSB] = 0x00000000
[13][BUFFER_ADDRESS] = 0x7A800000
[13][BUFFER_ADDRESS_MSB] = 0x00000000
[13][CONTROL] = 0x03FFFFFF

[14] address = 0x70000380
[14][NXTDESC] = 0x700003C0
[14][NXTDESC_MSB] = 0x00000000
[14][BUFFER_ADDRESS] = 0x7B000000
[14][BUFFER_ADDRESS_MSB] = 0x00000000
[14][CONTROL] = 0x03FFFFFF

[15] address = 0x700003C0
[15][NXTDESC] = 0x70000400
[15][NXTDESC_MSB] = 0x00000000
[15][BUFFER_ADDRESS] = 0x7B800000
[15][BUFFER_ADDRESS_MSB] = 0x00000000
[15][CONTROL] = 0x03FFFFFF

---

[16] address = 0x70000400
[16][NXTDESC] = 0x70000440
[16][NXTDESC_MSB] = 0x00000000
[16][BUFFER_ADDRESS] = 0x7C000000
[16][BUFFER_ADDRESS_MSB] = 0x00000000
[16][CONTROL] = 0x03FFFFFF

[17] address = 0x70000440
[17][NXTDESC] = 0x70000480
[17][NXTDESC_MSB] = 0x00000000
[17][BUFFER_ADDRESS] = 0x7C800000
[17][BUFFER_ADDRESS_MSB] = 0x00000000
[17][CONTROL] = 0x03FFFFFF

[18] address = 0x70000480
[18][NXTDESC] = 0x700004C0
[18][NXTDESC_MSB] = 0x00000000
[18][BUFFER_ADDRESS] = 0x7D000000
[18][BUFFER_ADDRESS_MSB] = 0x00000000
[18][CONTROL] = 0x03FFFFFF

[19] address = 0x700004C0
[19][NXTDESC] = 0x70000500
[19][NXTDESC_MSB] = 0x00000000
[19][BUFFER_ADDRESS] = 0x7D800000
[19][BUFFER_ADDRESS_MSB] = 0x00000000
[19][CONTROL] = 0x03FFFFFF

[20] address = 0x70000500
[20][NXTDESC] = 0x70000540
[20][NXTDESC_MSB] = 0x00000000
[20][BUFFER_ADDRESS] = 0x7E000000
[20][BUFFER_ADDRESS_MSB] = 0x00000000
[20][CONTROL] = 0x03FFFFFF

[21] address = 0x70000540
[21][NXTDESC] = 0x70000580
[21][NXTDESC_MSB] = 0x00000000
[21][BUFFER_ADDRESS] = 0x7E800000
[21][BUFFER_ADDRESS_MSB] = 0x00000000
[21][CONTROL] = 0x03FFFFFF

[22] address = 0x70000580
[22][NXTDESC] = 0x700005C0
[22][NXTDESC_MSB] = 0x00000000
[22][BUFFER_ADDRESS] = 0x7F000000
[22][BUFFER_ADDRESS_MSB] = 0x00000000
[22][CONTROL] = 0x03FFFFFF

[23] address = 0x700005C0
[23][NXTDESC] = 0x70000000
[23][NXTDESC_MSB] = 0x00000000
[23][BUFFER_ADDRESS] = 0x7F800000
[23][BUFFER_ADDRESS_MSB] = 0x00000000
[23][CONTROL] = 0x03FFFFFF

 

With the IOC interrupt, I should cyclic detect IRQ each 8 buffers, so

0x70000000,

0x70000200

0x70000400.

To do so, when first I set the current descriptor  and tail descriptor, I have to set the IRQThreshold to 7, and then to 8 each time I detect the IOC interrupt.

Otherwise the buffer loop is not aligned as mentioned before.

Could someone explain this ?

Thanks.

s.

Tags (3)
0 Kudos
2 Replies
abommera
Xilinx Employee
Xilinx Employee
191 Views
Registered: ‎10-12-2018

Hi @simozz,

Yes, you can set interrupt threshold 7. The internal counter counts down from the threshold setting when an IOC event occurs. The interrupt out is generated by DMA engine once the count reaches zero.

Could you please elaborate a little more on issue here?

Thanks & Regards
Anil B
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
simozz
Scholar
Scholar
171 Views
Registered: ‎05-14-2017

Hello @abommera ,

I know I can set the threshold to 7, but my doubt is about why I have to set the threshold to 7 for initial transfer, and then to 8 each time I detect the IOC IRQ Threshold. So the pseudo-code is the following:

1 - Set AXI DMA SG current descriptor.

2 - Start AXI DMA SG.

3 - Enable Cyclic BD and set IOC Threshold.

4 - Set AXI DMA tail descriptor.

5 - Wait for IOC IRQ.

6 - Clear IOC IRQ status bit and reprogram IOC Threshold.

7 - Jump to step #5.

In order to read SG BD in a cyclic aligned way (#0 {address 0x70000000}, #8 {address 0x70000200}, #16 {address 0x70000400} and so on), I have to set IOC Threshold to 7 at step #3, and then to 8 at step #6, otherwise the SG BD current descriptor reading is not aligned as mentioned.

So why I have to set the IOC Threshold to 7 at first and than to 8, and not leaving it to a fixed value for aligned SG BD reading ?

Thanks.

s.

0 Kudos