aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-02-19 13:41:40 +0000
committergatecat <gatecat@ds0.me>2021-02-19 13:41:40 +0000
commit8ab36b4a0515a39b38744ca0a049bee0c17a8cb3 (patch)
treee5f5655a41b565a502a50994242ca18e9ed7838d /common
parent7922b3bfc4ef93b8f67194c05e1a236b4c83c3da (diff)
downloadnextpnr-8ab36b4a0515a39b38744ca0a049bee0c17a8cb3.tar.gz
nextpnr-8ab36b4a0515a39b38744ca0a049bee0c17a8cb3.tar.bz2
nextpnr-8ab36b4a0515a39b38744ca0a049bee0c17a8cb3.zip
python: Bindings for DelayPair and DelayQuad
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/pybindings.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc
index a72da78e..504074e1 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -139,6 +139,31 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m)
.value("STRENGTH_USER", STRENGTH_USER)
.export_values();
+ py::class_<DelayPair>(m, "DelayPair")
+ .def(py::init<>())
+ .def(py::init<delay_t>())
+ .def(py::init<delay_t, delay_t>())
+ .def_readwrite("min_delay", &DelayPair::min_delay)
+ .def_readwrite("max_delay", &DelayPair::max_delay)
+ .def("minDelay", &DelayPair::minDelay)
+ .def("maxDelay", &DelayPair::maxDelay);
+
+ py::class_<DelayQuad>(m, "DelayQuad")
+ .def(py::init<>())
+ .def(py::init<delay_t>())
+ .def(py::init<delay_t, delay_t>())
+ .def(py::init<delay_t, delay_t, delay_t, delay_t>())
+ .def(py::init<DelayPair, DelayPair>())
+ .def_readwrite("rise", &DelayQuad::rise)
+ .def_readwrite("fall", &DelayQuad::fall)
+ .def("minDelay", &DelayQuad::minDelay)
+ .def("minRiseDelay", &DelayQuad::minRiseDelay)
+ .def("minFallDelay", &DelayQuad::minFallDelay)
+ .def("maxDelay", &DelayQuad::maxDelay)
+ .def("maxRiseDelay", &DelayQuad::maxRiseDelay)
+ .def("maxFallDelay", &DelayQuad::maxFallDelay)
+ .def("delayPair", &DelayQuad::delayPair);
+
typedef std::unordered_map<IdString, Property> AttrMap;
typedef std::unordered_map<IdString, PortInfo> PortMap;
typedef std::unordered_map<IdString, IdString> IdIdMap;