verilator/test_regress/t/t_interface_gen6.v

61 lines
1.1 KiB
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2015 Todd Strader
// SPDX-License-Identifier: CC0-1.0
// bug1001
2026-03-08 23:26:40 +01:00
interface intf #(
parameter PARAM = 0
) ();
logic val;
endinterface
2026-03-03 13:21:24 +01:00
module t;
2026-03-08 23:26:40 +01:00
generate
if (1) begin
intf #(.PARAM(2)) my_intf ();
assign my_intf.val = '1;
end
else begin
intf #(.PARAM(3)) my_intf ();
assign my_intf.val = '0;
end
endgenerate
generate
begin
if (1) begin
2026-03-08 23:26:40 +01:00
intf #(.PARAM(2)) my_intf ();
assign my_intf.val = '1;
end
2026-03-08 23:26:40 +01:00
else begin
intf #(.PARAM(3)) my_intf ();
assign my_intf.val = '0;
end
2026-03-08 23:26:40 +01:00
end
endgenerate
2026-03-08 23:26:40 +01:00
generate
begin
begin
2026-03-08 23:26:40 +01:00
if (1) begin
intf #(.PARAM(2)) my_intf ();
assign my_intf.val = '1;
end
else begin
intf #(.PARAM(3)) my_intf ();
assign my_intf.val = '0;
end
end
2026-03-08 23:26:40 +01:00
end
endgenerate
2026-03-08 23:26:40 +01:00
initial begin
$write("*-* All Finished *-*\n");
$finish;
end
endmodule