From 5cf2f8d1ea60537f0c2061451b83e8eb2ba3eefa Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Mon, 1 Feb 2021 10:23:21 -0800 Subject: [PATCH] Seperate PipRange types in pybindings_shared. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- common/arch_pybindings_shared.h | 4 ++-- ecp5/arch_pybindings.cc | 3 +++ ice40/arch_pybindings.cc | 4 ++++ nexus/arch.h | 1 - nexus/arch_pybindings.cc | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/common/arch_pybindings_shared.h b/common/arch_pybindings_shared.h index 8bb93a80..88f95020 100644 --- a/common/arch_pybindings_shared.h +++ b/common/arch_pybindings_shared.h @@ -91,9 +91,9 @@ fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "getConflictingPipNet"); -fn_wrapper_1a, +fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "getPipsDownhill"); -fn_wrapper_1a, +fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "getPipsUphill"); fn_wrapper_1a, diff --git a/ecp5/arch_pybindings.cc b/ecp5/arch_pybindings.cc index b8e48ccf..8618bec1 100644 --- a/ecp5/arch_pybindings.cc +++ b/ecp5/arch_pybindings.cc @@ -56,6 +56,9 @@ void arch_wrap_python(py::module &m) readonly_wrapper>::def_wrap(belpin_cls, "bel"); readonly_wrapper>::def_wrap(belpin_cls, "pin"); + typedef const PipRange UphillPipRange; + typedef const PipRange DownhillPipRange; + #include "arch_pybindings_shared.h" WRAP_RANGE(m, Bel, conv_to_str); diff --git a/ice40/arch_pybindings.cc b/ice40/arch_pybindings.cc index 9011d1dc..921956e8 100644 --- a/ice40/arch_pybindings.cc +++ b/ice40/arch_pybindings.cc @@ -72,6 +72,9 @@ void arch_wrap_python(py::module &m) readonly_wrapper>::def_wrap(belpin_cls, "bel"); readonly_wrapper>::def_wrap(belpin_cls, "pin"); + typedef const PipRange UphillPipRange; + typedef const PipRange DownhillPipRange; + #include "arch_pybindings_shared.h" WRAP_RANGE(m, Bel, conv_to_str); @@ -80,6 +83,7 @@ void arch_wrap_python(py::module &m) WRAP_RANGE(m, Pip, conv_to_str); WRAP_RANGE(m, BelPin, wrap_context); + WRAP_MAP_UPTR(m, CellMap, "IdCellMap"); WRAP_MAP_UPTR(m, NetMap, "IdNetMap"); WRAP_MAP(m, HierarchyMap, wrap_context, "HierarchyMap"); diff --git a/nexus/arch.h b/nexus/arch.h index 8952ba6f..56b48bf3 100644 --- a/nexus/arch.h +++ b/nexus/arch.h @@ -999,7 +999,6 @@ struct Arch : BaseCtx BelId getBelByLocation(Loc loc) const { - BelId ret; auto &t = tileStatus.at(loc.y * chip_info->width + loc.x); if (loc.z >= int(t.bels_by_z.size())) return BelId(); diff --git a/nexus/arch_pybindings.cc b/nexus/arch_pybindings.cc index caab8312..1a3890ff 100644 --- a/nexus/arch_pybindings.cc +++ b/nexus/arch_pybindings.cc @@ -51,7 +51,8 @@ void arch_wrap_python(py::module &m) typedef std::unordered_map HierarchyMap; typedef std::unordered_map AliasMap; - typedef UpDownhillPipRange PipRange; + typedef UpDownhillPipRange UphillPipRange; + typedef UpDownhillPipRange DownhillPipRange; typedef WireBelPinRange BelPinRange; #include "arch_pybindings_shared.h"