diff --git a/src/fst.rs b/src/fst.rs index aa64813..4285b98 100644 --- a/src/fst.rs +++ b/src/fst.rs @@ -75,14 +75,14 @@ impl SignalSource for FstWaveDatabase { fn convert_scope_tpe(tpe: FstScopeType) -> ScopeType { match tpe { FstScopeType::Module => ScopeType::Module, - _ => ScopeType::Todo, + other => panic!("Unsupported scope type: {:?}", other), } } fn convert_var_tpe(tpe: FstVarType) -> VarType { match tpe { FstVarType::Wire => VarType::Wire, - _ => VarType::Todo, + other => panic!("Unsupported var type: {:?}", other), } } diff --git a/src/hierarchy.rs b/src/hierarchy.rs index 8991683..49d3a25 100644 --- a/src/hierarchy.rs +++ b/src/hierarchy.rs @@ -116,7 +116,10 @@ impl HierarchyStringId { #[derive(Debug, Clone, Copy)] pub enum ScopeType { Module, - Todo, // placeholder tpe + Task, + Function, + Begin, + Fork, } #[derive(Debug, Clone, Copy)] @@ -126,7 +129,6 @@ pub enum VarType { Parameter, Integer, String, - Todo, // placeholder tpe } #[derive(Debug, Clone, Copy)] diff --git a/src/vcd.rs b/src/vcd.rs index e5f0d8c..27ecfc7 100644 --- a/src/vcd.rs +++ b/src/vcd.rs @@ -158,7 +158,11 @@ fn convert_timescale_unit(name: &[u8]) -> TimescaleUnit { fn convert_scope_tpe(tpe: &[u8]) -> ScopeType { match tpe { b"module" => ScopeType::Module, - _ => ScopeType::Todo, + b"task" => ScopeType::Task, + b"function" => ScopeType::Function, + b"begin" => ScopeType::Begin, + b"fork" => ScopeType::Fork, + _ => panic!("TODO: convert {}", String::from_utf8_lossy(tpe)), } } diff --git a/tests/diff_tests.rs b/tests/diff_tests.rs index deb9b7f..5561754 100644 --- a/tests/diff_tests.rs +++ b/tests/diff_tests.rs @@ -72,7 +72,10 @@ fn diff_meta(ours: &Hierarchy, ref_header: &vcd::Header) { fn waveform_scope_type_to_string(tpe: ScopeType) -> &'static str { match tpe { ScopeType::Module => "module", - ScopeType::Todo => "todo", + ScopeType::Task => "task", + ScopeType::Function => "function", + ScopeType::Begin => "begin", + ScopeType::Fork => "fork", } } @@ -83,7 +86,6 @@ fn waveform_var_type_to_string(tpe: VarType) -> &'static str { VarType::Parameter => "parameter", VarType::Integer => "integer", VarType::String => "string", - VarType::Todo => "todo", } } @@ -247,7 +249,7 @@ fn id_to_int(id: &[u8]) -> Option { #[test] #[ignore] // TODO: this file has a delta cycle, i.e. the same signal (`/`) changes twice in the same cycle (35185000) -fn diff_aldec_SPI_Write() { +fn diff_aldec_spi_write() { run_diff_test( "inputs/aldec/SPI_Write.vcd", "inputs/aldec/SPI_Write.vcd.fst", @@ -288,10 +290,23 @@ fn diff_gtkwave_perm_current() { } #[test] -fn diff_icarus_CPU() { +fn diff_icarus_cpu() { run_diff_test("inputs/icarus/CPU.vcd", "inputs/icarus/CPU.vcd.fst"); } +#[test] +fn diff_icarus_rv32_soc_tb() { + run_diff_test( + "inputs/icarus/rv32_soc_TB.vcd", + "inputs/icarus/rv32_soc_TB.vcd.fst", + ); +} + +#[test] +fn diff_icarus_test1() { + run_diff_test("inputs/icarus/test1.vcd", "inputs/icarus/test1.vcd.fst"); +} + #[test] fn diff_treadle_gcd() { run_diff_test("inputs/treadle/GCD.vcd", "inputs/treadle/GCD.vcd.fst");