Added test for multidimensional packed arrays

This commit is contained in:
Dag Lem 2024-01-01 22:24:41 +01:00 committed by Zachary Snow
parent 03f35c3def
commit a4ae773150
1 changed files with 49 additions and 0 deletions

49
tests/simple/arrays03.sv Normal file
View File

@ -0,0 +1,49 @@
// Test multidimensional packed arrays
typedef logic [0:3][7:0] reg2dim_t;
typedef logic [7:0] reg8_t;
typedef reg8_t [0:3] reg2dim1_t;
module pcktest1 (
input logic clk,
input logic [0:3][7:0] in,
input logic [1:0] ix,
output reg8_t out
);
always_ff @(posedge clk) begin
out <= in[ix];
end
endmodule
module pcktest2 (
input logic clk,
input reg8_t [0:3] in,
input logic [1:0] ix,
output reg8_t out
);
always_ff @(posedge clk) begin
out <= in[ix];
end
endmodule
module pcktest3 (
input logic clk,
input reg2dim_t in,
input logic [1:0] ix,
output reg8_t out
);
always_ff @(posedge clk) begin
out <= in[ix];
end
endmodule
module pcktest4 (
input logic clk,
input reg2dim1_t in,
input logic [1:0] ix,
output reg8_t out
);
always_ff @(posedge clk) begin
out <= in[ix];
end
endmodule