Add regression tests for UDP names shadowing type identifiers

Check that UDP primitive and port names can shadow visible type identifiers.
Cover old-style UDP declarations, including input and output declarations and
the initial target, as well as ANSI-style UDP port declarations.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2026-07-04 12:17:25 -07:00
parent 56c42dcf37
commit 2b67d9f754
5 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Check that ANSI-style UDP names can shadow visible type identifiers.
package p;
typedef int ANSI_UDP;
typedef int Y;
typedef int I0;
typedef int I1;
endpackage
import p::*;
primitive ANSI_UDP (output Y, input I0, input I1);
table
00 : 0;
01 : 0;
10 : 0;
11 : 1;
endtable
endprimitive
module test;
initial begin
$display("PASSED");
end
endmodule

View File

@ -0,0 +1,29 @@
// Check that old-style UDP names can shadow visible type identifiers.
package p;
typedef int OLD_UDP;
typedef int Q;
typedef int A;
typedef int B;
endpackage
import p::*;
primitive OLD_UDP (Q, A, B);
output reg Q;
input A, B;
initial Q = 0;
table
00 : ? : 0;
01 : ? : 0;
10 : ? : 0;
11 : ? : 1;
endtable
endprimitive
module test;
initial begin
$display("PASSED");
end
endmodule

View File

@ -403,6 +403,8 @@ sv_type_identifier_port_name vvp_tests/sv_type_identifier_port_name.json
sv_type_identifier_specparam_name vvp_tests/sv_type_identifier_specparam_name.json sv_type_identifier_specparam_name vvp_tests/sv_type_identifier_specparam_name.json
sv_type_identifier_task_function_argument_name vvp_tests/sv_type_identifier_task_function_argument_name.json sv_type_identifier_task_function_argument_name vvp_tests/sv_type_identifier_task_function_argument_name.json
sv_type_identifier_task_name vvp_tests/sv_type_identifier_task_name.json sv_type_identifier_task_name vvp_tests/sv_type_identifier_task_name.json
sv_type_identifier_udp_ansi_name vvp_tests/sv_type_identifier_udp_ansi_name.json
sv_type_identifier_udp_name vvp_tests/sv_type_identifier_udp_name.json
sv_type_identifier_variable_name vvp_tests/sv_type_identifier_variable_name.json sv_type_identifier_variable_name vvp_tests/sv_type_identifier_variable_name.json
sv_type_param_restrict_class1 vvp_tests/sv_type_param_restrict_class1.json sv_type_param_restrict_class1 vvp_tests/sv_type_param_restrict_class1.json
sv_type_param_restrict_class2 vvp_tests/sv_type_param_restrict_class2.json sv_type_param_restrict_class2 vvp_tests/sv_type_param_restrict_class2.json

View File

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

View File

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