verilator/test_regress/t/t_bitsel_struct.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

33 lines
680 B
Verilog

// DESCRIPTION: Verilator: Verilog Test module
//
// A test case for struct signal bit selection.
//
// This test is to check that bit selection of multi-dimensional signal inside
// of a struct works.
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2012 by Jie Xu.
module t(/*AUTOARG*/
// Inputs
clk
);
input clk;
typedef struct packed {
logic [1:0][15:0] channel;
logic others;
} buss_t;
buss_t b;
reg [7:0] a;
initial begin
b = {16'h8765,16'h4321,1'b1};
a = b.channel[0][8+:8];
if (a != 8'h43) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule