fayalite/crates/fayalite/tests/sim/expected/sim_fork_join.txt
Jacob Lifshay c11a1743f9
All checks were successful
/ test (pull_request) Successful in 4m51s
/ test (push) Successful in 5m29s
add sim.fork_join() and fix Simulator to handle running futures with arbitrary wakers
2025-10-30 21:16:05 -07:00

523 lines
No EOL
17 KiB
Text

Simulation {
state: State {
insns: Insns {
state_layout: StateLayout {
ty: TypeLayout {
small_slots: StatePartLayout<SmallSlots> {
len: 0,
debug_data: [],
..
},
big_slots: StatePartLayout<BigSlots> {
len: 6,
debug_data: [
SlotDebugData {
name: "InstantiatedModule(sim_fork_join: sim_fork_join).sim_fork_join::clocks[0]",
ty: Clock,
},
SlotDebugData {
name: "InstantiatedModule(sim_fork_join: sim_fork_join).sim_fork_join::clocks[1]",
ty: Clock,
},
SlotDebugData {
name: "InstantiatedModule(sim_fork_join: sim_fork_join).sim_fork_join::clocks[2]",
ty: Clock,
},
SlotDebugData {
name: "InstantiatedModule(sim_fork_join: sim_fork_join).sim_fork_join::outputs[0]",
ty: UInt<8>,
},
SlotDebugData {
name: "InstantiatedModule(sim_fork_join: sim_fork_join).sim_fork_join::outputs[1]",
ty: UInt<8>,
},
SlotDebugData {
name: "InstantiatedModule(sim_fork_join: sim_fork_join).sim_fork_join::outputs[2]",
ty: UInt<8>,
},
],
..
},
sim_only_slots: StatePartLayout<SimOnlySlots> {
len: 0,
debug_data: [],
layout_data: [],
..
},
},
memories: StatePartLayout<Memories> {
len: 0,
debug_data: [],
layout_data: [],
..
},
},
insns: [
// at: module-XXXXXXXXXX.rs:1:1
0: Return,
],
..
},
pc: 0,
memory_write_log: [],
memories: StatePart {
value: [],
},
small_slots: StatePart {
value: [],
},
big_slots: StatePart {
value: [
0,
0,
0,
49,
50,
50,
],
},
sim_only_slots: StatePart {
value: [],
},
},
io: Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
},
main_module: SimulationModuleState {
base_targets: [
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.clocks,
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.outputs,
],
uninitialized_ios: {},
io_targets: {
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.clocks,
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.clocks[0],
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.clocks[1],
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.clocks[2],
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.outputs,
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.outputs[0],
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.outputs[1],
Instance {
name: <simulator>::sim_fork_join,
instantiated: Module {
name: sim_fork_join,
..
},
}.outputs[2],
},
did_initial_settle: true,
},
extern_modules: [
SimulationExternModuleState {
module_state: SimulationModuleState {
base_targets: [
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
},
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
},
],
uninitialized_ios: {},
io_targets: {
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
},
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
}[0],
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
}[1],
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
}[2],
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
},
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
}[0],
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
}[1],
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
}[2],
},
did_initial_settle: true,
},
sim: ExternModuleSimulation {
generator: SimGeneratorFn {
args: (
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
},
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
},
),
f: ...,
},
sim_io_to_generator_map: {
ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
}: ModuleIO {
name: sim_fork_join::clocks,
is_input: true,
ty: Array<Clock, 3>,
..
},
ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
}: ModuleIO {
name: sim_fork_join::outputs,
is_input: false,
ty: Array<UInt<8>, 3>,
..
},
},
source_location: SourceLocation(
module-XXXXXXXXXX.rs:4:1,
),
},
running_generator: Some(
...,
),
},
],
trace_decls: TraceModule {
name: "sim_fork_join",
children: [
TraceModuleIO {
name: "clocks",
child: TraceArray {
name: "clocks",
elements: [
TraceClock {
location: TraceScalarId(0),
name: "[0]",
flow: Source,
},
TraceClock {
location: TraceScalarId(1),
name: "[1]",
flow: Source,
},
TraceClock {
location: TraceScalarId(2),
name: "[2]",
flow: Source,
},
],
ty: Array<Clock, 3>,
flow: Source,
},
ty: Array<Clock, 3>,
flow: Source,
},
TraceModuleIO {
name: "outputs",
child: TraceArray {
name: "outputs",
elements: [
TraceUInt {
location: TraceScalarId(3),
name: "[0]",
ty: UInt<8>,
flow: Sink,
},
TraceUInt {
location: TraceScalarId(4),
name: "[1]",
ty: UInt<8>,
flow: Sink,
},
TraceUInt {
location: TraceScalarId(5),
name: "[2]",
ty: UInt<8>,
flow: Sink,
},
],
ty: Array<UInt<8>, 3>,
flow: Sink,
},
ty: Array<UInt<8>, 3>,
flow: Sink,
},
],
},
traces: [
SimTrace {
id: TraceScalarId(0),
kind: BigClock {
index: StatePartIndex<BigSlots>(0),
},
state: 0x0,
last_state: 0x0,
},
SimTrace {
id: TraceScalarId(1),
kind: BigClock {
index: StatePartIndex<BigSlots>(1),
},
state: 0x0,
last_state: 0x0,
},
SimTrace {
id: TraceScalarId(2),
kind: BigClock {
index: StatePartIndex<BigSlots>(2),
},
state: 0x0,
last_state: 0x1,
},
SimTrace {
id: TraceScalarId(3),
kind: BigUInt {
index: StatePartIndex<BigSlots>(3),
ty: UInt<8>,
},
state: 0x31,
last_state: 0x31,
},
SimTrace {
id: TraceScalarId(4),
kind: BigUInt {
index: StatePartIndex<BigSlots>(4),
ty: UInt<8>,
},
state: 0x32,
last_state: 0x32,
},
SimTrace {
id: TraceScalarId(5),
kind: BigUInt {
index: StatePartIndex<BigSlots>(5),
ty: UInt<8>,
},
state: 0x32,
last_state: 0x32,
},
],
trace_memories: {},
trace_writers: [
Running(
VcdWriter {
finished_init: true,
timescale: 1 ps,
..
},
),
],
clocks_triggered: [],
event_queue: EventQueue(EventQueueData {
instant: 648 μs,
events: {},
}),
waiting_sensitivity_sets_by_address: {
SensitivitySet {
id: 198,
values: {
CompiledValue {
layout: CompiledTypeLayout {
ty: Clock,
layout: TypeLayout {
small_slots: StatePartLayout<SmallSlots> {
len: 0,
debug_data: [],
..
},
big_slots: StatePartLayout<BigSlots> {
len: 1,
debug_data: [
SlotDebugData {
name: "",
ty: Clock,
},
],
..
},
sim_only_slots: StatePartLayout<SimOnlySlots> {
len: 0,
debug_data: [],
layout_data: [],
..
},
},
body: Scalar,
},
range: TypeIndexRange {
small_slots: StatePartIndexRange<SmallSlots> { start: 0, len: 0 },
big_slots: StatePartIndexRange<BigSlots> { start: 0, len: 1 },
sim_only_slots: StatePartIndexRange<SimOnlySlots> { start: 0, len: 0 },
},
write: None,
}: SimValue {
ty: Clock,
value: OpaqueSimValue {
bits: 0x0_u1,
sim_only_values: [],
},
},
},
changed: Cell {
value: false,
},
..
},
},
waiting_sensitivity_sets_by_compiled_value: {
CompiledValue {
layout: CompiledTypeLayout {
ty: Clock,
layout: TypeLayout {
small_slots: StatePartLayout<SmallSlots> {
len: 0,
debug_data: [],
..
},
big_slots: StatePartLayout<BigSlots> {
len: 1,
debug_data: [
SlotDebugData {
name: "",
ty: Clock,
},
],
..
},
sim_only_slots: StatePartLayout<SimOnlySlots> {
len: 0,
debug_data: [],
layout_data: [],
..
},
},
body: Scalar,
},
range: TypeIndexRange {
small_slots: StatePartIndexRange<SmallSlots> { start: 0, len: 0 },
big_slots: StatePartIndexRange<BigSlots> { start: 0, len: 1 },
sim_only_slots: StatePartIndexRange<SimOnlySlots> { start: 0, len: 0 },
},
write: None,
}: (
SimValue {
ty: Clock,
value: OpaqueSimValue {
bits: 0x0_u1,
sim_only_values: [],
},
},
{
SensitivitySet {
id: 198,
..
},
},
),
},
..
}