-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for multidimensional packed arrays
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |