From 79043cb849e01b494e1ab432dc52f5f99d5ff4af Mon Sep 17 00:00:00 2001 From: Dag Lem Date: Sun, 19 Feb 2023 23:25:08 +0100 Subject: Out of bounds checking for struct/union members Currently, only constant indices are checked. --- tests/gen-tests-makefile.sh | 2 +- tests/svtypes/struct_array.sv | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/gen-tests-makefile.sh b/tests/gen-tests-makefile.sh index cde9ab1b9..3df36a963 100755 --- a/tests/gen-tests-makefile.sh +++ b/tests/gen-tests-makefile.sh @@ -75,7 +75,7 @@ generate_tests() { if [[ $do_sv = true ]]; then for x in *.sv; do if [ ! -f "${x%.sv}.ys" ]; then - generate_ys_test "$x" "-p \"prep -top top; sat -verify -prove-asserts\" $yosys_args" + generate_ys_test "$x" "-p \"prep -top top; sat -enable_undef -verify -prove-asserts\" $yosys_args" fi; done fi; diff --git a/tests/svtypes/struct_array.sv b/tests/svtypes/struct_array.sv index a0b84640d..b87f936aa 100644 --- a/tests/svtypes/struct_array.sv +++ b/tests/svtypes/struct_array.sv @@ -18,6 +18,9 @@ module top; end always_comb assert(s==64'h4200_0012_3400_FFFC); + always_comb assert(s.b[23:16]===8'hxx); + always_comb assert(s.b[19:12]===8'hxf); + always_comb assert(s.a[0][3:-4]===8'h0x); struct packed { bit [7:0] [7:0] a; // 8 element packed array of bytes -- cgit v1.2.3