Giter Site home page Giter Site logo

ecaslab / cynq Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 2.0 3.12 MB

PYNQ bindings for C and C++ to avoid requiring Python or Vitis to execute hardware acceleration.

Home Page: https://ecaslab.github.io/cynq/

License: GNU Lesser General Public License v2.1

C++ 96.26% Meson 3.74%
alveo amd artix7 fpga linux pynq runtime xilinx cynq

cynq's People

Contributors

dierpg avatar lleon95 avatar lleoncr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lcrypto mfkiwl

cynq's Issues

Thread safety

We require a thread safety mechanism when dealing with accesses to an instance from different threads.

How to Compile A Program ?

Hi,
I'm trying to compile a program using your interface by running the GCC compiler on it and I keep getting this list of errors that i'm not really sure how to solve. What instructions and options do I need to configure with my compiler in order to get software properly with this frame work ?

test_cynq.cpp:(.text+0x28): undefined reference to `std::allocator<char>::allocator()'
/usr/bin/ld: test_cynq.cpp:(.text+0x5c): undefined reference to `cynq::IHardware::Create(cynq::HardwareArchitecture, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: test_cynq.cpp:(.text+0x64): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/usr/bin/ld: test_cynq.cpp:(.text+0x6c): undefined reference to `std::allocator<char>::~allocator()'
/usr/bin/ld: test_cynq.cpp:(.text+0x110): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/usr/bin/ld: test_cynq.cpp:(.text+0x120): undefined reference to `std::allocator<char>::~allocator()'
/usr/bin/ld: /tmp/cc3ZiyKX.o: in function `__static_initialization_and_destruction_0(int, int)':
test_cynq.cpp:(.text+0x198): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: test_cynq.cpp:(.text+0x1ac): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: test_cynq.cpp:(.text+0x1b0): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /tmp/cc3ZiyKX.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::~_Alloc_hider()':
test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderD2Ev[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderD5Ev]+0x10): undefined reference to `std::allocator<char>::~allocator()'
/usr/bin/ld: /tmp/cc3ZiyKX.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> >(char const*, std::allocator<char> const&)':
test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_]+0x34): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_local_data()'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_]+0x44): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&)'
/usr/bin/ld: /tmp/cc3ZiyKX.o: in function `void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag)':
test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x70): undefined reference to `std::__throw_logic_error(char const*)'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0xa0): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0xac): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data(char*)'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0xbc): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned long)'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0xc4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0xd0): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char const*, char const*)'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0xe0): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x108): undefined reference to `__cxa_begin_catch'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x110): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x114): undefined reference to `__cxa_rethrow'
/usr/bin/ld: test_cynq.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x11c): undefined reference to `__cxa_end_catch'
/usr/bin/ld: /tmp/cc3ZiyKX.o:(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status

Queue support

Using queues allows the creation of execution graphs. This support requires implementation

CYNQ clocking issues

Given that CYNQ does not parse the .hwh file, it is not possible to know addresses, aliases and clocks. There are two possibilities:

  1. (Short term): add the option to configure clocks
  2. (Long term): support .hwh parsing

Support for XSA files

CYNQ can receive the bitstream only and work with it. However, it implies some drawbacks:

  1. The addresses and offsets cannot be guessed: user is required to find them in Vivado and Vitis HLS
  2. The clocks cannot be guessed: user is required to set a frequency for the design

To workaround this, we can use the .xsa file, which contains the .bit and the .hwh file. The former contains:

  • IP names
  • Addresses and offsets
  • Clocks

Rename XRT Accelerator and XRT Data Mover to be MMIO and DMA respectively

This implies:

  • Renaming the XRTAccelerator to be MMIOAccelerator
  • Renaming the XRTDataMover to be DMADataMover
  • Use the proper enumerators
  • Return not implemented in case of trying another one.
  • Handle everything at the HW Level
  • Detect if the bitstream is provided or not in UltraScale hardware class

Memory synchronisation in XRT

There is no way in Ubuntu 22.04 to synchronise memory in a ordered fashion. The idea is to create a mechanism based on std::async when using eager mode.

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.