Why is assert property wrapped in an always block?
#1636
|
Consider this simple Verilog snippet: module Foo (input logic clock, a, b);
assert property (@(posedge clock) a == b);
endmoduleRunning this through "kind": "ProceduralBlock",
"procedureKind": "Always",
"body": {
"kind": "ConcurrentAssertion",
"propertySpec": {
"kind": "Clocking",
"clocking": {
"kind": "SignalEvent",
"expr": "clock",
"edge": "PosEdge"
},
"expr": {
"kind": "Simple",
"expr": {
"kind": "BinaryOp",
"type": "logic",
"op": "Equality",
"left": "a",
"right": "b"
}
}
}
}Why does Slang wrap this |
Replies: 2 comments 3 replies
|
16.14.5 describes how assertions outside of procedural code are specified to behave as if they had been wrapped in an always block, so slang normalizes them to the same form. |
|
Interesting thread - an orthogonal observation that maybe useful @fabianschuiki (Though maybe you already are aware): module Foo(input logic a, b, c);
always if (a) assert property (b |-> ##10 c);
endmoduleYour rewrite/pseudo-code makes it more interesting than just "concurrent assertions." There is a variant known as "procedural concurrent assertions" in the SV LRM, though very few users use it (as far as I have seen over last 10+ years), from a language perspective, it exists. |
16.14.5 describes how assertions outside of procedural code are specified to behave as if they had been wrapped in an always block, so slang normalizes them to the same form.