FastWaveBackend/examples/parse_vcd.rs
Yehowshua Immanuel 6b6321557b - propagate renaming for crate to fastwave_backend
- repair scope printout from example/vcd.rs
 - update and improve instruction for running examples in README
2022-09-14 16:54:35 -04:00

34 lines
799 B
Rust

// Copyright (C) 2022 Yehowshua Immanuel
// This program is distributed under both the GPLV3 license
// and the YEHOWSHUA license, both of which can be found at
// the root of the folder containing the sources for this program.
use clap::Parser;
use std::fs::File;
use fastwave_backend::*;
use num::{BigUint};
#[derive(Parser)]
struct Cli {
/// The path to the file to read
#[clap(parse(from_os_str))]
path: std::path::PathBuf,
}
fn main() -> std::io::Result<()> {
let args = Cli::parse();
use std::time::Instant;
let now = Instant::now();
let file = File::open(&args.path)?;
let vcd = parse_vcd(file).unwrap();
let elapsed = now.elapsed();
println!("Parsed VCD file {} : {:.2?}", &args.path.as_os_str().to_str().unwrap(), elapsed);
Ok(())
}