diff options
author | gatecat <gatecat@ds0.me> | 2021-08-26 14:57:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 14:57:46 +0100 |
commit | 7f8e467acdb0d3803823802053691e6f73755e20 (patch) | |
tree | a428c170b29e338cfcfa1ef25d65c392ffb40478 | |
parent | 6fc41692d689beda2f142ab039d7fa8d2517bebe (diff) | |
parent | b85fe12234294850bcb69a24cb251d6203bebbb2 (diff) | |
download | nextpnr-7f8e467acdb0d3803823802053691e6f73755e20.tar.gz nextpnr-7f8e467acdb0d3803823802053691e6f73755e20.tar.bz2 nextpnr-7f8e467acdb0d3803823802053691e6f73755e20.zip |
Merge pull request #805 from YosysHQ/gatecat/py-portref-byvalue
python: Wrap PortRef by value
-rw-r--r-- | common/pybindings.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc index 0e087e98..076d315a 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -225,20 +225,20 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m) auto ni_cls = py::class_<ContextualWrapper<NetInfo &>>(m, "NetInfo"); readwrite_wrapper<NetInfo &, decltype(&NetInfo::name), &NetInfo::name, conv_to_str<IdString>, conv_from_str<IdString>>::def_wrap(ni_cls, "name"); - readwrite_wrapper<NetInfo &, decltype(&NetInfo::driver), &NetInfo::driver, wrap_context<PortRef &>, - unwrap_context<PortRef &>>::def_wrap(ni_cls, "driver"); + readonly_wrapper<NetInfo &, decltype(&NetInfo::driver), &NetInfo::driver, wrap_context<PortRef>>::def_wrap( + ni_cls, "driver"); readonly_wrapper<NetInfo &, decltype(&NetInfo::users), &NetInfo::users, wrap_context<PortRefVector &>>::def_wrap( ni_cls, "users"); readonly_wrapper<NetInfo &, decltype(&NetInfo::wires), &NetInfo::wires, wrap_context<WireMap &>>::def_wrap(ni_cls, "wires"); - auto pr_cls = py::class_<ContextualWrapper<PortRef &>>(m, "PortRef"); - readonly_wrapper<PortRef &, decltype(&PortRef::cell), &PortRef::cell, deref_and_wrap<CellInfo>>::def_wrap(pr_cls, - "cell"); - readwrite_wrapper<PortRef &, decltype(&PortRef::port), &PortRef::port, conv_to_str<IdString>, - conv_from_str<IdString>>::def_wrap(pr_cls, "port"); - readwrite_wrapper<PortRef &, decltype(&PortRef::budget), &PortRef::budget, pass_through<delay_t>, - pass_through<delay_t>>::def_wrap(pr_cls, "budget"); + auto pr_cls = py::class_<ContextualWrapper<PortRef>>(m, "PortRef"); + readonly_wrapper<PortRef, decltype(&PortRef::cell), &PortRef::cell, deref_and_wrap<CellInfo>>::def_wrap(pr_cls, + "cell"); + readonly_wrapper<PortRef, decltype(&PortRef::port), &PortRef::port, conv_to_str<IdString>>::def_wrap(pr_cls, + "port"); + readonly_wrapper<PortRef, decltype(&PortRef::budget), &PortRef::budget, pass_through<delay_t>>::def_wrap(pr_cls, + "budget"); auto pm_cls = py::class_<ContextualWrapper<PipMap &>>(m, "PipMap"); readwrite_wrapper<PipMap &, decltype(&PipMap::pip), &PipMap::pip, conv_to_str<PipId>, @@ -285,7 +285,7 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m) WRAP_MAP(m, WireMap, wrap_context<PipMap &>, "WireMap"); WRAP_MAP_UPTR(m, RegionMap, "RegionMap"); - WRAP_VECTOR(m, PortRefVector, wrap_context<PortRef &>); + WRAP_VECTOR(m, PortRefVector, wrap_context<PortRef>); typedef dict<IdString, ClockFmax> ClockFmaxMap; WRAP_MAP(m, ClockFmaxMap, pass_through<ClockFmax>, "ClockFmaxMap"); |