From 8616ee47370d24e43b96995cb10246fcae687fdd Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 11 Dec 2024 00:01:04 -0800 Subject: [PATCH] tests/sim: test_enums works! --- crates/fayalite/tests/sim.rs | 1 - crates/fayalite/tests/sim/expected/enums.txt | 1639 ++++++++++++++++++ crates/fayalite/tests/sim/expected/enums.vcd | 94 + 3 files changed, 1733 insertions(+), 1 deletion(-) diff --git a/crates/fayalite/tests/sim.rs b/crates/fayalite/tests/sim.rs index db20df2..a8b23f2 100644 --- a/crates/fayalite/tests/sim.rs +++ b/crates/fayalite/tests/sim.rs @@ -363,7 +363,6 @@ pub fn enums() { } } -#[cfg(todo)] // FIXME: enum lowering currently broken #[hdl] #[test] fn test_enums() { diff --git a/crates/fayalite/tests/sim/expected/enums.txt b/crates/fayalite/tests/sim/expected/enums.txt index e69de29..69c94dd 100644 --- a/crates/fayalite/tests/sim/expected/enums.txt +++ b/crates/fayalite/tests/sim/expected/enums.txt @@ -0,0 +1,1639 @@ +Simulation { + state: State { + insns: Insns { + state_layout: StateLayout { + ty: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 5, + debug_data: [ + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: Enum { + A, + B, + C, + }, + }, + ], + .. + }, + big_slots: StatePartAllocationLayout { + len: 82, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::cd.clk", + ty: Clock, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::cd.rst", + ty: SyncReset, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::en", + ty: Bool, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::which_in", + ty: UInt<2>, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::data_in", + ty: UInt<4>, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::which_out", + ty: UInt<2>, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::data_out", + ty: UInt<4>, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::the_reg", + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::the_reg$next", + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + SlotDebugData { + name: "", + ty: UInt<6>, + }, + SlotDebugData { + name: "", + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + SlotDebugData { + name: ".0", + ty: UInt<1>, + }, + SlotDebugData { + name: ".1", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: UInt<6>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: ".a[0]", + ty: UInt<1>, + }, + SlotDebugData { + name: ".a[1]", + ty: UInt<1>, + }, + SlotDebugData { + name: ".b", + ty: SInt<2>, + }, + SlotDebugData { + name: "[0]", + ty: UInt<1>, + }, + SlotDebugData { + name: "[1]", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: SInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: ".0", + ty: UInt<2>, + }, + SlotDebugData { + name: ".1.0", + ty: UInt<1>, + }, + SlotDebugData { + name: ".1.1", + ty: Bool, + }, + SlotDebugData { + name: ".0", + ty: UInt<1>, + }, + SlotDebugData { + name: ".1", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: Bool, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<6>, + }, + SlotDebugData { + name: "", + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + SlotDebugData { + name: ".0", + ty: UInt<2>, + }, + SlotDebugData { + name: ".1.a[0]", + ty: UInt<1>, + }, + SlotDebugData { + name: ".1.a[1]", + ty: UInt<1>, + }, + SlotDebugData { + name: ".1.b", + ty: SInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: ".a[0]", + ty: UInt<1>, + }, + SlotDebugData { + name: ".a[1]", + ty: UInt<1>, + }, + SlotDebugData { + name: ".b", + ty: SInt<2>, + }, + SlotDebugData { + name: "[0]", + ty: UInt<1>, + }, + SlotDebugData { + name: "[1]", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: SInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<6>, + }, + SlotDebugData { + name: "", + ty: UInt<6>, + }, + SlotDebugData { + name: "", + ty: UInt<6>, + }, + SlotDebugData { + name: "", + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<1>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<2>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + SlotDebugData { + name: "", + ty: UInt<4>, + }, + ], + .. + }, + }, + memories: StatePartAllocationLayout { + len: 0, + debug_data: [], + layout_data: [], + .. + }, + }, + insns: [ + // at: module-XXXXXXXXXX.rs:1:1 + Const { + dest: StatePartIndex(72), // SlotDebugData { name: "", ty: UInt<4> }, + value: 0, + }, + SliceInt { + dest: StatePartIndex(61), // SlotDebugData { name: "", ty: UInt<2> }, + src: StatePartIndex(4), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::data_in", ty: UInt<4> }, + start: 2, + len: 2, + }, + CastToSInt { + dest: StatePartIndex(62), // SlotDebugData { name: "", ty: SInt<2> }, + src: StatePartIndex(61), // SlotDebugData { name: "", ty: UInt<2> }, + dest_width: 2, + }, + Const { + dest: StatePartIndex(54), // SlotDebugData { name: "", ty: UInt<2> }, + value: 2, + }, + SliceInt { + dest: StatePartIndex(41), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(4), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::data_in", ty: UInt<4> }, + start: 1, + len: 1, + }, + Copy { + dest: StatePartIndex(42), // SlotDebugData { name: "", ty: Bool }, + src: StatePartIndex(41), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(60), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(42), // SlotDebugData { name: "", ty: Bool }, + }, + SliceInt { + dest: StatePartIndex(38), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(4), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::data_in", ty: UInt<4> }, + start: 0, + len: 1, + }, + Copy { + dest: StatePartIndex(39), // SlotDebugData { name: "", ty: Bool }, + src: StatePartIndex(38), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(40), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(39), // SlotDebugData { name: "", ty: Bool }, + }, + Copy { + dest: StatePartIndex(36), // SlotDebugData { name: ".0", ty: UInt<1> }, + src: StatePartIndex(40), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(37), // SlotDebugData { name: ".1", ty: Bool }, + src: StatePartIndex(42), // SlotDebugData { name: "", ty: Bool }, + }, + Copy { + dest: StatePartIndex(58), // SlotDebugData { name: "[0]", ty: UInt<1> }, + src: StatePartIndex(40), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(59), // SlotDebugData { name: "[1]", ty: UInt<1> }, + src: StatePartIndex(60), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(55), // SlotDebugData { name: ".a[0]", ty: UInt<1> }, + src: StatePartIndex(58), // SlotDebugData { name: "[0]", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(56), // SlotDebugData { name: ".a[1]", ty: UInt<1> }, + src: StatePartIndex(59), // SlotDebugData { name: "[1]", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(57), // SlotDebugData { name: ".b", ty: SInt<2> }, + src: StatePartIndex(62), // SlotDebugData { name: "", ty: SInt<2> }, + }, + Copy { + dest: StatePartIndex(50), // SlotDebugData { name: ".0", ty: UInt<2> }, + src: StatePartIndex(54), // SlotDebugData { name: "", ty: UInt<2> }, + }, + Copy { + dest: StatePartIndex(51), // SlotDebugData { name: ".1.a[0]", ty: UInt<1> }, + src: StatePartIndex(55), // SlotDebugData { name: ".a[0]", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(52), // SlotDebugData { name: ".1.a[1]", ty: UInt<1> }, + src: StatePartIndex(56), // SlotDebugData { name: ".a[1]", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(53), // SlotDebugData { name: ".1.b", ty: SInt<2> }, + src: StatePartIndex(57), // SlotDebugData { name: ".b", ty: SInt<2> }, + }, + Shl { + dest: StatePartIndex(63), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(52), // SlotDebugData { name: ".1.a[1]", ty: UInt<1> }, + rhs: 1, + }, + Or { + dest: StatePartIndex(64), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(51), // SlotDebugData { name: ".1.a[0]", ty: UInt<1> }, + rhs: StatePartIndex(63), // SlotDebugData { name: "", ty: UInt<2> }, + }, + CastToUInt { + dest: StatePartIndex(65), // SlotDebugData { name: "", ty: UInt<2> }, + src: StatePartIndex(53), // SlotDebugData { name: ".1.b", ty: SInt<2> }, + dest_width: 2, + }, + Shl { + dest: StatePartIndex(66), // SlotDebugData { name: "", ty: UInt<4> }, + lhs: StatePartIndex(65), // SlotDebugData { name: "", ty: UInt<2> }, + rhs: 2, + }, + Or { + dest: StatePartIndex(67), // SlotDebugData { name: "", ty: UInt<4> }, + lhs: StatePartIndex(64), // SlotDebugData { name: "", ty: UInt<2> }, + rhs: StatePartIndex(66), // SlotDebugData { name: "", ty: UInt<4> }, + }, + Shl { + dest: StatePartIndex(68), // SlotDebugData { name: "", ty: UInt<6> }, + lhs: StatePartIndex(67), // SlotDebugData { name: "", ty: UInt<4> }, + rhs: 2, + }, + Or { + dest: StatePartIndex(69), // SlotDebugData { name: "", ty: UInt<6> }, + lhs: StatePartIndex(50), // SlotDebugData { name: ".0", ty: UInt<2> }, + rhs: StatePartIndex(68), // SlotDebugData { name: "", ty: UInt<6> }, + }, + CastToUInt { + dest: StatePartIndex(70), // SlotDebugData { name: "", ty: UInt<6> }, + src: StatePartIndex(69), // SlotDebugData { name: "", ty: UInt<6> }, + dest_width: 6, + }, + Copy { + dest: StatePartIndex(71), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(70), // SlotDebugData { name: "", ty: UInt<6> }, + }, + Const { + dest: StatePartIndex(31), // SlotDebugData { name: "", ty: UInt<2> }, + value: 1, + }, + CmpEq { + dest: StatePartIndex(32), // SlotDebugData { name: "", ty: Bool }, + lhs: StatePartIndex(3), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::which_in", ty: UInt<2> }, + rhs: StatePartIndex(31), // SlotDebugData { name: "", ty: UInt<2> }, + }, + Copy { + dest: StatePartIndex(33), // SlotDebugData { name: ".0", ty: UInt<2> }, + src: StatePartIndex(31), // SlotDebugData { name: "", ty: UInt<2> }, + }, + Copy { + dest: StatePartIndex(34), // SlotDebugData { name: ".1.0", ty: UInt<1> }, + src: StatePartIndex(36), // SlotDebugData { name: ".0", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(35), // SlotDebugData { name: ".1.1", ty: Bool }, + src: StatePartIndex(37), // SlotDebugData { name: ".1", ty: Bool }, + }, + Copy { + dest: StatePartIndex(43), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(35), // SlotDebugData { name: ".1.1", ty: Bool }, + }, + Shl { + dest: StatePartIndex(44), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(43), // SlotDebugData { name: "", ty: UInt<1> }, + rhs: 1, + }, + Or { + dest: StatePartIndex(45), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(34), // SlotDebugData { name: ".1.0", ty: UInt<1> }, + rhs: StatePartIndex(44), // SlotDebugData { name: "", ty: UInt<2> }, + }, + Shl { + dest: StatePartIndex(46), // SlotDebugData { name: "", ty: UInt<4> }, + lhs: StatePartIndex(45), // SlotDebugData { name: "", ty: UInt<2> }, + rhs: 2, + }, + Or { + dest: StatePartIndex(47), // SlotDebugData { name: "", ty: UInt<4> }, + lhs: StatePartIndex(33), // SlotDebugData { name: ".0", ty: UInt<2> }, + rhs: StatePartIndex(46), // SlotDebugData { name: "", ty: UInt<4> }, + }, + CastToUInt { + dest: StatePartIndex(48), // SlotDebugData { name: "", ty: UInt<6> }, + src: StatePartIndex(47), // SlotDebugData { name: "", ty: UInt<4> }, + dest_width: 6, + }, + Copy { + dest: StatePartIndex(49), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(48), // SlotDebugData { name: "", ty: UInt<6> }, + }, + Const { + dest: StatePartIndex(29), // SlotDebugData { name: "", ty: UInt<2> }, + value: 0, + }, + CmpEq { + dest: StatePartIndex(30), // SlotDebugData { name: "", ty: Bool }, + lhs: StatePartIndex(3), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::which_in", ty: UInt<2> }, + rhs: StatePartIndex(29), // SlotDebugData { name: "", ty: UInt<2> }, + }, + Copy { + dest: StatePartIndex(13), // SlotDebugData { name: "", ty: UInt<6> }, + src: StatePartIndex(7), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + }, + SliceInt { + dest: StatePartIndex(14), // SlotDebugData { name: "", ty: UInt<2> }, + src: StatePartIndex(13), // SlotDebugData { name: "", ty: UInt<6> }, + start: 2, + len: 2, + }, + SliceInt { + dest: StatePartIndex(15), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(14), // SlotDebugData { name: "", ty: UInt<2> }, + start: 0, + len: 1, + }, + SliceInt { + dest: StatePartIndex(16), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(14), // SlotDebugData { name: "", ty: UInt<2> }, + start: 1, + len: 1, + }, + Copy { + dest: StatePartIndex(17), // SlotDebugData { name: "", ty: Bool }, + src: StatePartIndex(16), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(11), // SlotDebugData { name: ".0", ty: UInt<1> }, + src: StatePartIndex(15), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(12), // SlotDebugData { name: ".1", ty: Bool }, + src: StatePartIndex(17), // SlotDebugData { name: "", ty: Bool }, + }, + Copy { + dest: StatePartIndex(73), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(12), // SlotDebugData { name: ".1", ty: Bool }, + }, + Shl { + dest: StatePartIndex(74), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(73), // SlotDebugData { name: "", ty: UInt<1> }, + rhs: 1, + }, + Or { + dest: StatePartIndex(75), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(11), // SlotDebugData { name: ".0", ty: UInt<1> }, + rhs: StatePartIndex(74), // SlotDebugData { name: "", ty: UInt<2> }, + }, + CastToUInt { + dest: StatePartIndex(76), // SlotDebugData { name: "", ty: UInt<4> }, + src: StatePartIndex(75), // SlotDebugData { name: "", ty: UInt<2> }, + dest_width: 4, + }, + SliceInt { + dest: StatePartIndex(23), // SlotDebugData { name: "", ty: UInt<4> }, + src: StatePartIndex(13), // SlotDebugData { name: "", ty: UInt<6> }, + start: 2, + len: 4, + }, + SliceInt { + dest: StatePartIndex(24), // SlotDebugData { name: "", ty: UInt<2> }, + src: StatePartIndex(23), // SlotDebugData { name: "", ty: UInt<4> }, + start: 0, + len: 2, + }, + SliceInt { + dest: StatePartIndex(25), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(24), // SlotDebugData { name: "", ty: UInt<2> }, + start: 0, + len: 1, + }, + SliceInt { + dest: StatePartIndex(26), // SlotDebugData { name: "", ty: UInt<1> }, + src: StatePartIndex(24), // SlotDebugData { name: "", ty: UInt<2> }, + start: 1, + len: 1, + }, + Copy { + dest: StatePartIndex(21), // SlotDebugData { name: "[0]", ty: UInt<1> }, + src: StatePartIndex(25), // SlotDebugData { name: "", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(22), // SlotDebugData { name: "[1]", ty: UInt<1> }, + src: StatePartIndex(26), // SlotDebugData { name: "", ty: UInt<1> }, + }, + SliceInt { + dest: StatePartIndex(27), // SlotDebugData { name: "", ty: UInt<2> }, + src: StatePartIndex(23), // SlotDebugData { name: "", ty: UInt<4> }, + start: 2, + len: 2, + }, + CastToSInt { + dest: StatePartIndex(28), // SlotDebugData { name: "", ty: SInt<2> }, + src: StatePartIndex(27), // SlotDebugData { name: "", ty: UInt<2> }, + dest_width: 2, + }, + Copy { + dest: StatePartIndex(18), // SlotDebugData { name: ".a[0]", ty: UInt<1> }, + src: StatePartIndex(21), // SlotDebugData { name: "[0]", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(19), // SlotDebugData { name: ".a[1]", ty: UInt<1> }, + src: StatePartIndex(22), // SlotDebugData { name: "[1]", ty: UInt<1> }, + }, + Copy { + dest: StatePartIndex(20), // SlotDebugData { name: ".b", ty: SInt<2> }, + src: StatePartIndex(28), // SlotDebugData { name: "", ty: SInt<2> }, + }, + Shl { + dest: StatePartIndex(77), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(19), // SlotDebugData { name: ".a[1]", ty: UInt<1> }, + rhs: 1, + }, + Or { + dest: StatePartIndex(78), // SlotDebugData { name: "", ty: UInt<2> }, + lhs: StatePartIndex(18), // SlotDebugData { name: ".a[0]", ty: UInt<1> }, + rhs: StatePartIndex(77), // SlotDebugData { name: "", ty: UInt<2> }, + }, + CastToUInt { + dest: StatePartIndex(79), // SlotDebugData { name: "", ty: UInt<2> }, + src: StatePartIndex(20), // SlotDebugData { name: ".b", ty: SInt<2> }, + dest_width: 2, + }, + Shl { + dest: StatePartIndex(80), // SlotDebugData { name: "", ty: UInt<4> }, + lhs: StatePartIndex(79), // SlotDebugData { name: "", ty: UInt<2> }, + rhs: 2, + }, + Or { + dest: StatePartIndex(81), // SlotDebugData { name: "", ty: UInt<4> }, + lhs: StatePartIndex(78), // SlotDebugData { name: "", ty: UInt<2> }, + rhs: StatePartIndex(80), // SlotDebugData { name: "", ty: UInt<4> }, + }, + // at: module-XXXXXXXXXX.rs:8:1 + AndBigWithSmallImmediate { + dest: StatePartIndex(4), // SlotDebugData { name: "", ty: Enum {A, B, C} }, + lhs: StatePartIndex(7), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + rhs: 3, + }, + // at: module-XXXXXXXXXX.rs:15:1 + BranchIfSmallNeImmediate { + target: 75, + lhs: StatePartIndex(4), // SlotDebugData { name: "", ty: Enum {A, B, C} }, + rhs: 0, + }, + // at: module-XXXXXXXXXX.rs:16:1 + Copy { + dest: StatePartIndex(5), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::which_out", ty: UInt<2> }, + src: StatePartIndex(29), // SlotDebugData { name: "", ty: UInt<2> }, + }, + // at: module-XXXXXXXXXX.rs:17:1 + Copy { + dest: StatePartIndex(6), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::data_out", ty: UInt<4> }, + src: StatePartIndex(72), // SlotDebugData { name: "", ty: UInt<4> }, + }, + // at: module-XXXXXXXXXX.rs:15:1 + BranchIfSmallNeImmediate { + target: 78, + lhs: StatePartIndex(4), // SlotDebugData { name: "", ty: Enum {A, B, C} }, + rhs: 1, + }, + // at: module-XXXXXXXXXX.rs:18:1 + Copy { + dest: StatePartIndex(5), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::which_out", ty: UInt<2> }, + src: StatePartIndex(31), // SlotDebugData { name: "", ty: UInt<2> }, + }, + // at: module-XXXXXXXXXX.rs:19:1 + Copy { + dest: StatePartIndex(6), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::data_out", ty: UInt<4> }, + src: StatePartIndex(76), // SlotDebugData { name: "", ty: UInt<4> }, + }, + // at: module-XXXXXXXXXX.rs:15:1 + BranchIfSmallNeImmediate { + target: 81, + lhs: StatePartIndex(4), // SlotDebugData { name: "", ty: Enum {A, B, C} }, + rhs: 2, + }, + // at: module-XXXXXXXXXX.rs:20:1 + Copy { + dest: StatePartIndex(5), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::which_out", ty: UInt<2> }, + src: StatePartIndex(54), // SlotDebugData { name: "", ty: UInt<2> }, + }, + // at: module-XXXXXXXXXX.rs:21:1 + Copy { + dest: StatePartIndex(6), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::data_out", ty: UInt<4> }, + src: StatePartIndex(81), // SlotDebugData { name: "", ty: UInt<4> }, + }, + // at: module-XXXXXXXXXX.rs:8:1 + IsNonZeroDestIsSmall { + dest: StatePartIndex(3), // SlotDebugData { name: "", ty: Bool }, + src: StatePartIndex(1), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::cd.rst", ty: SyncReset }, + }, + // at: module-XXXXXXXXXX.rs:1:1 + Const { + dest: StatePartIndex(9), // SlotDebugData { name: "", ty: UInt<6> }, + value: 0, + }, + Copy { + dest: StatePartIndex(10), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(9), // SlotDebugData { name: "", ty: UInt<6> }, + }, + // at: module-XXXXXXXXXX.rs:9:1 + BranchIfZero { + target: 92, + value: StatePartIndex(2), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::en", ty: Bool }, + }, + // at: module-XXXXXXXXXX.rs:10:1 + BranchIfZero { + target: 87, + value: StatePartIndex(30), // SlotDebugData { name: "", ty: Bool }, + }, + // at: module-XXXXXXXXXX.rs:11:1 + Copy { + dest: StatePartIndex(8), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg$next", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(10), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + }, + // at: module-XXXXXXXXXX.rs:10:1 + BranchIfNonZero { + target: 92, + value: StatePartIndex(30), // SlotDebugData { name: "", ty: Bool }, + }, + // at: module-XXXXXXXXXX.rs:12:1 + BranchIfZero { + target: 90, + value: StatePartIndex(32), // SlotDebugData { name: "", ty: Bool }, + }, + // at: module-XXXXXXXXXX.rs:13:1 + Copy { + dest: StatePartIndex(8), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg$next", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(49), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + }, + // at: module-XXXXXXXXXX.rs:12:1 + BranchIfNonZero { + target: 92, + value: StatePartIndex(32), // SlotDebugData { name: "", ty: Bool }, + }, + // at: module-XXXXXXXXXX.rs:14:1 + Copy { + dest: StatePartIndex(8), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg$next", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(71), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + }, + // at: module-XXXXXXXXXX.rs:8:1 + IsNonZeroDestIsSmall { + dest: StatePartIndex(2), // SlotDebugData { name: "", ty: Bool }, + src: StatePartIndex(0), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::cd.clk", ty: Clock }, + }, + AndSmall { + dest: StatePartIndex(1), // SlotDebugData { name: "", ty: Bool }, + lhs: StatePartIndex(2), // SlotDebugData { name: "", ty: Bool }, + rhs: StatePartIndex(0), // SlotDebugData { name: "", ty: Bool }, + }, + BranchIfSmallZero { + target: 99, + value: StatePartIndex(1), // SlotDebugData { name: "", ty: Bool }, + }, + BranchIfSmallNonZero { + target: 98, + value: StatePartIndex(3), // SlotDebugData { name: "", ty: Bool }, + }, + Copy { + dest: StatePartIndex(7), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(8), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg$next", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + }, + Branch { + target: 99, + }, + Copy { + dest: StatePartIndex(7), // SlotDebugData { name: "InstantiatedModule(enums: enums).enums::the_reg", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + src: StatePartIndex(10), // SlotDebugData { name: "", ty: Enum {A, B(Bundle {0: UInt<1>, 1: Bool}), C(Bundle {a: Array, 2>, b: SInt<2>})} }, + }, + NotSmall { + dest: StatePartIndex(0), // SlotDebugData { name: "", ty: Bool }, + src: StatePartIndex(2), // SlotDebugData { name: "", ty: Bool }, + }, + // at: module-XXXXXXXXXX.rs:1:1 + Return, + ], + .. + }, + pc: 100, + memories: StatePart { + value: [], + }, + small_slots: StatePart { + value: [ + 18446744073709551614, + 0, + 1, + 0, + 2, + ], + }, + big_slots: StatePart { + value: [ + 1, + 0, + 1, + 2, + 15, + 2, + 15, + 62, + 62, + 0, + 0, + 1, + 1, + 62, + 3, + 1, + 1, + 1, + 1, + 1, + -1, + 1, + 1, + 15, + 3, + 1, + 1, + 3, + -1, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 3, + 12, + 13, + 13, + 13, + 2, + 1, + 1, + -1, + 2, + 1, + 1, + -1, + 1, + 1, + 1, + 3, + -1, + 2, + 3, + 3, + 12, + 15, + 60, + 62, + 62, + 62, + 0, + 1, + 2, + 3, + 3, + 2, + 3, + 3, + 12, + 15, + ], + }, + }, + io: Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }, + uninitialized_inputs: {}, + io_targets: { + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.cd: CompiledValue { + layout: CompiledTypeLayout { + ty: Bundle { + /* offset = 0 */ + clk: Clock, + /* offset = 1 */ + rst: SyncReset, + }, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 2, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::cd.clk", + ty: Clock, + }, + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::cd.rst", + ty: SyncReset, + }, + ], + .. + }, + }, + body: Bundle { + fields: [ + CompiledBundleField { + offset: TypeIndex { + small_slots: StatePartIndex(0), + big_slots: StatePartIndex(0), + }, + ty: CompiledTypeLayout { + ty: Clock, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "", + ty: Clock, + }, + ], + .. + }, + }, + body: Scalar, + }, + }, + CompiledBundleField { + offset: TypeIndex { + small_slots: StatePartIndex(0), + big_slots: StatePartIndex(1), + }, + ty: CompiledTypeLayout { + ty: SyncReset, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "", + ty: SyncReset, + }, + ], + .. + }, + }, + body: Scalar, + }, + }, + ], + }, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 0, len: 2 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.cd.clk: CompiledValue { + layout: CompiledTypeLayout { + ty: Clock, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "", + ty: Clock, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 0, len: 1 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.cd.rst: CompiledValue { + layout: CompiledTypeLayout { + ty: SyncReset, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "", + ty: SyncReset, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 1, len: 1 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.data_in: CompiledValue { + layout: CompiledTypeLayout { + ty: UInt<4>, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::data_in", + ty: UInt<4>, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 4, len: 1 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.data_out: CompiledValue { + layout: CompiledTypeLayout { + ty: UInt<4>, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::data_out", + ty: UInt<4>, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 6, len: 1 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.en: CompiledValue { + layout: CompiledTypeLayout { + ty: Bool, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::en", + ty: Bool, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 2, len: 1 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.which_in: CompiledValue { + layout: CompiledTypeLayout { + ty: UInt<2>, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::which_in", + ty: UInt<2>, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 3, len: 1 }, + }, + write: None, + }, + Instance { + name: ::enums, + instantiated: Module { + name: enums, + .. + }, + }.which_out: CompiledValue { + layout: CompiledTypeLayout { + ty: UInt<2>, + layout: TypeLayout { + small_slots: StatePartAllocationLayout { + len: 0, + debug_data: [], + .. + }, + big_slots: StatePartAllocationLayout { + len: 1, + debug_data: [ + SlotDebugData { + name: "InstantiatedModule(enums: enums).enums::which_out", + ty: UInt<2>, + }, + ], + .. + }, + }, + body: Scalar, + }, + range: TypeIndexRange { + small_slots: StatePartIndexRange { start: 0, len: 0 }, + big_slots: StatePartIndexRange { start: 5, len: 1 }, + }, + write: None, + }, + }, + made_initial_step: true, + needs_settle: false, + trace_decls: TraceModule { + name: "enums", + children: [ + TraceModuleIO { + name: "cd", + child: TraceBundle { + name: "cd", + fields: [ + TraceClock { + id: TraceScalarId(0), + name: "clk", + flow: Source, + }, + TraceSyncReset { + id: TraceScalarId(1), + name: "rst", + flow: Source, + }, + ], + ty: Bundle { + /* offset = 0 */ + clk: Clock, + /* offset = 1 */ + rst: SyncReset, + }, + flow: Source, + }, + ty: Bundle { + /* offset = 0 */ + clk: Clock, + /* offset = 1 */ + rst: SyncReset, + }, + flow: Source, + }, + TraceModuleIO { + name: "en", + child: TraceBool { + id: TraceScalarId(2), + name: "en", + flow: Source, + }, + ty: Bool, + flow: Source, + }, + TraceModuleIO { + name: "which_in", + child: TraceUInt { + id: TraceScalarId(3), + name: "which_in", + ty: UInt<2>, + flow: Source, + }, + ty: UInt<2>, + flow: Source, + }, + TraceModuleIO { + name: "data_in", + child: TraceUInt { + id: TraceScalarId(4), + name: "data_in", + ty: UInt<4>, + flow: Source, + }, + ty: UInt<4>, + flow: Source, + }, + TraceModuleIO { + name: "which_out", + child: TraceUInt { + id: TraceScalarId(5), + name: "which_out", + ty: UInt<2>, + flow: Sink, + }, + ty: UInt<2>, + flow: Sink, + }, + TraceModuleIO { + name: "data_out", + child: TraceUInt { + id: TraceScalarId(6), + name: "data_out", + ty: UInt<4>, + flow: Sink, + }, + ty: UInt<4>, + flow: Sink, + }, + TraceReg { + name: "the_reg", + child: TraceEnumWithFields { + name: "the_reg", + discriminant: TraceEnumDiscriminant { + id: TraceScalarId(7), + name: "$tag", + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + flow: Duplex, + }, + non_empty_fields: [ + TraceBundle { + name: "B", + fields: [ + TraceUInt { + id: TraceScalarId(8), + name: "0", + ty: UInt<1>, + flow: Source, + }, + TraceBool { + id: TraceScalarId(9), + name: "1", + flow: Source, + }, + ], + ty: Bundle { + /* offset = 0 */ + 0: UInt<1>, + /* offset = 1 */ + 1: Bool, + }, + flow: Source, + }, + TraceBundle { + name: "C", + fields: [ + TraceArray { + name: "a", + elements: [ + TraceUInt { + id: TraceScalarId(10), + name: "[0]", + ty: UInt<1>, + flow: Source, + }, + TraceUInt { + id: TraceScalarId(11), + name: "[1]", + ty: UInt<1>, + flow: Source, + }, + ], + ty: Array, 2>, + flow: Source, + }, + TraceSInt { + id: TraceScalarId(12), + name: "b", + ty: SInt<2>, + flow: Source, + }, + ], + ty: Bundle { + /* offset = 0 */ + a: Array, 2>, + /* offset = 2 */ + b: SInt<2>, + }, + flow: Source, + }, + ], + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + flow: Duplex, + }, + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + ], + }, + traces: [ + SimTrace { + id: TraceScalarId(0), + kind: BigClock { + index: StatePartIndex(0), + }, + state: 0x1, + last_state: 0x1, + }, + SimTrace { + id: TraceScalarId(1), + kind: BigSyncReset { + index: StatePartIndex(1), + }, + state: 0x0, + last_state: 0x0, + }, + SimTrace { + id: TraceScalarId(2), + kind: BigBool { + index: StatePartIndex(2), + }, + state: 0x1, + last_state: 0x1, + }, + SimTrace { + id: TraceScalarId(3), + kind: BigUInt { + index: StatePartIndex(3), + ty: UInt<2>, + }, + state: 0x2, + last_state: 0x2, + }, + SimTrace { + id: TraceScalarId(4), + kind: BigUInt { + index: StatePartIndex(4), + ty: UInt<4>, + }, + state: 0xf, + last_state: 0xf, + }, + SimTrace { + id: TraceScalarId(5), + kind: BigUInt { + index: StatePartIndex(5), + ty: UInt<2>, + }, + state: 0x2, + last_state: 0x2, + }, + SimTrace { + id: TraceScalarId(6), + kind: BigUInt { + index: StatePartIndex(6), + ty: UInt<4>, + }, + state: 0xf, + last_state: 0xf, + }, + SimTrace { + id: TraceScalarId(7), + kind: EnumDiscriminant { + index: StatePartIndex(4), + ty: Enum { + A, + B(Bundle {0: UInt<1>, 1: Bool}), + C(Bundle {a: Array, 2>, b: SInt<2>}), + }, + }, + state: 0x2, + last_state: 0x2, + }, + SimTrace { + id: TraceScalarId(8), + kind: BigUInt { + index: StatePartIndex(11), + ty: UInt<1>, + }, + state: 0x1, + last_state: 0x1, + }, + SimTrace { + id: TraceScalarId(9), + kind: BigBool { + index: StatePartIndex(12), + }, + state: 0x1, + last_state: 0x1, + }, + SimTrace { + id: TraceScalarId(10), + kind: BigUInt { + index: StatePartIndex(18), + ty: UInt<1>, + }, + state: 0x1, + last_state: 0x1, + }, + SimTrace { + id: TraceScalarId(11), + kind: BigUInt { + index: StatePartIndex(19), + ty: UInt<1>, + }, + state: 0x1, + last_state: 0x1, + }, + SimTrace { + id: TraceScalarId(12), + kind: BigSInt { + index: StatePartIndex(20), + ty: SInt<2>, + }, + state: 0x3, + last_state: 0x3, + }, + ], + trace_writers: [ + Running( + VcdWriter { + finished_init: true, + timescale: 1 ps, + .. + }, + ), + ], + instant: 16 μs, + clocks_triggered: [ + StatePartIndex(1), + ], +} \ No newline at end of file diff --git a/crates/fayalite/tests/sim/expected/enums.vcd b/crates/fayalite/tests/sim/expected/enums.vcd index e69de29..48a493b 100644 --- a/crates/fayalite/tests/sim/expected/enums.vcd +++ b/crates/fayalite/tests/sim/expected/enums.vcd @@ -0,0 +1,94 @@ +$timescale 1 ps $end +$scope module enums $end +$scope struct cd $end +$var wire 1 ! clk $end +$var wire 1 " rst $end +$upscope $end +$var wire 1 # en $end +$var wire 2 $ which_in $end +$var wire 4 % data_in $end +$var wire 2 & which_out $end +$var wire 4 ' data_out $end +$scope struct the_reg $end +$var string 1 ( \$tag $end +$scope struct B $end +$var reg 1 ) \0 $end +$var reg 1 * \1 $end +$upscope $end +$scope struct C $end +$scope struct a $end +$var reg 1 + \[0] $end +$var reg 1 , \[1] $end +$upscope $end +$var reg 2 - b $end +$upscope $end +$upscope $end +$upscope $end +$enddefinitions $end +$dumpvars +0! +1" +0# +b0 $ +b0 % +b0 & +b0 ' +sA\x20(0) ( +0) +0* +0+ +0, +b0 - +$end +#1000000 +1! +#1100000 +0" +#2000000 +0! +#3000000 +1! +#4000000 +1# +b1 $ +0! +#5000000 +1! +b1 & +sB\x20(1) ( +#6000000 +0# +b0 $ +0! +#7000000 +1! +#8000000 +1# +b1 $ +b1111 % +0! +#9000000 +1! +b11 ' +1) +1* +1+ +1, +#10000000 +0! +#11000000 +1! +#12000000 +b10 $ +0! +#13000000 +1! +b10 & +b1111 ' +sC\x20(2) ( +b11 - +#14000000 +0! +#15000000 +1! +#16000000