-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements the SVA followed-by operators.
- Loading branch information
Showing
5 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
...on/verilog/SVA/sequence_followed_by1.desc → regression/verilog/SVA/followed-by1.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "instantiate_word_level.h" | ||
#include "obligations.h" | ||
#include "sequence.h" | ||
|
||
#include <cstdlib> | ||
|
||
|
@@ -109,14 +110,6 @@ Function: bmc_supports_SVA_property | |
|
||
bool bmc_supports_SVA_property(const exprt &expr) | ||
{ | ||
// sva_nonoverlapped_followed_by is not supported yet | ||
if(has_subexpr(expr, ID_sva_nonoverlapped_followed_by)) | ||
return false; | ||
|
||
// sva_overlapped_followed_by is not supported yet | ||
if(has_subexpr(expr, ID_sva_overlapped_followed_by)) | ||
return false; | ||
|
||
return true; | ||
} | ||
|
||
|
@@ -552,6 +545,49 @@ static obligationst property_obligations_rec( | |
auto equal_expr = equal_exprt{sva_iff_expr.lhs(), sva_iff_expr.rhs()}; | ||
return property_obligations_rec(equal_expr, current, no_timeframes); | ||
} | ||
else if( | ||
property_expr.id() == ID_sva_nonoverlapped_followed_by || | ||
property_expr.id() == ID_sva_overlapped_followed_by) | ||
{ | ||
// The LHS is a sequence, the RHS is a property expression, | ||
// the result is a property expression. | ||
auto &followed_by = to_sva_followed_by_expr(property_expr); | ||
|
||
// get match points for LHS sequence | ||
auto match_points = | ||
instantiate_sequence(followed_by.sequence(), current, no_timeframes); | ||
|
||
exprt::operandst disjuncts; | ||
mp_integer t = current; | ||
|
||
for(auto &match_point : match_points) | ||
{ | ||
mp_integer property_start = match_point.first; | ||
|
||
// #=# advances the clock by one from the sequence match point | ||
if(property_expr.id() == ID_sva_nonoverlapped_followed_by) | ||
property_start += 1; | ||
|
||
// at the end? | ||
if(property_start >= no_timeframes) | ||
{ | ||
// relies on NNF | ||
t = std::max(t, no_timeframes - 1); | ||
disjuncts.push_back(match_point.second); | ||
} | ||
else | ||
{ | ||
auto obligations_rec = | ||
property_obligations_rec( | ||
followed_by.property(), property_start, no_timeframes) | ||
.conjunction(); | ||
|
||
disjuncts.push_back(and_exprt{match_point.second, obligations_rec.second}); | ||
t = std::max(t, obligations_rec.first); | ||
} | ||
} | ||
return obligationst{t, disjunction(disjuncts)}; | ||
} | ||
else | ||
{ | ||
return obligationst{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters