- 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:
Yehowshua Immanuel 2022-09-14 16:54:35 -04:00
parent 4243551d76
commit 6b6321557b
5 changed files with 10 additions and 12 deletions

View file

@ -1,5 +1,5 @@
[package] [package]
name = "fastwave" name = "fastwave_backend"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"

View file

@ -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``

View file

@ -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};

View file

@ -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));

View file

@ -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);