Skip to content

Commit 155e1ff

Browse files
authored
Merge pull request #1185 from diffblue/sequence_not1-fix
SVA: `not`/`implies`/`iff` operators yield a property
2 parents 611a93c + 1970013 commit 155e1ff

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
KNOWNBUG
1+
CORE
22
sequence_not1.sv
33

4-
^EXIT=0$
4+
^file .* line 9: sequence required, but got property$
5+
^EXIT=2$
56
^SIGNAL=0$
67
--
78
^warning: ignoring
89
--
9-
The grammar for 'SVA sequence not' is missing.

regression/verilog/SVA/sequence_not1.sv

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ module main(input clk);
55
always @(posedge clk)
66
x<=x+1;
77

8-
// should pass
9-
initial p0: assert property (not x == 1);
10-
11-
// Given a sequence, 'not' yields a sequence, not a property
12-
initial p1: assert property ((not x == 1)[*1]);
8+
// Given a sequence, 'not' yields a property, not a sequence
9+
assert property ((not x == 1)[*1]);
1310

1411
endmodule

src/verilog/verilog_typecheck_sva.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ void verilog_typecheck_exprt::require_sva_sequence(exprt &expr)
2828
type.id() == ID_signedbv || type.id() == ID_verilog_unsignedbv ||
2929
type.id() == ID_verilog_signedbv)
3030
{
31-
if(has_temporal_operator(expr))
31+
if(
32+
has_temporal_operator(expr) || expr.id() == ID_sva_not ||
33+
expr.id() == ID_sva_implies || expr.id() == ID_sva_iff)
3234
{
3335
throw errort().with_location(expr.source_location())
3436
<< "sequence required, but got property";

0 commit comments

Comments
 (0)