Forum Discussion

Derek_Teng's avatar
Derek_Teng
Icon for New Contributor rankNew Contributor
5 months ago
Solved

Two questions regarding the Avalon-MM DMA IP core

Hi, I have two questions regarding the Avalon-MM DMA IP core: 1. The document 《Arria ® 10 or Cyclone ® 10 GX Avalon ® Memory-Mapped (Avalon-MM) DMA Interface for PCI Express* Solutions User Guide》 states that the DMA supports out-of-order completion. This means that if I have 128 descriptors, the 128th descriptor might be completed before the 1st descriptor. May I ask if I can turn off this out-of-order completion feature? Can I make it complete each descriptor in order? 2. Regarding the RXM0 interface in this IP core, the document mentions that “The receive path from the RXM_BAR0 connects internally. It is not shown in the connections panel.” When writing the driver program, I need to know the addressing range of BAR0. However, I can't find relevant information in the documentation, nor can I obtain its addressing range in the qsys project. May I ask what the addressing range of BAR0 in this IP core is?

  • Hi,


    This means that if I have 128 descriptors, the 128th descriptor might be completed before the 1st descriptor. May I ask if I can turn off this out-of-order completion feature?

    --Your understanding is correct. This feature is for bandwidth efficiency. I'm afraid you can't turn it off since this feature is not transparent to the application layer. Two things you probably can do if you want completion in-order:

    1. Read request not over 4KB. This doesn't guarantee especially when packet through multiple switches.

    2. Not send next request until last completion is received.

    Another way is to use Avalon-MM with your own DMA. Thus you have full control of the packet flow.



    May I ask what the addressing range of BAR0 in this IP core is?

    --You can find the BAR address and size In lspci info like below.

    Region 0: Memory at 6020000000 (64-bit, prefetchable) [size=512]

    Region 2: Memory at 6000000000 (64-bit, prefetchable) [size=512M]



    Regards,

    Rong



3 Replies

  • Hi,


    This means that if I have 128 descriptors, the 128th descriptor might be completed before the 1st descriptor. May I ask if I can turn off this out-of-order completion feature?

    --Your understanding is correct. This feature is for bandwidth efficiency. I'm afraid you can't turn it off since this feature is not transparent to the application layer. Two things you probably can do if you want completion in-order:

    1. Read request not over 4KB. This doesn't guarantee especially when packet through multiple switches.

    2. Not send next request until last completion is received.

    Another way is to use Avalon-MM with your own DMA. Thus you have full control of the packet flow.



    May I ask what the addressing range of BAR0 in this IP core is?

    --You can find the BAR address and size In lspci info like below.

    Region 0: Memory at 6020000000 (64-bit, prefetchable) [size=512]

    Region 2: Memory at 6000000000 (64-bit, prefetchable) [size=512M]



    Regards,

    Rong



    • Derek_Teng's avatar
      Derek_Teng
      Icon for New Contributor rankNew Contributor

      Thank you very much for your reply.

      I think I've found a way to deal with out-of-order completion. Since the data I need to read is input sequentially, when the DMA controller executes descriptors out-of-order, it's very likely that when the 127th descriptor is executed, the data read actually belongs to the 1st descriptor.
      So I have to place two RAMs. After one RAM is filled with a certain amount of data, say 16KB, the computer initiates a DMA transfer. Even if the dma_wr_master reads this RAM out-of-order, there's no need to worry that the data the computer gets is in a mess.
      The two RAMs perform ping-pong operations, enabling rapid data provision during multiple DMA transfers.

      By the way, will the BAR0 of this IP core occupy 512 bytes of space?

  • Thanks for sharing your two RAMs testing. I think this is a good one.


    You're right. The BAR0 is 512 Bytes.


    Regards,

    Rong