aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDag Lem <dag@nimrod.no>2023-02-19 23:25:08 +0100
committerDag Lem <dag@nimrod.no>2023-02-19 23:25:08 +0100
commit79043cb849e01b494e1ab432dc52f5f99d5ff4af (patch)
tree7843419e9c878dc6245fb4cbd210767eca9d6a3a /tests
parentf0116330bce4e787dcbbf81c6e901a44715589a8 (diff)
downloadyosys-79043cb849e01b494e1ab432dc52f5f99d5ff4af.tar.gz
yosys-79043cb849e01b494e1ab432dc52f5f99d5ff4af.tar.bz2
yosys-79043cb849e01b494e1ab432dc52f5f99d5ff4af.zip
Out of bounds checking for struct/union members
Currently, only constant indices are checked.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/gen-tests-makefile.sh2
-rw-r--r--tests/svtypes/struct_array.sv3
2 files changed, 4 insertions, 1 deletions
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