Skip to content

Commit

Permalink
Added test for multidimensional packed arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
daglem committed Jan 1, 2024
1 parent 0609b48 commit ef1a24d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/simple/arrays03.sv
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ef1a24d

Please sign in to comment.