Skip to content

ebmc: avoid parentheses in SVA output for unary operators #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regression/ebmc/neural-liveness/counter1.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter1.sv
--number-of-traces 2 --neural-liveness --neural-engine "echo Candidate: counter\\\\n"
^\[main\.property\.p0\] always \(eventually main.counter == 0\): PROVED$
^\[main\.property\.p0\] always eventually main.counter == 0: PROVED$
^EXIT=0$
^SIGNAL=0$
--
2 changes: 1 addition & 1 deletion regression/ebmc/ranking-function/counter1.fail.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter1.sv
--ranking-function "(-counter)"
^\[main\.property\.p0\] always \(eventually main.counter == 0\): INCONCLUSIVE$
^\[main\.property\.p0\] always eventually main.counter == 0: INCONCLUSIVE$
^EXIT=10$
^SIGNAL=0$
--
2 changes: 1 addition & 1 deletion regression/ebmc/ranking-function/counter1.pass.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter1.sv
--ranking-function counter
^\[main\.property\.p0\] always \(eventually main.counter == 0\): PROVED$
^\[main\.property\.p0\] always eventually main.counter == 0: PROVED$
^EXIT=0$
^SIGNAL=0$
--
2 changes: 1 addition & 1 deletion regression/ebmc/ranking-function/counter2.fail.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter2.sv
--ranking-function counter
^\[main\.property\.p0\] always \(eventually main.counter == 10\): INCONCLUSIVE$
^\[main\.property\.p0\] always eventually main.counter == 10: INCONCLUSIVE$
^EXIT=10$
^SIGNAL=0$
--
2 changes: 1 addition & 1 deletion regression/ebmc/ranking-function/counter2.pass.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter2.sv
--ranking-function 10-counter
^\[main\.property\.p0\] always \(eventually main.counter == 10\): PROVED$
^\[main\.property\.p0\] always eventually main.counter == 10: PROVED$
^EXIT=0$
^SIGNAL=0$
--
2 changes: 1 addition & 1 deletion regression/ebmc/ranking-function/counter_in_module1.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter_in_module1.sv
--ranking-function instance.counter
^\[main\.property\.p0\] always \(eventually main.instance.counter == 0\): PROVED$
^\[main\.property\.p0\] always eventually main.instance.counter == 0: PROVED$
^EXIT=0$
^SIGNAL=0$
--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter_with_reset1.sv
--property main.property.p0 --ranking-function 10-counter
^\[main\.property\.p0\] always \(eventually main.counter == 10\): INCONCLUSIVE$
^\[main\.property\.p0\] always eventually main.counter == 10: INCONCLUSIVE$
^EXIT=10$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
counter_with_reset1.sv
--property main.property.p1 --ranking-function 10-counter
^\[main\.property\.p1\] always \(eventually main.reset \|\| main.counter == 10\): PROVED$
^\[main\.property\.p1\] always eventually main.reset \|\| main.counter == 10: PROVED$
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE
lexicographic_ranking_function1.sv
--ranking-function "{digit1, digit2}"
^\[main\.property\.p0\] always \(eventually main\.digit1 == 0\): PROVED$
^\[main\.property\.p0\] always eventually main\.digit1 == 0: PROVED$
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ eventually3.sv
--module main --bound 11
^EXIT=10$
^SIGNAL=0$
^\[main\.property\.p0\] always \(eventually main\.counter <= 5\): REFUTED$
^\[main\.property\.p0\] always eventually main\.counter <= 5: REFUTED$
--
^warning: ignoring
5 changes: 3 additions & 2 deletions src/verilog/expr2verilog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,10 @@ std::string expr2verilogt::convert_sva(
{
if(src.operands().size()==1)
{
auto &op = to_unary_expr(src).op();
unsigned p;
auto s = convert(to_unary_expr(src).op(), p);
if(p == 0)
auto s = convert(op, p);
if(p == 0 && op.operands().size() >= 2)
s = "(" + s + ")";
return name + " " + s;
}
Expand Down