Skip to content

Commit

Permalink
write_btor: only initialize array with const value when it is fully def
Browse files Browse the repository at this point in the history
* If all addresses of an array have the same initial value, they can be
  initialized in one go in btor with the constraint that the initial
  value must be fully const and thus can't have undef bits in
  • Loading branch information
georgerennie committed Oct 9, 2024
1 parent e91894c commit 11477ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backends/btor/btor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,10 @@ struct BtorWorker
}
}

if (constword)
// If not fully defined, undef bits should be able to take a
// different value for each address so we can't initialise from
// one value (and btor2parser doesn't like it)
if (constword && firstword.is_fully_def())
{
if (verbose)
btorf("; initval = %s\n", log_signal(firstword));
Expand Down

0 comments on commit 11477ef

Please sign in to comment.