From 2a4a9aedfe76e902f6d0755b990edee86f9210aa Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Mon, 8 Sep 2025 11:34:53 +0200 Subject: [PATCH] Ensure the ID macro consistently uses YOSYS_NAMESPACE_PREFIX The previous version of the ID macro used this for everything in the Yosys namespace, so the new version should continue to do so. --- kernel/rtlil.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 80d0d0cfb..999b60fd7 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -544,10 +544,14 @@ template <> struct IDMacroHelper<-1> { } }; -#define ID(_id) IDMacroHelper::eval([]() -> const RTLIL::IdString & { \ - const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \ - static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id(q); \ - return id; \ +#define ID(_id) \ + YOSYS_NAMESPACE_PREFIX IDMacroHelper< \ + YOSYS_NAMESPACE_PREFIX lookup_well_known_id(#_id) \ + >::eval([]() \ + -> const YOSYS_NAMESPACE_PREFIX RTLIL::IdString & { \ + const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \ + static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id(q); \ + return id; \ }) namespace RTLIL {