aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/arch_pybindings.h
diff options
context:
space:
mode:
Diffstat (limited to 'nexus/arch_pybindings.h')
-rw-r--r--nexus/arch_pybindings.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nexus/arch_pybindings.h b/nexus/arch_pybindings.h
index 326af306..7694090b 100644
--- a/nexus/arch_pybindings.h
+++ b/nexus/arch_pybindings.h
@@ -76,6 +76,18 @@ template <> struct string_converter<PipId>
}
};
+template <> struct string_converter<BelBucketId>
+{
+ BelBucketId from_str(Context *ctx, std::string name) { return ctx->getBelBucketByName(ctx->id(name)); }
+
+ std::string to_str(Context *ctx, BelBucketId id)
+ {
+ if (id == BelBucketId())
+ throw bad_wrap();
+ return ctx->getBelBucketName(id).str(ctx);
+ }
+};
+
template <> struct string_converter<BelPin>
{
BelPin from_str(Context *ctx, std::string name)