ChimeraTK-DeviceAccess  03.18.00
DmaIntf.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 #pragma once
4 
5 #include "DeviceFile.h"
6 #include "XdmaIntfAbstract.h"
7 
8 #include <string>
9 
10 namespace ChimeraTK {
11 
12  // DMA interface to access FPGA memory
13  class DmaIntf : public XdmaIntfAbstract {
14  DeviceFile _c2h;
15  DeviceFile _h2c;
16 
17  public:
18  DmaIntf() = delete;
19  DmaIntf(const std::string& devicePath, size_t channelIdx);
20  DmaIntf(DmaIntf&& d) = default; // Need move ctor for storage in std::vector
21  virtual ~DmaIntf();
22 
23  void read(uintptr_t address, int32_t* __restrict__ buf, size_t nbytes) override;
24  void write(uintptr_t address, const int32_t* data, size_t nbytes) override;
25  };
26 
27 } // namespace ChimeraTK
ChimeraTK::DmaIntf::~DmaIntf
virtual ~DmaIntf()
Definition: DmaIntf.cc:17
DeviceFile.h
ChimeraTK::DmaIntf::read
void read(uintptr_t address, int32_t *__restrict__ buf, size_t nbytes) override
Definition: DmaIntf.cc:19
ChimeraTK::DeviceFile
Definition: DeviceFile.h:12
ChimeraTK::XdmaIntfAbstract
Definition: XdmaIntfAbstract.h:10
ChimeraTK::DmaIntf::write
void write(uintptr_t address, const int32_t *data, size_t nbytes) override
Definition: DmaIntf.cc:27
ChimeraTK::DmaIntf
Definition: DmaIntf.h:13
XdmaIntfAbstract.h
ChimeraTK::DmaIntf::DmaIntf
DmaIntf()=delete
ChimeraTK
Definition: DummyBackend.h:16