forked from verilator/verilator
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support NBAs in non-inlined tasks/functions
Signed-off-by: Krzysztof Bieganski <[email protected]>
- Loading branch information
1 parent
3613d11
commit c0c8d7d
Showing
10 changed files
with
272 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env perl | ||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } | ||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition | ||
# | ||
# Copyright 2019 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 | ||
|
||
scenarios(simulator => 1); | ||
|
||
compile( | ||
verilator_flags2 => ["--exe --main --timing"], | ||
make_main => 0, | ||
); | ||
|
||
execute( | ||
check_finished => 1, | ||
); | ||
|
||
compile( | ||
verilator_flags2 => ["--exe --main --timing +define+WITH_DELAY"], | ||
make_main => 0, | ||
); | ||
|
||
execute( | ||
check_finished => 1, | ||
); | ||
|
||
ok(1); | ||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// DESCRIPTION: Verilator: Verilog Test module | ||
// | ||
// This file ONLY is placed into the Public Domain, for any use, | ||
// without warranty, 2023 by Antmicro Ltd. | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
`ifdef WITH_DELAY | ||
`define DELAY #1 | ||
`define TIME_AFTER_FIRST_WAIT 2 | ||
`define TIME_AFTER_SECOND_WAIT 3 | ||
`else | ||
`define DELAY | ||
`define TIME_AFTER_FIRST_WAIT 1 | ||
`define TIME_AFTER_SECOND_WAIT 1 | ||
`endif | ||
|
||
class nba_waiter; | ||
// Task taken from UVM | ||
task wait_for_nba_region; | ||
int nba; | ||
int next_nba; | ||
next_nba++; | ||
nba <= `DELAY next_nba; | ||
@(nba); | ||
endtask | ||
endclass | ||
|
||
module t; | ||
nba_waiter waiter = new; | ||
event e; | ||
int cnt = 0; | ||
|
||
initial begin | ||
#1 ->e; | ||
if (cnt != 0) $stop; | ||
cnt++; | ||
waiter.wait_for_nba_region; | ||
->e; | ||
if (cnt != 2) $stop; | ||
if ($time != `TIME_AFTER_FIRST_WAIT) $stop; | ||
cnt++; | ||
waiter.wait_for_nba_region; | ||
if (cnt != 4) $stop; | ||
if ($time != `TIME_AFTER_SECOND_WAIT) $stop; | ||
$write("*-* All Finished *-*\n"); | ||
$finish; | ||
end | ||
|
||
initial begin | ||
@e if (cnt != 1) $stop; | ||
cnt++; | ||
@e if (cnt != 3) $stop; | ||
cnt++; | ||
end | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%Error-NOTIMING: t/t_assigndly_dynamic_notiming.v:10:13: Delayed assignment in a non-inlined function/task requires --timing | ||
: ... note: In instance '$unit::foo' | ||
10 | qux <= '1; | ||
| ^~ | ||
... For error description see https://verilator.org/warn/NOTIMING?v=latest | ||
%Error: Exiting due to |
Oops, something went wrong.