mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 10:33:13 +02:00
@@ -279,7 +279,6 @@ void transformForks(AstNetlist* const netlistp) {
|
||||
// STATE
|
||||
bool m_inClass = false; // Are we in a class?
|
||||
bool m_beginHasAwaits = false; // Does the current begin have awaits?
|
||||
bool m_beginNeedProcess = false; // Does the current begin have process::self dependency?
|
||||
AstFork* m_forkp = nullptr; // Current fork
|
||||
AstCFunc* m_funcp = nullptr; // Current function
|
||||
|
||||
@@ -358,9 +357,8 @@ void transformForks(AstNetlist* const netlistp) {
|
||||
UASSERT_OBJ(m_forkp, nodep, "Begin outside of a fork");
|
||||
// Start with children, so later we only find awaits that are actually in this begin
|
||||
m_beginHasAwaits = false;
|
||||
m_beginNeedProcess = false;
|
||||
iterateChildrenConst(nodep);
|
||||
if (m_beginHasAwaits || m_beginNeedProcess) {
|
||||
if (m_beginHasAwaits || nodep->needProcess()) {
|
||||
UASSERT_OBJ(!nodep->name().empty(), nodep, "Begin needs a name");
|
||||
// Create a function to put this begin's statements in
|
||||
FileLine* const flp = nodep->fileline();
|
||||
@@ -384,7 +382,7 @@ void transformForks(AstNetlist* const netlistp) {
|
||||
}
|
||||
// Put the begin's statements in the function, delete the begin
|
||||
newfuncp->addStmtsp(nodep->stmtsp()->unlinkFrBackWithNext());
|
||||
if (m_beginNeedProcess) {
|
||||
if (nodep->needProcess()) {
|
||||
newfuncp->setNeedProcess();
|
||||
newfuncp->addStmtsp(new AstCStmt{nodep->fileline(),
|
||||
"vlProcess->state(VlProcess::FINISHED);\n"});
|
||||
@@ -405,10 +403,6 @@ void transformForks(AstNetlist* const netlistp) {
|
||||
m_beginHasAwaits = true;
|
||||
iterateChildrenConst(nodep);
|
||||
}
|
||||
void visit(AstCCall* nodep) override {
|
||||
if (nodep->funcp()->needProcess()) m_beginNeedProcess = true;
|
||||
iterateChildrenConst(nodep);
|
||||
}
|
||||
void visit(AstExprStmt* nodep) override { iterateChildren(nodep); }
|
||||
|
||||
//--------------------
|
||||
|
||||
Reference in New Issue
Block a user