From 86699b42f619960bfefd4d0b479dd44a90527ea4 Mon Sep 17 00:00:00 2001 From: gatecat Date: Sat, 26 Feb 2022 15:17:46 +0000 Subject: Switch to potentially-sparse net users array This uses a new data structure for net.users that allows gaps, so removing a port from a net is no longer an O(n) operation on the number of users the net has. Signed-off-by: gatecat --- common/pybindings.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/pybindings.cc') diff --git a/common/pybindings.cc b/common/pybindings.cc index eef460ce..9a783eb4 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -220,7 +220,7 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m) readwrite_wrapper, pass_through>::def_wrap(pi_cls, "type"); - typedef std::vector PortRefVector; + typedef indexed_store PortRefVector; typedef dict WireMap; typedef pool BelSet; typedef pool WireSet; @@ -288,7 +288,7 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m) WRAP_MAP(m, WireMap, wrap_context, "WireMap"); WRAP_MAP_UPTR(m, RegionMap, "RegionMap"); - WRAP_VECTOR(m, PortRefVector, wrap_context); + WRAP_INDEXSTORE(m, PortRefVector, wrap_context); typedef dict ClockFmaxMap; WRAP_MAP(m, ClockFmaxMap, pass_through, "ClockFmaxMap"); -- cgit v1.2.3