Add regression test for an interface name matching a typedef

Check that a forward interface name used in a port declaration can have the
same spelling as a visible `typedef`. Access a member through the port to make
sure it is interpreted as an interface rather than a named data type.

Signed-off-by: Lars-Peter Clausen <[email protected]>
This commit is contained in:
Lars-Peter Clausen
2026-09-07 17:51:41 -07:00
parent 984e7579c9
commit a079347a89
3 changed files with 47 additions and 0 deletions
@@ -0,0 +1,37 @@
// Check that a forward interface name can match a visible typedef at a port.
package p;
typedef int IFACE;
endpackage
import p::*;
module dut(IFACE i_iface, output logic result);
assign result = i_iface.value;
endmodule
interface IFACE;
logic value;
endinterface
module test;
IFACE i_iface();
logic result;
dut i_dut(i_iface, result);
initial begin
i_iface.value = 1'b1;
#1;
if (result === 1'b1) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule
+1
View File
@@ -565,6 +565,7 @@ sv_type_identifier_implicit_gate_fail vvp_tests/sv_type_identifier_implicit_gate
sv_type_identifier_implicit_port_fail vvp_tests/sv_type_identifier_implicit_port_fail.json
sv_type_identifier_inherited_property_shadow vvp_tests/sv_type_identifier_inherited_property_shadow.json
sv_type_identifier_interface_forward_instance vvp_tests/sv_type_identifier_interface_forward_instance.json
sv_type_identifier_interface_forward_port vvp_tests/sv_type_identifier_interface_forward_port.json
sv_type_identifier_modport_name vvp_tests/sv_type_identifier_modport_name.json
sv_type_identifier_modport_named_port vvp_tests/sv_type_identifier_modport_named_port.json
sv_type_identifier_module_forward_instance vvp_tests/sv_type_identifier_module_forward_instance.json
@@ -0,0 +1,9 @@
{
"type" : "normal",
"source" : "sv_type_identifier_interface_forward_port.v",
"iverilog-args" : [ "-g2005-sv" ],
"vlog95" : {
"__comment" : "Interfaces are not supported",
"type" : "TE"
}
}