From c2299c8972e0cd22641d7d3b8e0bf7c19a42c3cb Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 15 Sep 2019 15:59:16 +0100 Subject: python: Fix getWireBelPins Fixes #327 Signed-off-by: David Shah --- ecp5/arch_pybindings.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ecp5/arch_pybindings.h') 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 } }; +template <> struct string_converter +{ + BelPin from_str(Context *ctx, std::string name) + { + NPNR_ASSERT_FALSE("string_converter::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 -- cgit v1.2.3