Set status of finished process immediately (#8503)

Signed-off-by: Ryszard Rozak <[email protected]>
This commit is contained in:
Ryszard Rozak
2026-09-25 09:26:22 -04:00
committed by GitHub
parent 84dec259c8
commit ba8e0a1437
4 changed files with 47 additions and 4 deletions
+1 -4
View File
@@ -545,10 +545,7 @@ class TransformForksVisitor final : public VNVisitor {
// Replace the body of the begin with a call to the newly created function
nodep->addStmtsp(callp->makeStmt());
// Propagate if needs process
if (nodep->needProcess()) {
newfuncp->setNeedProcess();
newfuncp->addStmtsp(new AstCStmt{flp, "vlProcess->state(VlProcess::FINISHED);"});
}
if (nodep->needProcess()) newfuncp->setNeedProcess();
remapLocals(newfuncp, callp);
}
void visit(AstCAwait* nodep) override {
+4
View File
@@ -1463,6 +1463,10 @@ class TimingControlVisitor final : public VNVisitor {
// Name the begin (later the name will be used for a new function)
itemp->name(nodep->name() + "__" + std::to_string(idx++));
if (itemp->needProcess()) {
itemp->addStmtsp(
new AstCStmt{itemp->fileline(), "vlProcess->state(VlProcess::FINISHED);"});
}
}
if (!nodep->joinType().joinNone()) makeForkJoin(nodep);
}
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env python3
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of either the GNU Lesser General Public License Version 3
# or the Perl Artistic License Version 2.0.
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
import vltest_bootstrap
test.scenarios('simulator')
test.compile(verilator_flags2=['--binary'])
test.execute()
test.passes()
@@ -0,0 +1,24 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2026 Antmicro
// SPDX-License-Identifier: CC0-1.0
module t;
process proc;
initial begin
fork
begin
proc = process::self();
#1;
end
#10;
join_any
if (proc.status() != process::FINISHED) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule