aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch_pybindings.h
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 /ecp5/arch_pybindings.h
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 'ecp5/arch_pybindings.h')
-rw-r--r--ecp5/arch_pybindings.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ecp5/arch_pybindings.h b/ecp5/arch_pybindings.h
index 9bd7bcdf..cf343976 100644
--- a/ecp5/arch_pybindings.h
+++ b/ecp5/arch_pybindings.h
@@ -76,6 +76,21 @@ template <> struct string_converter<PipId>
}
};
+template <> struct string_converter<BelPin>
+{
+ BelPin from_str(Context *ctx, std::string name)
+ {
+ NPNR_ASSERT_FALSE("string_converter<BelPin>::from_str not implemented");
+ }
+
+ std::string to_str(Context *ctx, BelPin pin)
+ {
+ if (pin.bel == BelId())
+ throw bad_wrap();
+ return ctx->getBelName(pin.bel).str(ctx) + "/" + pin.pin.str(ctx);
+ }
+};
+
} // namespace PythonConversion
NEXTPNR_NAMESPACE_END