FastWaveBackend/src/main.rs

39 lines
757 B
Rust
Raw Normal View History

2022-07-30 23:58:54 +00:00
use std::{fs::File};
2022-04-14 04:50:37 +00:00
use clap::Parser;
pub mod test;
2022-06-03 16:06:20 +00:00
pub mod vcd;
2022-07-13 00:02:45 +00:00
use vcd::parse_vcd;
2022-07-30 23:58:54 +00:00
use std::mem::size_of_val;
2022-04-14 04:50:37 +00:00
#[derive(Parser)]
struct Cli {
/// The path to the file to read
#[clap(parse(from_os_str))]
path: std::path::PathBuf}
2022-04-14 04:50:37 +00:00
fn main() -> std::io::Result<()> {
let args = Cli::parse();
2022-07-26 01:16:15 +00:00
use std::time::Instant;
let now = Instant::now();
2022-06-18 05:00:01 +00:00
let file = File::open(&args.path)?;
2022-07-20 14:38:56 +00:00
let vcd = parse_vcd(file).unwrap();
2022-07-16 00:48:02 +00:00
2022-07-26 01:16:15 +00:00
let elapsed = now.elapsed();
println!("Elapsed: {:.2?}", elapsed);
vcd.print_longest_signal();
2022-07-30 23:58:54 +00:00
dbg!(size_of_val(&*vcd.timeline));
// unsafe {
// let sz = size_of_val(&*vcd.timeline);
// }
2022-07-26 01:16:15 +00:00
2022-07-20 02:05:00 +00:00
// println!("printing signal tree");
// vcd.print_scopes();
2022-06-04 01:06:46 +00:00
2022-04-14 04:50:37 +00:00
Ok(())
}