- propagate renaming for crate to fastwave_backend
- repair scope printout from example/vcd.rs - update and improve instruction for running examples in README
This commit is contained in:
parent
4243551d76
commit
6b6321557b
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "fastwave"
|
name = "fastwave_backend"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
@ -13,4 +13,4 @@ num = "0.4"
|
||||||
clap = { version = "3.1.8", features = ["derive"] }
|
clap = { version = "3.1.8", features = ["derive"] }
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
# TODO : remove itertools once date parser is reworked.
|
# TODO : remove itertools once date parser is reworked.
|
||||||
itertools = "0.10.3"
|
itertools = "0.10.3"
|
||||||
|
|
|
@ -56,11 +56,11 @@ This repository comes with several smaller VCD files emitted from
|
||||||
various EDA tools. If you want a larger VCD file, grab one from
|
various EDA tools. If you want a larger VCD file, grab one from
|
||||||
[here](https://drive.google.com/file/d/1pfm2qo2l8fGTHHJ8TLrg1vSGaV_TUbp2/view?usp=sharing).
|
[here](https://drive.google.com/file/d/1pfm2qo2l8fGTHHJ8TLrg1vSGaV_TUbp2/view?usp=sharing).
|
||||||
|
|
||||||
|
Here are some examples you can run:
|
||||||
The first build of the program may take some time.
|
The first build of the program may take some time.
|
||||||
|
|
||||||
``cargo run --release --example parse_vcd tests/vcd-files/aldec/SPI_Write.vcd``
|
1. ``cargo run --release --example parse_vcd tests/vcd-files/aldec/SPI_Write.vcd``
|
||||||
|
2. ``cargo run --release --example vcd``
|
||||||
You can also run the vcd example with: cargo run --release --example vcd1.
|
|
||||||
|
|
||||||
You can run all the tests with ``cargo test``
|
You can run all the tests with ``cargo test``
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
||||||
use fastwave::*;
|
use fastwave_backend::*;
|
||||||
|
|
||||||
use num::{BigUint};
|
use num::{BigUint};
|
||||||
|
|
||||||
|
|
|
@ -4,20 +4,18 @@
|
||||||
// the root of the folder containing the sources for this program.
|
// the root of the folder containing the sources for this program.
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
||||||
use fastwave::*;
|
use fastwave_backend::*;
|
||||||
|
|
||||||
use num::{BigUint};
|
use num::{BigUint};
|
||||||
|
|
||||||
fn indented_print(indent : u8, name : &String) {
|
fn indented_print(indent : u8, name : &String) {
|
||||||
for _ in 0..indent {print!(" ");}
|
for _ in 0..indent {print!(" |");}
|
||||||
print!(" |");
|
print!("---");
|
||||||
print!(" ");
|
|
||||||
println!("{name}");
|
println!("{name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_root_scope_tree(root_idx: ScopeIdx, vcd: &VCD, indent : u8) {
|
fn print_root_scope_tree(root_idx: ScopeIdx, vcd: &VCD, indent : u8) {
|
||||||
if vcd.child_scopes_by_idx(root_idx).is_empty() {
|
if vcd.child_scopes_by_idx(root_idx).is_empty() {
|
||||||
indented_print(indent, vcd.scope_name_by_idx(root_idx));
|
|
||||||
} else {
|
} else {
|
||||||
for child_scope_idx in vcd.child_scopes_by_idx(root_idx) {
|
for child_scope_idx in vcd.child_scopes_by_idx(root_idx) {
|
||||||
indented_print(indent, vcd.scope_name_by_idx(child_scope_idx));
|
indented_print(indent, vcd.scope_name_by_idx(child_scope_idx));
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn parse_all_VCDs() {
|
||||||
// see if we can parse all signal trees successfully
|
// see if we can parse all signal trees successfully
|
||||||
for file_name in FILES {
|
for file_name in FILES {
|
||||||
let file = File::open(file_name).unwrap();
|
let file = File::open(file_name).unwrap();
|
||||||
let vcd = fastwave::parse_vcd(file);
|
let vcd = fastwave_backend::parse_vcd(file);
|
||||||
|
|
||||||
if !vcd.is_ok() {
|
if !vcd.is_ok() {
|
||||||
dbg!(file_name);
|
dbg!(file_name);
|
||||||
|
|
Loading…
Reference in a new issue