Fix timing control in while-break loops (#3733) (#3769)

This commit is contained in:
Ryszard Rozak 2022-11-21 12:27:55 +01:00 committed by GitHub
parent 2eed4452ad
commit 62bdd3ab49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 8 deletions

View File

@ -2801,14 +2801,11 @@ private:
// least as frequently activating. So we
// SENGATE(SENITEM(x)) -> SENITEM(x), then let it collapse with the
// other SENITEM(x).
{
const VNUser4InUse m_inuse4;
// Mark x in SENITEM(x)
for (AstSenItem* senp = nodep->sensesp(); senp;
senp = VN_AS(senp->nextp(), SenItem)) {
if (senp->varrefp() && senp->varrefp()->varScopep()) {
senp->varrefp()->varScopep()->user4(1);
}
// Mark x in SENITEM(x)
for (AstSenItem* senp = nodep->sensesp(); senp; senp = VN_AS(senp->nextp(), SenItem)) {
if (senp->varrefp() && senp->varrefp()->varScopep()) {
senp->varrefp()->varScopep()->user4(1);
}
}

View File

@ -0,0 +1,30 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2022 by Antmicro Ltd. 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
scenarios(simulator => 1);
$Self->{main_time_multiplier} = 10e-7 / 10e-9;
if (!$Self->have_coroutines) {
skip("No coroutine support");
}
else {
compile(
timing_loop => 1,
verilator_flags2 => ['--timing -Wno-ZERODLY'],
);
execute(
check_finished => 1,
);
}
ok(1);
1;

View File

@ -0,0 +1,24 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2022 by Antmicro Ltd.
// SPDX-License-Identifier: CC0-1.0
module t();
logic clk = 0;
logic out = 1;
always #5 clk = ~clk;
initial begin
while(1) begin
if(out) begin
break;
end
@(negedge clk);
end
$write("*-* All Finished *-*\n");
$finish();
end
endmodule