From ef1a24d122c6f64f29271e72cbcc987d9a3583dc Mon Sep 17 00:00:00 2001 From: Dag Lem Date: Mon, 1 Jan 2024 22:24:41 +0100 Subject: [PATCH] Added test for multidimensional packed arrays --- tests/simple/arrays03.sv | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/simple/arrays03.sv diff --git a/tests/simple/arrays03.sv b/tests/simple/arrays03.sv new file mode 100644 index 00000000000..f7718c9948e --- /dev/null +++ b/tests/simple/arrays03.sv @@ -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