From a3081fc664683eea8077e699e92a6b33b948af02 Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Tue, 3 Mar 2026 14:15:28 +0100 Subject: [PATCH] Add case with struct not requiring change Signed-off-by: Ryszard Rozak --- test_regress/t/t_force_unpacked_struct.v | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test_regress/t/t_force_unpacked_struct.v b/test_regress/t/t_force_unpacked_struct.v index 5aa2b28be..8c1aae3da 100644 --- a/test_regress/t/t_force_unpacked_struct.v +++ b/test_regress/t/t_force_unpacked_struct.v @@ -16,10 +16,16 @@ module t ( integer cyc = 0; + typedef struct packed { + bit a; + bit b; + } packed_t; + typedef struct { int x; logic y; int arr[5]; + packed_t pt; } struct_t; struct_t s_array[3]; @@ -32,16 +38,19 @@ module t ( s_array[1].x = 1; s_array[1].arr[2] = 1; my_struct.x <= 1; + my_struct.pt.b <= 1; end else if (cyc == 1) begin `checkh(s_array[1].x, 1); `checkh(s_array[1].arr[2], 1); `checkh(my_struct.x, 1); + `checkh(my_struct.pt.b, 1); end else if (cyc == 2) begin force s_array[1].x = 0; force s_array[1].arr[2] = 2; force my_struct.x = 0; + force my_struct.pt.b = 0; end else if (cyc == 3) begin `checkh(s_array[1].x, 0); @@ -50,16 +59,20 @@ module t ( s_array[1].arr[2] = 3; `checkh(my_struct.x, 0); my_struct.x <= 1; + `checkh(my_struct.pt.b, 0); + my_struct.pt.b <= 1; end else if (cyc == 4) begin `checkh(s_array[1].x, 0); `checkh(s_array[1].arr[2], 2); `checkh(my_struct.x, 0); + `checkh(my_struct.pt.b, 0); end else if (cyc == 5) begin release s_array[1].x; release s_array[1].arr[2]; release my_struct.x; + release my_struct.pt.b; end else if (cyc == 6) begin `checkh(s_array[1].x, 0); @@ -68,11 +81,14 @@ module t ( s_array[1].arr[2] = 4; `checkh(my_struct.x, 0); my_struct.x <= 1; + `checkh(my_struct.pt.b, 0); + my_struct.pt.b <= 1; end else if (cyc == 7) begin `checkh(s_array[1].x, 1); `checkh(s_array[1].arr[2], 4); `checkh(my_struct.x, 1); + `checkh(my_struct.pt.b, 1); end else if (cyc == 8) begin $write("*-* All Finished *-*\n");