diff options
author | gatecat <gatecat@ds0.me> | 2022-02-04 20:48:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 20:48:41 +0000 |
commit | 4b72f02255df435f4ed1c5eaaab03434aa8168fe (patch) | |
tree | 09853ccc550aa0d641b8f19de5a7824631674de6 /generic/arch_pybindings.h | |
parent | 69625564ca2659ca0fbbd3d85e75b70182febf6f (diff) | |
parent | 5ef5c33e9e964a176040c829adc965ec46331d77 (diff) | |
download | nextpnr-4b72f02255df435f4ed1c5eaaab03434aa8168fe.tar.gz nextpnr-4b72f02255df435f4ed1c5eaaab03434aa8168fe.tar.bz2 nextpnr-4b72f02255df435f4ed1c5eaaab03434aa8168fe.zip |
Merge pull request #907 from YosysHQ/gatecat/generic-pips-py-fix
generic: Add missing Pip vector binding
Diffstat (limited to 'generic/arch_pybindings.h')
-rw-r--r-- | generic/arch_pybindings.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/arch_pybindings.h b/generic/arch_pybindings.h index 72d688dc..f0daccbc 100644 --- a/generic/arch_pybindings.h +++ b/generic/arch_pybindings.h @@ -76,6 +76,18 @@ template <> struct string_converter<PipId> } }; +template <> struct string_converter<const PipId &> +{ + PipId from_str(Context *ctx, std::string name) { return ctx->getPipByNameStr(name); } + + std::string to_str(Context *ctx, const PipId &id) + { + if (id == PipId()) + throw bad_wrap(); + return ctx->getPipName(id).str(ctx); + } +}; + template <> struct string_converter<BelPin> { BelPin from_str(Context *ctx, std::string name) |