Skip to content
forked from papeg/xrt-rs

Rust wrapper for the Xilinx Runtime (XRT)

Notifications You must be signed in to change notification settings

bwintermann/xrt-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xrt-rs

xrt-rs provides a wrapper around the C-API of the Xilinx Runtime (XRT) used for communication between AMD FPGAs / AI Engines and their host. The library offers a thin wrapper (called native), that simply translates the C API into safe Rust, as well as a more abstract layer (called simple), that automatically takes care of the details to provide an easier to use interface for simpler applications. The intermediate goal is to read the xclbin file at compile time to leverage rust type checking for using the API.

Installation

To install simply add this repository or crate as a dependency to your Cargo.toml.

In case linking fails, add the XRT libs to your library path:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/xilinx/xrt/lib"
or
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$XILINX_XRT"

Usage

The native API can be used from xrt::native::*. There is a wrapper for all the relevant objects: Device, Kernel, Run, Buffer. The simpler API can be used from xrt::managed::*. Take a look at the tests to get an example how to use it.

Testing

Currently the tests can not be run in parallel.

If you want to run them in software emulation, you need to set the regular env flag.

XCL_EMULATION_MODE=sw_emu cargo test -- --test-threads=1

TODOs

  • More detailed error reporting
    • parse internal error codes
    • more hierachical structure of custom errors
    • impl Error trait
  • Abstract layer
  • Performance considerations
    • buffer reusage
  • Detailed testing
  • Find a way to use xrt::ip (only accessible from CPP API)

About

Rust wrapper for the Xilinx Runtime (XRT)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.6%
  • Other 0.4%