From c6a7bd6c52cfdb751084d9dcab43dbe6c02a3151 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Fri, 3 Jan 2020 12:02:17 -0800 Subject: python: rfnoc: finishing noc_block_base::get_mtu Adding bindings for res_source_info, which allows us to use noc_block_base::get_mtu. Fixes: 400b00c34338 ("rfnoc: adding RFNoC Python API") --- host/lib/rfnoc/rfnoc_python.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'host/lib') diff --git a/host/lib/rfnoc/rfnoc_python.hpp b/host/lib/rfnoc/rfnoc_python.hpp index d3a5734a3..061fb8a9a 100644 --- a/host/lib/rfnoc/rfnoc_python.hpp +++ b/host/lib/rfnoc/rfnoc_python.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -132,6 +133,31 @@ void export_rfnoc(py::module& m) .def("__str__", &graph_edge_t::to_string) .def("to_string", &graph_edge_t::to_string); + py::enum_(m, "source") + .value("user", res_source_info::USER) + .value("input_edge", res_source_info::INPUT_EDGE) + .value("output_edge", res_source_info::OUTPUT_EDGE) + .value("framework", res_source_info::FRAMEWORK) + .export_values(); + + py::class_(m, "res_source_info") + // Constructors + .def(py::init(), + py::arg("source_type"), + py::arg("instance_") = 0) + + // Properties + .def_readwrite("type", &res_source_info::type) + .def_readwrite("instance", &res_source_info::instance) + + // Methods + .def("__str__", &res_source_info::to_string) + .def("to_string", &res_source_info::to_string) + .def_static("invert_edge", &res_source_info::invert_edge) + + // Operators + .def(py::self == py::self); + py::class_(m, "rfnoc_graph") .def(py::init(&rfnoc_graph::make)) -- cgit v1.2.3