Fix mis-setting of process state from FINISHED to KILLED (#8506)

Signed-off-by: Ryszard Rozak <[email protected]>
This commit is contained in:
Ryszard Rozak
2026-09-25 09:43:55 -04:00
committed by GitHub
parent 765d05acf8
commit 0e0ce2be52
3 changed files with 59 additions and 2 deletions
+5 -2
View File
@@ -296,8 +296,11 @@ void VlProcess::forkSyncOnKillClear(VlForkSyncState* forkSyncp) {
}
void VlProcess::state(int s) {
if (s == KILLED && m_state != KILLED && m_state != FINISHED && m_forkSyncOnKillp
&& !m_forkSyncOnKillDone) {
if (completed()) {
// We can't change the sttaus of completed process
return;
}
if (s == KILLED && m_forkSyncOnKillp && !m_forkSyncOnKillDone) {
m_forkSyncOnKillDone = true;
m_state = s;
m_forkSyncOnKillp->done();
+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()
+36
View File
@@ -0,0 +1,36 @@
// 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();
fork
begin
#5;
end
join_none
#1;
end
#10;
join_any
#1;
if (proc.status() != process::FINISHED) $stop;
disable fork;
if (proc.status() != process::FINISHED) $stop;
proc.kill();
if (proc.status() != process::FINISHED) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule