3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

Out of bounds checking for struct/union members

Currently, only constant indices are checked.
This commit is contained in:
Dag Lem 2023-02-19 23:25:08 +01:00
parent f0116330bc
commit 79043cb849
3 changed files with 22 additions and 6 deletions

View file

@ -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;

View file

@ -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