https://github.com/definev/dart_vcd
Read and write VCD (Value Change Dump) files
https://github.com/definev/dart_vcd
Last synced: 10 months ago
JSON representation
Read and write VCD (Value Change Dump) files
- Host: GitHub
- URL: https://github.com/definev/dart_vcd
- Owner: definev
- License: mit
- Created: 2023-09-30T07:02:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-06T19:25:42.000Z (about 2 years ago)
- Last Synced: 2025-03-23T21:14:35.916Z (about 1 year ago)
- Language: Dart
- Homepage: https://pub.dev/packages/dart_vcd
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# dart_vcd
Reads and writes VCD (Value Change Dump) files, a common format used with logic analyzers, HDL simulators, and other EDA tools. It provides streaming wrappers to read and write VCD commands and data.
---
Port of [rust-vcd](https://github.com/kevinmehall/rust-vcd) to Dart.
## Usage
A simple usage example:
```dart
import 'package:dart_vcd/dart_vcd.dart';
void main() {
VCDWriter writer = StringBufferVCDWriter();
// Write header
writer.timescale(1, TimescaleUnit.us);
writer.addModule('top');
final clock = writer.addWire(1, 'clock');
final data = writer.addWire(1, 'data');
writer.upscope();
writer.enddefinitions();
// Write values
writer.begin(SimulationCommand.dumpvars);
writer.changeScalar(clock, Value.v0);
writer.changeScalar(data, Value.v0);
writer.end();
var t = 0;
for (var i = 0; i < 32; i++) {
t += 4;
writer.timestamp(t);
writer.changeScalar(clock, Value.v1);
writer.changeScalar(data, Value.v1);
}
print(writer.result);
}
```