forked from verilator/verilator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tracing_{on,off} in the presence of non-inlined modules
Previously "*.foo.*" failed to match non-inlined instances called 'foo'.
- Loading branch information
Showing
5 changed files
with
108 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
$version Generated by VerilatedVcd $end | ||
$timescale 1ps $end | ||
$scope module top $end | ||
$scope module t $end | ||
$scope module sub_b $end | ||
$var wire 1 # clk $end | ||
$var wire 32 $ cnt [31:0] $end | ||
$upscope $end | ||
$upscope $end | ||
$upscope $end | ||
$enddefinitions $end | ||
|
||
|
||
#0 | ||
0# | ||
b00000000000000000000000000000000 $ | ||
#10 | ||
1# | ||
b00000000000000000000000000000001 $ | ||
#15 | ||
0# | ||
#20 | ||
1# | ||
b00000000000000000000000000000010 $ | ||
#25 | ||
0# | ||
#30 | ||
1# | ||
b00000000000000000000000000000011 $ | ||
#35 | ||
0# | ||
#40 | ||
1# | ||
b00000000000000000000000000000100 $ | ||
#45 | ||
0# | ||
#50 | ||
1# | ||
b00000000000000000000000000000101 $ | ||
#55 | ||
0# | ||
#60 | ||
1# | ||
b00000000000000000000000000000110 $ |
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,24 @@ | ||
#!/usr/bin/env perl | ||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } | ||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition | ||
# | ||
# Copyright 2024 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(vlt => 1); | ||
|
||
compile( | ||
verilator_flags2 => ["--cc --trace -fno-inline t/$Self->{name}.vlt"], | ||
); | ||
|
||
execute( | ||
check_finished => 1, | ||
); | ||
|
||
vcd_identical($Self->trace_filename, $Self->{golden_filename}); | ||
|
||
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,27 @@ | ||
// 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 | ||
|
||
module t (clk); | ||
input clk; | ||
integer cyc = 0; | ||
|
||
always @ (posedge clk) begin | ||
cyc <= cyc + 1; | ||
if (cyc == 5) begin | ||
$write("*-* All Finished *-*\n"); | ||
$finish; | ||
end | ||
end | ||
|
||
sub sub_a(clk); | ||
sub sub_b(clk); | ||
sub sub_c(clk); | ||
endmodule | ||
|
||
module sub(input wire clk); | ||
int cnt = 0; | ||
always @(posedge clk) cnt++; | ||
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,12 @@ | ||
// DESCRIPTION: Verilator: Verilog Test module | ||
// | ||
// This file ONLY is placed into the Public Domain, for any use, | ||
// without warranty, 2024 by Wilson Snyder. | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
`verilator_config | ||
|
||
// Turn tracing off for all scopes by default | ||
tracing_off -scope "*" -levels 0 | ||
// Turn it back on only for *.sub_b.* and below | ||
tracing_on -scope "*.sub_b.*" -levels 0 |