From be298d1cca451e037af99523097b99593671b0b2 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 2 Oct 2022 13:27:44 +0200 Subject: [PATCH] Allow repeat expression in event control to contain automatic terms The repeat expression of an event controlled non-blocking assignment is evaluated once when the assignment is scheduled. This means there is no risk of it being referenced when its scope has already been freed. And hence there is no need to require the repeat expression to only contain static terms. Signed-off-by: Lars-Peter Clausen --- elaborate.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index e4894fd6e..584745249 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -3251,15 +3251,6 @@ NetProc* PAssignNB::elaborate(Design*des, NetScope*scope) const NetEvWait*event = 0; if (count_ != 0 || event_ != 0) { if (count_ != 0) { - if (scope->is_auto() && count_->has_aa_term(des, scope)) { - cerr << get_fileline() << ": error: automatically " - "allocated variables may not be referenced " - "in intra-assignment event controls of " - "non-blocking assignments." << endl; - des->errors += 1; - return 0; - } - ivl_assert(*this, event_ != 0); count = elab_and_eval(des, scope, count_, -1); if (count == 0) {