From c1f2b2cf9354b2fbf23a1fe2de29b03ffd137204 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 21 Jun 2018 23:12:11 -0400 Subject: [PATCH] *Ordering Change*: Separate initial and settle when ordering. From threads branch. --- src/V3Order.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 0c3da29d7..329db14c3 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -1004,8 +1004,9 @@ static bool domainsExclusive(const AstSenTree* fromp, const AstSenTree* top) { // Return 'true' if we can prove that both 'from' and 'to' cannot both // be active on the same eval pass, or false if we can't prove this. // - // For now, this only detects the case of 'always @(posedge clk)' - // and 'always @(negedge clk)' being exclusive. + // This detects the case of 'always @(posedge clk)' + // and 'always @(negedge clk)' being exclusive. It also detects + // that initial/settle blocks and post-initial blocks are exclusive. // // Are there any other cases we need to handle? Maybe not, // because these are not exclusive: @@ -1013,6 +1014,13 @@ static bool domainsExclusive(const AstSenTree* fromp, const AstSenTree* top) { // always @(negedge A) // // ... unless you know more about A and B, which sounds hard. + + bool toInitial = top->hasInitial() || top->hasSettle(); + bool fromInitial = fromp->hasInitial() || fromp->hasSettle(); + if (toInitial != fromInitial) { + return true; + } + const AstSenItem* fromSenListp = VN_CAST(fromp->sensesp(), SenItem); const AstSenItem* toSenListp = VN_CAST(top->sensesp(), SenItem); // If clk gating is ever reenabled, we may need to update this to handle