verilator/test_regress/t/t_mem_packed_assign.v
Wilson Snyder 8127a79cb1 Fix nested packed arrays and structs, bug600.
IMPORTANT: Packed arrays are now represented as a single linear vector in
Verilated models this may affect packed arrays that are public or accessed via the VPI.
2013-01-14 21:49:22 -05:00

39 lines
827 B
Verilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2009 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
/* verilator lint_off WIDTH */
input clk;
integer cyc; initial cyc = 0;
logic [31:0] arr_c; initial arr_c = 0;
logic [7:0] [3:0] arr;
logic [31:0] arr2_c; initial arr2_c = 0;
logic [7:0] [3:0] arr2;
assign arr2_c = arr2;
always @ (posedge clk) begin
cyc <= cyc + 1;
arr_c <= arr_c + 1;
arr2 <= arr2 + 1;
`ifdef TEST_VERBOSE
$write("cyc%0d c:%0x a0:%0x a1:%0x a2:%0x a3:%0x\n", cyc, arr_c, arr[0], arr[1], arr[2], arr[3]);
`endif
if (cyc==99) begin
$write("*-* All Finished *-*\n");
$finish;
end
end
/* verilator lint_on WIDTH */
endmodule