Skip to content

Commit 4ace42c

Browse files
committed
systemverilog-plugin: add MAKE_INTERNAL_ID macro
Signed-off-by: Kamil Rakoczy <[email protected]>
1 parent 56f957c commit 4ace42c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

systemverilog-plugin/UhdmAst.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ static IdString is_type_parameter;
6969
/*static*/ const IdString &UhdmAst::is_simplified_wire() { return attr_id::is_simplified_wire; }
7070
/*static*/ const IdString &UhdmAst::low_high_bound() { return attr_id::low_high_bound; }
7171

72+
#define MAKE_INTERNAL_ID(X) IdString("$systemverilog_plugin$" #X)
73+
7274
void attr_id_init()
7375
{
7476
// Initialize only once
@@ -80,14 +82,14 @@ void attr_id_init()
8082

8183
// Register IdStrings. Can't be done statically, as the IdString class uses resources created during Yosys initialization which happens after
8284
// static initialization of the plugin when everything is statically linked.
83-
attr_id::partial = IdString("$systemverilog_plugin$partial");
84-
attr_id::packed_ranges = IdString("$systemverilog_plugin$packed_ranges");
85-
attr_id::unpacked_ranges = IdString("$systemverilog_plugin$unpacked_ranges");
86-
attr_id::force_convert = IdString("$systemverilog_plugin$force_convert");
87-
attr_id::is_imported = IdString("$systemverilog_plugin$is_imported");
88-
attr_id::is_simplified_wire = IdString("$systemverilog_plugin$is_simplified_wire");
89-
attr_id::low_high_bound = IdString("$systemverilog_plugin$low_high_bound");
90-
attr_id::is_type_parameter = IdString("$systemverilog_plugin$is_type_parameter");
85+
attr_id::partial = MAKE_INTERNAL_ID(partial);
86+
attr_id::packed_ranges = MAKE_INTERNAL_ID(packed_ranges);
87+
attr_id::unpacked_ranges = MAKE_INTERNAL_ID(unpacked_ranges);
88+
attr_id::force_convert = MAKE_INTERNAL_ID(force_convert);
89+
attr_id::is_imported = MAKE_INTERNAL_ID(is_imported);
90+
attr_id::is_simplified_wire = MAKE_INTERNAL_ID(is_simplified_wire);
91+
attr_id::low_high_bound = MAKE_INTERNAL_ID(low_high_bound);
92+
attr_id::is_type_parameter = MAKE_INTERNAL_ID(is_type_parameter);
9193
}
9294

9395
void attr_id_cleanup()

0 commit comments

Comments
 (0)