aboutsummaryrefslogtreecommitdiffstats
path: root/common/pybindings.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-02-20 10:51:57 +0000
committerGitHub <noreply@github.com>2021-02-20 10:51:57 +0000
commit6672f17d0a546054412c3ecad29a5414ffdcd971 (patch)
treee0976dd397edf50fe89b5108751c5fb3a7ace896 /common/pybindings.cc
parent130c5cc76882c2f07836b97040e6bc1d93e4efe9 (diff)
parente571c707b50a601787590b9752205336ee1c3f6d (diff)
downloadnextpnr-6672f17d0a546054412c3ecad29a5414ffdcd971.tar.gz
nextpnr-6672f17d0a546054412c3ecad29a5414ffdcd971.tar.bz2
nextpnr-6672f17d0a546054412c3ecad29a5414ffdcd971.zip
Merge pull request #592 from YosysHQ/gatecat/rework-delay
Replace DelayInfo with DelayPair and DelayQuad
Diffstat (limited to 'common/pybindings.cc')
-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;