-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade VcdParser to handle more VCD files (#260)
- Loading branch information
Showing
3 changed files
with
158 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
$date | ||
Tue Feb 7 10:45:30 2023 | ||
$end | ||
$version | ||
Icarus Verilog | ||
$end | ||
$timescale | ||
1ps | ||
$end | ||
$scope module cosim_wrapper $end | ||
$scope module external_module $end | ||
$var wire 1 ! clk $end | ||
$var wire 8 " push_data [7:0] $end | ||
$var wire 1 # push_valid $end | ||
$var reg 8 $ sampled [7:0] $end | ||
$upscope $end | ||
$upscope $end | ||
$enddefinitions $end | ||
#0 | ||
$dumpvars | ||
bx $ | ||
z# | ||
bz " | ||
0! | ||
$end | ||
#5000 | ||
1! | ||
#5002 | ||
b0 " | ||
1# | ||
#10000 | ||
0! | ||
#15000 | ||
b0 $ | ||
1! | ||
#15002 | ||
b1 " | ||
0# | ||
#20000 | ||
0! | ||
#25000 | ||
1! | ||
#25002 | ||
b10 " | ||
1# | ||
#30000 | ||
0! | ||
#35000 | ||
b10 $ | ||
1! | ||
#35002 | ||
b11 " | ||
0# | ||
#40000 | ||
0! | ||
#45000 | ||
1! | ||
#45002 | ||
b100 " | ||
1# | ||
#50000 | ||
0! | ||
#55000 | ||
b100 $ | ||
1! | ||
#55002 | ||
b101 " | ||
0# | ||
#60000 | ||
0! | ||
#65000 | ||
1! | ||
#65002 | ||
b110 " | ||
1# | ||
#70000 | ||
0! | ||
#75000 | ||
b110 $ | ||
1! | ||
#75002 | ||
b111 " | ||
0# | ||
#80000 | ||
0! | ||
#85000 | ||
1! | ||
#85002 | ||
b1000 " | ||
1# | ||
#90000 | ||
0! | ||
#95000 | ||
b1000 $ | ||
1! | ||
#95002 | ||
b1001 " | ||
0# | ||
#100000 | ||
0! | ||
#100002 |
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,33 @@ | ||
/// Copyright (C) 2023 Intel Corporation | ||
/// SPDX-License-Identifier: BSD-3-Clause | ||
/// | ||
/// vcd_parser_test.dart | ||
/// Tests for the VcdParser | ||
/// | ||
/// 2023 February 7 | ||
/// Author: Max Korbel <max.korbel@intel.com> | ||
/// | ||
import 'dart:io'; | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd/src/utilities/vcd_parser.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
test('VCD parser can parse Icarus Verilog generated VCD file', () { | ||
final vcdContents = | ||
File('test/example_icarus_waves.vcd').readAsStringSync(); | ||
for (var countI = 1; countI < 10; countI++) { | ||
expect( | ||
VcdParser.confirmValue( | ||
vcdContents, | ||
'sampled', | ||
(10 * countI + 5) * 1000, | ||
LogicValue.ofInt(countI.isEven ? countI - 2 : countI - 1, 8), | ||
), | ||
isTrue, | ||
); | ||
} | ||
}); | ||
} |