Support property calls without parenthesis (#3879) (#3893)

This commit is contained in:
Ryszard Rozak 2023-01-20 13:25:37 +01:00 committed by GitHub
parent 41e5f6b7d5
commit be53eec5ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -2668,6 +2668,12 @@ private:
} else if (VN_IS(foundp->nodep(), Clocking)) {
m_ds.m_dotSymp = foundp;
ok = m_ds.m_dotPos == DP_SCOPE;
} else if (VN_IS(foundp->nodep(), Property)) {
AstFuncRef* const propRefp
= new AstFuncRef{nodep->fileline(), nodep->name(), nullptr};
nodep->replaceWith(propRefp);
VL_DO_DANGLING(pushDeletep(nodep), nodep);
ok = m_ds.m_dotPos == DP_NONE;
}
//
if (!ok) {

View File

@ -54,8 +54,16 @@ module t (/*AUTOARG*/
// Assertion should fail
expected_fails += 1;
end
logic out = 1;
property prop_a;
@(posedge clk) disable iff (cyc <= 10) out;
endproperty
assert property(disable iff (cyc < 5) check_if_gt_5(cyc + 1));
assert property(@(posedge clk) pass_assertion(cyc));
assert property (prop_a) else $error($sformatf("property check failed :assert: (False)"));
always @(posedge clk) begin
if (expected_fails == 2) begin