CYNQ  0.3.0
Framework to develop FPGA applications in C++ with the easiness of PYNQ
hardware.hpp
1 /*
2  * See LICENSE for more information about licensing
3  *
4  * Copyright 2024
5  * Author: Luis G. Leon-Vega <luis.leon@ieee.org>
6  */
7 #pragma once
8 
9 #pragma GCC diagnostic push
10 #pragma GCC diagnostic ignored "-Wpedantic"
11 #include <xrt.h>
12 #include <xrt/xrt_device.h>
13 #include <xrt/xrt_uuid.h>
14 #pragma GCC diagnostic pop
15 
16 #include <cynq/accelerator.hpp>
17 #include <cynq/datamover.hpp>
18 #include <cynq/enums.hpp>
19 #include <cynq/hardware.hpp>
20 #include <cynq/status.hpp>
21 #include <memory>
22 #include <string>
23 
24 namespace cynq {
31  xrt::device device_;
33  xrt::xclbin xclbin_;
35  xrt::uuid uuid_;
37  std::string xclbin_file_;
38 
40  virtual ~AlveoParameters() = default;
41 };
42 
50 class Alveo : public IHardware {
51  public:
64  Alveo(const std::string &bitstream_file, const std::string &xclbin_file);
68  Alveo() = delete;
73  virtual ~Alveo();
80  Status Reset() override;
95  std::shared_ptr<IDataMover> GetDataMover(const uint64_t address) override;
108  std::shared_ptr<IAccelerator> GetAccelerator(
109  const std::string &kernelname) override;
110 
122  std::shared_ptr<IAccelerator> GetAccelerator(const uint64_t address) override;
123 
124  private:
126  std::shared_ptr<HardwareParameters> parameters_;
127 
135  Status LoadXclBin(const std::string &xclbin_file, const int device_idx = 0);
136 };
137 } // namespace cynq
Alveo class Provides an interface to access IP Cores in Xilinx FPGAs, the compatible devices are the ...
Definition: hardware.hpp:50
std::shared_ptr< IAccelerator > GetAccelerator(const std::string &kernelname) override
GetAccelerator method.
Definition: hardware.cpp:81
Alveo()=delete
virtual ~Alveo()
Alveo destructor method Destroy the Alveo object.
Definition: hardware.cpp:86
Status Reset() override
Reset method Sets the Alveo instance to its initial state.
Definition: hardware.cpp:64
std::shared_ptr< IDataMover > GetDataMover(const uint64_t address) override
GetDataMover method Used for accessing the IDataMover instance of the Alveo object....
Definition: hardware.cpp:72
Interface for standardising the API of Hardware Devices:
Definition: hardware.hpp:39
Specialisation of the parameters given by the Alveo. It is based on the XRT stack.
Definition: hardware.hpp:29
xrt::xclbin xclbin_
Definition: hardware.hpp:33
virtual ~AlveoParameters()=default
xrt::uuid uuid_
Definition: hardware.hpp:35
xrt::device device_
Definition: hardware.hpp:31
std::string xclbin_file_
Definition: hardware.hpp:37
Define an abstract representation of the hardware parameters with some prefilled fields.
Definition: hardware.hpp:26
Structure to define the return characteristics of each function.
Definition: status.hpp:19