Skip to content

Commit 95ad91b

Browse files
committed
feat: add rt_prio support to Python binding
1 parent a5f91f5 commit 95ad91b

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

pyudmaio/pyudmaio/binding.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from __future__ import annotations
2-
import numpy
32
import typing
43
__all__ = ['ConfigBase', 'ConfigUio', 'ConfigXdma', 'DEBUG', 'DataHandler', 'DmaBufferAbstract', 'FATAL', 'FpgaMemBufferOverAxi', 'FpgaMemBufferOverXdma', 'FrameFormat', 'HwAccessor', 'INFO', 'LogLevel', 'TRACE', 'UDmaBuf', 'UioAxiDmaIf', 'UioDeviceLocation', 'UioIf', 'UioMemSgdma', 'UioRegion', 'set_logging_level']
54
class ConfigBase:
@@ -35,7 +34,7 @@ class DataHandler:
3534
@staticmethod
3635
def _pybind11_conduit_v1_(*args, **kwargs):
3736
...
38-
def __init__(self, dma: UioAxiDmaIf, desc: UioMemSgdma, mem: DmaBufferAbstract, receive_packets: bool = True, queue_size: int = 64) -> None:
37+
def __init__(self, dma: UioAxiDmaIf, desc: UioMemSgdma, mem: DmaBufferAbstract, receive_packets: bool = True, queue_size: int = 64, rt_prio: bool = False) -> None:
3938
...
4039
def read(self, ms_timeout: int) -> numpy.ndarray[numpy.uint8]:
4140
...

pyudmaio/src/DataHandlerPython.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ DataHandlerPython::DataHandlerPython(std::shared_ptr<UioAxiDmaIf> dma_ptr,
1717
std::shared_ptr<UioMemSgdma> desc_ptr,
1818
std::shared_ptr<DmaBufferAbstract> mem_ptr,
1919
bool receive_packets,
20-
size_t queue_size)
20+
size_t queue_size,
21+
bool rt_prio)
2122
: DataHandlerSync("DataHandlerPython",
2223
*dma_ptr,
2324
*desc_ptr,
2425
*mem_ptr,
2526
receive_packets,
26-
queue_size)
27+
queue_size,
28+
rt_prio)
2729
, _dma_ptr(dma_ptr)
2830
, _desc_ptr(desc_ptr)
2931
, _mem_ptr(mem_ptr) {}

pyudmaio/src/DataHandlerPython.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class DataHandlerPython : public DataHandlerSync {
3131
std::shared_ptr<UioMemSgdma>,
3232
std::shared_ptr<DmaBufferAbstract>,
3333
bool receive_packets = true,
34-
size_t queue_size = 64);
34+
size_t queue_size = 64,
35+
bool rt_prio = false);
3536

3637
void start(int nr_pkts, size_t pkt_size, bool init_only = false);
3738
py::array_t<uint8_t> numpy_read(uint32_t ms_timeout = 0);

pyudmaio/src/PythonBinding.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ PYBIND11_MODULE(binding, m) {
168168
std::shared_ptr<udmaio::UioMemSgdma>,
169169
std::shared_ptr<udmaio::DmaBufferAbstract>,
170170
bool,
171-
size_t>(),
171+
size_t,
172+
bool>(),
172173
py::arg("dma"),
173174
py::arg("desc"),
174175
py::arg("mem"),
175176
py::arg("receive_packets") = bool(true),
176-
py::arg("queue_size") = size_t(64))
177+
py::arg("queue_size") = size_t(64),
178+
py::arg("rt_prio") = bool(false))
177179
.def("start",
178180
&udmaio::DataHandlerPython::start,
179181
py::arg("nr_pkts"),

0 commit comments

Comments
 (0)