mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Do not feed any empty logic into scheduling (#4972)
This commit is contained in:
parent
08c76b1da6
commit
878204db73
@ -77,6 +77,21 @@ class ActiveTopVisitor final : public VNVisitor {
|
||||
VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete empty procedures
|
||||
for (AstNode *stmtp = nodep->stmtsp(), *nextp; stmtp; stmtp = nextp) {
|
||||
nextp = stmtp->nextp();
|
||||
if (AstNodeProcedure* const procp = VN_CAST(stmtp, NodeProcedure)) {
|
||||
if (!procp->stmtsp()) VL_DO_DANGLING(pushDeletep(procp->unlinkFrBack()), stmtp);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete empty actives
|
||||
if (!nodep->stmtsp()) {
|
||||
VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
|
||||
return;
|
||||
}
|
||||
|
||||
// Move the SENTREE for each active up to the global level.
|
||||
// This way we'll easily see what clock domains are identical
|
||||
AstSenTree* const wantp = m_finder.getSenTree(sensesp);
|
||||
|
@ -116,7 +116,8 @@ public:
|
||||
AstNode* const headp = [&]() -> AstNode* {
|
||||
if (!procp) return logicp; // Not a procedure, handle as a unit
|
||||
AstNode* const stmtsp = procp->stmtsp();
|
||||
if (stmtsp) stmtsp->unlinkFrBackWithNext();
|
||||
UASSERT_OBJ(stmtsp, procp, "Empty process should have been deleted earlier");
|
||||
stmtsp->unlinkFrBackWithNext();
|
||||
// Procedure is no longer needed and can be deleted right now
|
||||
VL_DO_DANGLING(procp->deleteTree(), procp);
|
||||
return stmtsp;
|
||||
|
@ -355,14 +355,9 @@ LogicClasses gatherLogicClasses(AstNetlist* netlistp) {
|
||||
LogicClasses result;
|
||||
|
||||
netlistp->foreach([&](AstScope* scopep) {
|
||||
std::vector<AstActive*> empty;
|
||||
|
||||
scopep->foreach([&](AstActive* activep) {
|
||||
AstSenTree* const senTreep = activep->sensesp();
|
||||
if (!activep->stmtsp()) {
|
||||
// Some AstActives might be empty due to previous optimizations
|
||||
empty.push_back(activep);
|
||||
} else if (senTreep->hasStatic()) {
|
||||
if (senTreep->hasStatic()) {
|
||||
UASSERT_OBJ(!senTreep->sensesp()->nextp(), activep,
|
||||
"static initializer with additional sensitivities");
|
||||
result.m_static.emplace_back(scopep, activep);
|
||||
@ -393,8 +388,6 @@ LogicClasses gatherLogicClasses(AstNetlist* netlistp) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (AstActive* const activep : empty) activep->unlinkFrBack()->deleteTree();
|
||||
});
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user