aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch_pybindings.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-09-15 15:59:16 +0100
committerDavid Shah <dave@ds0.me>2019-09-15 15:59:16 +0100
commitc2299c8972e0cd22641d7d3b8e0bf7c19a42c3cb (patch)
tree4fb5170364c9f2eb4dfe547c7e66b90c6e60653b /ice40/arch_pybindings.cc
parentbc6b47efe097b5086fd6aaf4fb8be51d97435719 (diff)
downloadnextpnr-c2299c8972e0cd22641d7d3b8e0bf7c19a42c3cb.tar.gz
nextpnr-c2299c8972e0cd22641d7d3b8e0bf7c19a42c3cb.tar.bz2
nextpnr-c2299c8972e0cd22641d7d3b8e0bf7c19a42c3cb.zip
python: Fix getWireBelPins
Fixes #327 Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ice40/arch_pybindings.cc')
-rw-r--r--ice40/arch_pybindings.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/ice40/arch_pybindings.cc b/ice40/arch_pybindings.cc
index 194d7c6d..a9aaeb83 100644
--- a/ice40/arch_pybindings.cc
+++ b/ice40/arch_pybindings.cc
@@ -157,10 +157,15 @@ void arch_wrap_python()
fn_wrapper_2a_v<Context, decltype(&Context::constrainCellToRegion), &Context::constrainCellToRegion,
conv_from_str<IdString>, conv_from_str<IdString>>::def_wrap(ctx_cls, "constrainCellToRegion");
+ auto belpin_cls = class_<ContextualWrapper<BelPin>>("BelPin", no_init);
+ readonly_wrapper<BelPin, decltype(&BelPin::bel), &BelPin::bel, conv_to_str<BelId>>::def_wrap(belpin_cls, "bel");
+ readonly_wrapper<BelPin, decltype(&BelPin::pin), &BelPin::pin, conv_to_str<IdString>>::def_wrap(belpin_cls, "pin");
+
WRAP_RANGE(Bel, conv_to_str<BelId>);
WRAP_RANGE(Wire, conv_to_str<WireId>);
WRAP_RANGE(AllPip, conv_to_str<PipId>);
WRAP_RANGE(Pip, conv_to_str<PipId>);
+ WRAP_RANGE(BelPin, wrap_context<BelPin>);
WRAP_MAP_UPTR(CellMap, "IdCellMap");
WRAP_MAP_UPTR(NetMap, "IdNetMap");