diff options
-rw-r--r-- | host/include/uhd/rfnoc/null_block_control.hpp | 8 | ||||
-rw-r--r-- | host/lib/rfnoc/null_block_control.cpp | 10 | ||||
-rw-r--r-- | host/lib/rfnoc/null_block_control_python.hpp | 13 |
3 files changed, 31 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/null_block_control.hpp b/host/include/uhd/rfnoc/null_block_control.hpp index 1e426b312..f78cb72f7 100644 --- a/host/include/uhd/rfnoc/null_block_control.hpp +++ b/host/include/uhd/rfnoc/null_block_control.hpp @@ -58,6 +58,14 @@ public: */ virtual void set_throttle_cycles(const uint32_t cycs) = 0; + /*! Get item width (ITEM_W) + */ + virtual uint32_t get_item_width() = 0; + + /*! Get number of items per clock (NIPC) + */ + virtual uint32_t get_nipc() = 0; + /*! Get lines per packet (including the header!) */ virtual uint32_t get_lines_per_packet() = 0; diff --git a/host/lib/rfnoc/null_block_control.cpp b/host/lib/rfnoc/null_block_control.cpp index 4b2560ca5..ba8ec8da4 100644 --- a/host/lib/rfnoc/null_block_control.cpp +++ b/host/lib/rfnoc/null_block_control.cpp @@ -109,6 +109,16 @@ public: regs().poke32(REG_SRC_THROTTLE_CYC, cycs); } + uint32_t get_item_width() + { + return _item_width; + } + + uint32_t get_nipc() + { + return _nipc; + } + uint32_t get_lines_per_packet() { return regs().peek32(REG_SRC_LINES_PER_PKT) + 2; diff --git a/host/lib/rfnoc/null_block_control_python.hpp b/host/lib/rfnoc/null_block_control_python.hpp index 732206e02..77cc34c16 100644 --- a/host/lib/rfnoc/null_block_control_python.hpp +++ b/host/lib/rfnoc/null_block_control_python.hpp @@ -13,6 +13,17 @@ using namespace uhd::rfnoc; void export_null_block_control(py::module& m) { + py::enum_<null_block_control::port_type_t>(m, "port_type_t") + .value("SINK", null_block_control::port_type_t::SINK) + .value("SOURCE", null_block_control::port_type_t::SOURCE) + .value("LOOP", null_block_control::port_type_t::LOOP) + .export_values(); + + py::enum_<null_block_control::count_type_t>(m, "count_type_t") + .value("LINES", null_block_control::count_type_t::LINES) + .value("PACKETS", null_block_control::count_type_t::PACKETS) + .export_values(); + py::class_<null_block_control, noc_block_base, null_block_control::sptr>( m, "null_block_control") .def(py::init(&block_controller_factory<null_block_control>::make_from)) @@ -20,6 +31,8 @@ void export_null_block_control(py::module& m) .def("reset_counters", &null_block_control::reset_counters) .def("set_bytes_per_packet", &null_block_control::set_bytes_per_packet) .def("set_throttle_cycles", &null_block_control::set_throttle_cycles) + .def("get_item_width", &null_block_control::get_item_width) + .def("get_nipc", &null_block_control::get_nipc) .def("get_lines_per_packet", &null_block_control::get_lines_per_packet) .def("get_bytes_per_packet", &null_block_control::get_bytes_per_packet) .def("get_throttle_cycles", &null_block_control::get_throttle_cycles) |