diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2019-11-18 14:06:39 +0530 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2020-01-02 15:38:56 -0800 |
commit | 400b00c34338af502c5d786edcfb8512bfbbff8b (patch) | |
tree | 9974e0ea352e1879f6381091103fab84637b441c /host/python | |
parent | 2b8cae59a70d1f19a9350aa9c824008ceea5cb70 (diff) | |
download | uhd-400b00c34338af502c5d786edcfb8512bfbbff8b.tar.gz uhd-400b00c34338af502c5d786edcfb8512bfbbff8b.tar.bz2 uhd-400b00c34338af502c5d786edcfb8512bfbbff8b.zip |
rfnoc: adding RFNoC Python API
Adding Python bindings for the RFNoC API. This includes the
rfnoc_graph, noc_block_base, and several other supporting classes.
Templated functions are not currently supported. For example,
`rfnoc_graph::get_block` can only return the basic block controller.
Diffstat (limited to 'host/python')
-rw-r--r-- | host/python/CMakeLists.txt | 1 | ||||
-rw-r--r-- | host/python/__init__.py | 1 | ||||
-rw-r--r-- | host/python/pyuhd.cpp | 6 | ||||
-rw-r--r-- | host/python/rfnoc.py | 18 |
4 files changed, 26 insertions, 0 deletions
diff --git a/host/python/CMakeLists.txt b/host/python/CMakeLists.txt index 5598dda24..2b2a35d2e 100644 --- a/host/python/CMakeLists.txt +++ b/host/python/CMakeLists.txt @@ -52,6 +52,7 @@ set(PYUHD_FILES ${CMAKE_CURRENT_SOURCE_DIR}/types.py ${CMAKE_CURRENT_SOURCE_DIR}/usrp.py ${CMAKE_CURRENT_SOURCE_DIR}/filters.py + ${CMAKE_CURRENT_SOURCE_DIR}/rfnoc.py ) set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") diff --git a/host/python/__init__.py b/host/python/__init__.py index 501b599ef..bf37f5215 100644 --- a/host/python/__init__.py +++ b/host/python/__init__.py @@ -10,3 +10,4 @@ UHD Python API module from . import types from . import usrp from . import filters +from . import rfnoc diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp index e38dc9224..50434b4fc 100644 --- a/host/python/pyuhd.cpp +++ b/host/python/pyuhd.cpp @@ -13,6 +13,8 @@ namespace py = pybind11; +#include "rfnoc/rfnoc_python.hpp" + #include "stream_python.hpp" #include "types/types_python.hpp" @@ -72,5 +74,9 @@ PYBIND11_MODULE(libpyuhd, m) // Register filters submodule auto filters_module = m.def_submodule("filters", "Filter Submodule"); export_filters(filters_module); + + // Register RFNoC submodule + auto rfnoc_module = m.def_submodule("rfnoc", "RFNoC Objects"); + export_rfnoc(rfnoc_module); } diff --git a/host/python/rfnoc.py b/host/python/rfnoc.py new file mode 100644 index 000000000..690b3d841 --- /dev/null +++ b/host/python/rfnoc.py @@ -0,0 +1,18 @@ +# +# Copyright 2019 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +""" @package rfnoc +Python UHD module containing the RFNoC API. +""" + +from . import libpyuhd as lib + +BlockID = lib.rfnoc.block_id +Edge = lib.rfnoc.edge +GraphEdge = lib.rfnoc.graph_edge +RfnocGraph = lib.rfnoc.rfnoc_graph +MBController = lib.rfnoc.mb_controller +Timekeeper = lib.rfnoc.timekeeper +NocBlock = lib.rfnoc.noc_block_base |