Giter Club home page Giter Club logo

xilinx-dma's Introduction

Xilinx AXI DMA Userspace Driver

This crates uses udmabuf and a generic userspace I/O driver (uio_pdrv_genirq) to interface Xilinx AXI DMA controllers. Please see this blog post and the example directory for further information.

Crates.io Apache 2.0 licensed

Overview

The project is very much work-in-progress. At the moment, it only supports register mode transfers (i.e., no scatter gather). The crate supports sync and async operation.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the project, shall be licensed as Apache 2.0, without any additional terms or conditions.

xilinx-dma's People

Contributors

bastibl avatar daniestevez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

xilinx-dma's Issues

DMB barrier for H2D transfers

Hi,

My understanding about how the ARM memory model works (but I'm far from an expert on this topic) regarding host to device DMA transfers is the following. The AXI4-Lite control interface of the AXI-DMA is device memory, so writes to its registers are not reordered by hardware. However, the buffer we write in DDR sits in normal memory. Writes to normal memory can be reordered among themselves and also with respect to writes to device memory, if I remember correctly. This means that when we write data to the buffer to perform an H2D transfer and then we write to the AXI-DMA registers to set up and start this transfer, there is no guarantee that the writes to DDR have been observed by the hardware by the time that the writes to the AXI-DMA registers are observed. In theory, this means that the AXI-DMA could potentially start reading data from DDR that hasn't been written yet.

In other applications I've done that controlled the AXI-DMA from userspace, I used a dmb instruction before writing to the registers of the AXI-DMA to configure an H2D transfer, in order to ensure that all the writes to the DDR buffer have been observed before proceeding with the set up of the AXI-DMA. I don't know if there is an easy to way to do this with stable Rust. I googled a bit and all the solutions I saw required nightly.

In practice this is not very important, because not including the barrier is unlikely to give problems. Typically the ARM is much faster in writing to DDR than the AXI-DMA is reading it, so it won't happen that the AXI-DMA will manage to fetch the data before the writes done by the ARM have been observed by the DDR, specially when the buffers that are transferred are not very small.

This crate is certainly working well for me without a barrier, but it might be good to keep these ideas for the future.

By the way I don't know what is the technically correct solution for D2H transfers regarding barriers. I've never done anything special in my applications in this case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.