verilator/test_regress/t/t_interface_array_bad.v

55 lines
1.1 KiB
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Demonstrate deferred linking error messages
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2015 Todd Strader
// SPDX-License-Identifier: CC0-1.0
interface foo_intf;
2026-03-08 23:26:40 +01:00
logic a;
endinterface
2026-03-08 23:26:40 +01:00
function integer the_other_func(input integer val);
return val;
endfunction
module t;
2026-03-08 23:26:40 +01:00
localparam N = 4;
2026-03-08 23:26:40 +01:00
foo_intf foos[N-1:0] ();
logic [7 : 0] bar;
2026-03-08 23:26:40 +01:00
// Non-constant dotted select is not allowed
assign foos[bar].a = 1'b1;
2026-03-08 23:26:40 +01:00
baz baz_inst ();
2026-03-08 23:26:40 +01:00
// Unsure how to produce V3Param AstCellRef visitor errors
//assign baz_inst.x = 1'b1;
//assign baz_inst.N = 1'b1;
//assign baz_inst.7 = 1'b1;
//assign baz_inst.qux_t = 1'b1;
//assign baz_inst.the_func = 1'b1;
//assign baz_inst.THE_LP = 1'b1;
2026-03-08 23:26:40 +01:00
//assign bar.x = 1'b1;
//assign fake_inst.x = 1'b1;
//assign the_other_func.x = 1'b1;
2026-03-08 23:26:40 +01:00
initial begin
$write("*-* All Finished *-*\n");
$finish;
end
endmodule
module baz;
2026-03-08 23:26:40 +01:00
typedef integer qux_t;
2026-03-08 23:26:40 +01:00
function integer the_func(input integer val);
return val;
endfunction
2026-03-08 23:26:40 +01:00
localparam THE_LP = 5;
endmodule