Skip to content

Commit 178c4d7

Browse files
committed
fix: FpgaMemBufferOverAxi
Required for cases where one cannot point u-dma-buf at a physical region, e.g. PL-DDR
1 parent f94b164 commit 178c4d7

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

example/demo_cpp/src/axi_dma_demo.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "DataHandlerPrint.hpp"
1818
#include "UioGpioStatus.hpp"
1919
#include "UioTrafficGen.hpp"
20+
#include "udmaio/FpgaMemBufferOverAxi.hpp"
2021
#include "udmaio/FpgaMemBufferOverXdma.hpp"
2122
#include "udmaio/Logging.hpp"
2223
#include "udmaio/UDmaBuf.hpp"
@@ -119,7 +120,10 @@ int main(int argc, char* argv[]) {
119120

120121
std::unique_ptr<DmaBufferAbstract> udmabuf;
121122
if (mode == DmaMode::UIO) {
122-
udmabuf = std::make_unique<UDmaBuf>();
123+
UioDeviceLocation plddr_test{"plddr-axi-test", {}};
124+
125+
// udmabuf = std::make_unique<UDmaBuf>();
126+
udmabuf = std::make_unique<FpgaMemBufferOverAxi>(plddr_test);
123127
} else {
124128
udmabuf =
125129
std::make_unique<FpgaMemBufferOverXdma>(dev_path, target_hw_consts::fpga_mem_phys_addr);

pyudmaio/pyudmaio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 Deutsches Elektronen-Synchrotron DESY
22

33
from pyudmaio.binding import UioIf, ConfigUio, ConfigXdma, UioDeviceLocation, UioRegion
4-
from pyudmaio.binding import FpgaMemBufferOverXdma, UDmaBuf, UioAxiDmaIf, UioMemSgdma, DataHandler
4+
from pyudmaio.binding import FpgaMemBufferOverXdma, FpgaMemBufferOverAxi, UDmaBuf, UioAxiDmaIf, UioMemSgdma, DataHandler
55
from pyudmaio.binding import LogLevel, set_logging_level
66
from pyudmaio.binding import FrameFormat
77
from pyudmaio._UioReg import UioReg

pyudmaio/src/PythonBinding.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99

1010
// Copyright (c) 2021 Deutsches Elektronen-Synchrotron DESY
1111

12+
#include <cstdint>
13+
1214
#include <pybind11/pybind11.h>
1315
#include <pybind11/stl.h>
1416

1517
#include "DataHandlerPython.hpp"
16-
// #include "udmaio/FpgaMemBufferOverAxi.hpp"
18+
#include "udmaio/FpgaMemBufferOverAxi.hpp"
1719
#include "udmaio/FpgaMemBufferOverXdma.hpp"
1820
#include "udmaio/FrameFormat.hpp"
1921
#include "udmaio/Logging.hpp"
@@ -51,7 +53,7 @@ PYBIND11_MODULE(binding, m) {
5153
py::class_<udmaio::UioDeviceLocation>(m, "UioDeviceLocation")
5254
.def(py::init<std::string, udmaio::UioRegion, std::string>(),
5355
py::arg("uioname"),
54-
py::arg("xdmaregion"),
56+
py::arg("xdmaregion") = udmaio::UioRegion({0, 0}),
5557
py::arg("xdmaevtdev") = std::string(""))
5658
.def_static("set_link_axi", &udmaio::UioDeviceLocation::set_link_axi)
5759
.def_static("set_link_xdma", &udmaio::UioDeviceLocation::set_link_xdma)
@@ -88,13 +90,11 @@ PYBIND11_MODULE(binding, m) {
8890
"DmaBufferAbstract")
8991
.def("get_phys_region", &udmaio::DmaBufferAbstract::get_phys_region);
9092

91-
#if 0 // FIXME
9293
py::class_<udmaio::FpgaMemBufferOverAxi,
9394
udmaio::DmaBufferAbstract,
9495
udmaio::UioIf,
9596
std::shared_ptr<udmaio::FpgaMemBufferOverAxi>>(m, "FpgaMemBufferOverAxi")
9697
.def(py::init<udmaio::UioDeviceLocation>());
97-
#endif
9898

9999
py::class_<udmaio::FpgaMemBufferOverXdma,
100100
udmaio::DmaBufferAbstract,

0 commit comments

Comments
 (0)