Skip to content

Commit 0383e34

Browse files
committed
SVA: the not operator yields a property
The SVA not operator yields a property, even when applied to a sequence, and hence, use as a sequence should be errored.
1 parent 611a93c commit 0383e34

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ 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(has_temporal_operator(expr) || expr.id() == ID_sva_not)
3232
{
3333
throw errort().with_location(expr.source_location())
3434
<< "sequence required, but got property";

0 commit comments

Comments
 (0)