Note that ‘disable iff’ comes after the clocking event.
However when tested on EDA tools both the concurrent assertions ‘ap1’ and ‘ap2’ compile and simulate.
[Q1] Shouldn’t ‘ap2’ throw a compilation error ?
[Q2] What does ‘dist’ in ‘expression_or_dist’ mean ? The only place where I have personally used ‘dist’ is during randomization for distribution weights
[Q1] I don’t think it should. So, as mentioned in 1.6 Syntactic description"The formal syntax of SystemVerilog is described using Backus-Naur Form (BNF)" and also "Square brackets ( [ ] ) that are not in boldface-red enclose optional items."
That means [clocking_event ] [disable iff ( expression_or_dist )] are
optional items and the parser should be able to handle all their possible combinations of existence, and about whether the order in which optional items are defined will matter or not that should be mentioned in the language grammar. I checked [Annex A (normative) Formal syntax, Annex F (normative) Formal semantics of concurrent assertions], and I couldn’t find anything explicitly saying that the order matters. I guess that will leave it open to the implementer.
[Q2] dist could be also used but it’s only meaninful in case of assume directive, with assert it’s equivalent to inside as mentioned in 16.14.2 Assume statement"The biasing feature is useful when properties are considered as assumptions to drive random simulation. When a property with biasing is used within an assert or cover assertion statement, the dist operator is equivalent to inside operator, and the weight specification is ignored"
Personally, I haven’t used it in a disable iff within a simulation context, but I can see it could be useful in a formal setup. I’ve created the following example, and it seems to be working as expected
[caveat: only one EDA provider supports it so far on EDAplayground]