Skip to content

Commit 96f8d09

Browse files
authored
Merge pull request #685 from diffblue/fixup-verilog-implies
Verilog: fix for output of `->`
2 parents 79636e4 + 8fe63c3 commit 96f8d09

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

regression/verilog/expressions/bit-extract6.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
bit-extract6.sv
33
--module main --bound 0
4-
^\[main\.p0\] always \(main\.index == 8 |-> main\.vector\[7 - main\.index - 1\] == 1\): PROVED up to bound 0$
5-
^\[main\.p1\] always \(main\.index >= 1 \&\& main\.index <= 7 |-> main\.vector\[7 - main\.index - 1\] == 0\): PROVED up to bound 0$
4+
^\[main\.p0\] always main\.index == 8 -> main\.vector\[7 - main\.index - 1\] == 1: PROVED up to bound 0$
5+
^\[main\.p1\] always main\.index >= 1 \&\& main\.index <= 7 -> main\.vector\[7 - main\.index - 1\] == 0: PROVED up to bound 0$
66
^EXIT=0$
77
^SIGNAL=0$
88
--

regression/verilog/synthesis/always_comb2.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CORE
22
always_comb2.sv
33
--bound 0
4-
^\[main\.property\.p0\] always \(main\.data == 0 |-> main\.decoded == 1\): PROVED up to bound 0$
5-
^\[main\.property\.p1\] always \(main\.data == 1 |-> main\.decoded == 2\): PROVED up to bound 0$
6-
^\[main\.property\.p2\] always \(main\.data == 2 |-> main\.decoded == 4\): PROVED up to bound 0$
4+
^\[main\.p0\] always main\.data == 0 -> main\.decoded == 1: PROVED up to bound 0$
5+
^\[main\.p1\] always main\.data == 1 -> main\.decoded == 2: PROVED up to bound 0$
6+
^\[main\.p2\] always main\.data == 2 -> main\.decoded == 4: PROVED up to bound 0$
77
^EXIT=0$
88
^SIGNAL=0$
99
--

src/verilog/expr2verilog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,11 +1324,11 @@ expr2verilogt::convert(const exprt &src, verilog_precedencet &precedence)
13241324

13251325
else if(src.id()==ID_implies)
13261326
return convert_binary(
1327-
to_multi_ary_expr(src), "|->", precedence = verilog_precedencet::MIN);
1327+
to_multi_ary_expr(src), "->", precedence = verilog_precedencet::IMPLIES);
13281328

13291329
else if(src.id()==ID_iff)
13301330
return convert_binary(
1331-
to_multi_ary_expr(src), "<->", precedence = verilog_precedencet::MIN);
1331+
to_multi_ary_expr(src), "<->", precedence = verilog_precedencet::IMPLIES);
13321332

13331333
else if(src.id()==ID_reduction_or)
13341334
return convert_unary(

src/verilog/expr2verilog_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum class verilog_precedencet
3838
AND = 7, // &&
3939
OR = 6, // ||
4040
IF = 5, // ?:
41-
IMPLIES = 4, // ->
41+
IMPLIES = 4, // -> <->
4242
ASSIGN = 3, // = += -= etc.
4343
CONCAT = 18, // { } concatenation, {{ }} replication
4444
MIN = 0 // anything even weaker, e.g., SVA

0 commit comments

Comments
 (0)