Fix timing mode not exiting on empty events (#5472).

This commit is contained in:
Wilson Snyder 2024-09-20 17:46:27 -04:00
parent 1665d15d4d
commit 92dd8ee8f5
4 changed files with 35 additions and 1 deletions

View File

@ -55,6 +55,7 @@ Verilator 5.029 devel
* Fix foreach colliding index names (#5444). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix fault on defparam with UNSUPPORTED ignored (#5450). [Luiza de Melo]
* Fix class reference with pin that is a class reference (#5454).
* Fix timing mode not exiting on empty events (#5472).
Verilator 5.028 2024-08-21

View File

@ -85,8 +85,10 @@ private:
puts(/**/ "// Evaluate model\n");
puts(/**/ "topp->eval();\n");
puts(/**/ "// Advance time\n");
if (v3Global.rootp()->delaySchedulerp()) {
if (v3Global.rootp()->delaySchedulerp() || v3Global.opt.timing()) {
puts("if (!topp->eventsPending()) break;\n");
}
if (v3Global.rootp()->delaySchedulerp()) {
puts("contextp->time(topp->nextTimeSlot());\n");
} else {
puts("contextp->timeInc(1);\n");

View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2024 by Wilson Snyder. 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-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()

View File

@ -0,0 +1,13 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2024 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
program t;
initial begin
#1;
$write("*-* All Finished *-*\n");
// No $finish
end
endprogram