Add regression tests for attribute names matching type identifiers

Check that a standard attribute name can match a visible typedef. Also check
that the global `$attribute` extension can target a primitive whose name is
visible as a type identifier.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2026-07-09 22:31:52 -07:00
parent ee14022127
commit 36a79568b7
5 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,12 @@
// Check that attribute names can match visible type identifiers.
typedef int ATTR;
(* ATTR = 1 *)
module test;
initial begin
$display("PASSED");
end
endmodule

View File

@ -0,0 +1,23 @@
// Check that $attribute targets can match visible type identifiers.
primitive ATTR_TYPE (out, in);
output out;
input in;
table
0 : 0;
1 : 1;
endtable
endprimitive
typedef int ATTR_TYPE;
$attribute(ATTR_TYPE, "test", "true")
module test;
initial begin
$display("PASSED");
end
endmodule

View File

@ -392,6 +392,8 @@ sv_soft_packed_union vvp_tests/sv_soft_packed_union.json
sv_soft_packed_union_fail1 vvp_tests/sv_soft_packed_union_fail1.json sv_soft_packed_union_fail1 vvp_tests/sv_soft_packed_union_fail1.json
sv_super_member_fail vvp_tests/sv_super_member_fail.json sv_super_member_fail vvp_tests/sv_super_member_fail.json
sv_type_identifier_ams_name_fields vvp_tests/sv_type_identifier_ams_name_fields.json sv_type_identifier_ams_name_fields vvp_tests/sv_type_identifier_ams_name_fields.json
sv_type_identifier_attribute_name vvp_tests/sv_type_identifier_attribute_name.json
sv_type_identifier_attribute_target vvp_tests/sv_type_identifier_attribute_target.json
sv_type_identifier_block_label_name vvp_tests/sv_type_identifier_block_label_name.json sv_type_identifier_block_label_name vvp_tests/sv_type_identifier_block_label_name.json
sv_type_identifier_config_name vvp_tests/sv_type_identifier_config_name.json sv_type_identifier_config_name vvp_tests/sv_type_identifier_config_name.json
sv_type_identifier_enum_item_name vvp_tests/sv_type_identifier_enum_item_name.json sv_type_identifier_enum_item_name vvp_tests/sv_type_identifier_enum_item_name.json

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "sv_type_identifier_attribute_name.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "sv_type_identifier_attribute_target.v",
"iverilog-args" : [ "-g2005-sv" ]
}