diff options
Diffstat (limited to 'ice40/arch_pybindings.h')
-rw-r--r-- | ice40/arch_pybindings.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ice40/arch_pybindings.h b/ice40/arch_pybindings.h index eaf3ac97..7c15b269 100644 --- a/ice40/arch_pybindings.h +++ b/ice40/arch_pybindings.h @@ -77,6 +77,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 |