For a tool, I'm trying to correctly parse SystemVerilog assertions, and am confused about the correct precedence for certain expressions. The SystemVerilog standard has a nice table where they say that not
> until
> always
for precedence. But I don't quite understand how this is supposed to work with alternations of the unary operators.
For instance, since not
is higher precedence than until
, we should obviously have:
not r1 until r2 ----> (not r1) until r2
And since until
is higher precedence than always
, we should obviously have:
always r1 until r2 ----> always (r1 until r2)
But what's the proper way to interpret the following?
not always r1 until r2
I can imagine that two interpretations might be correct:
not always (r1 until r2)
, sinceuntil
binds more tightly thanalways
, or(not always r1) until r2
, sincenot
binds more tightly thanuntil
It looks like NCVerilog 15.10-p001 uses the first interpretation. Is there anywhere in the standard that discusses whether this is correct that I may have missed? It seems difficult to encode NCVerilog's precedence rules into a nice grammar...