add a simulator #3

Merged
programmerjake merged 58 commits from adding-simulator into master 2024-12-16 04:06:48 +00:00
Showing only changes of commit 9654167ca3 - Show all commits

View file

@ -1215,10 +1215,16 @@ struct Register {
}
#[derive(Debug)]
enum MemoryPort {
ReadOnly {},
WriteOnly {},
ReadWrite {},
struct MemoryPort {
clk_triggered: StatePartIndex<StatePartKindSmallSlots>,
addr_delayed: Vec<StatePartIndex<StatePartKindSmallSlots>>,
en_delayed: Vec<StatePartIndex<StatePartKindSmallSlots>>,
data: CompiledValue<CanonicalType>,
read_data_delayed: Vec<TypeIndex>,
write_data_delayed: Vec<TypeIndex>,
write_mask_delayed: Vec<TypeIndex>,
write_mode_delayed: Vec<StatePartIndex<StatePartKindSmallSlots>>,
}
#[derive(Debug)]
@ -3350,11 +3356,37 @@ impl Compiler {
};
self.decl_conditions.insert(target, conditions);
trace_decls.push(self.make_trace_decl(instantiated_module, target_base));
todo!("handle read/write");
match port.port_kind() {
PortKind::ReadOnly => MemoryPort::ReadOnly {},
PortKind::WriteOnly => MemoryPort::WriteOnly {},
PortKind::ReadWrite => MemoryPort::ReadWrite {},
PortKind::ReadOnly => MemoryPort {
clk_triggered: todo!(),
addr_delayed: todo!(),
en_delayed: todo!(),
data: todo!(),
read_data_delayed: todo!(),
write_data_delayed: todo!(),
write_mask_delayed: todo!(),
write_mode_delayed: todo!(),
},
PortKind::WriteOnly => MemoryPort {
clk_triggered: todo!(),
addr_delayed: todo!(),
en_delayed: todo!(),
data: todo!(),
read_data_delayed: todo!(),
write_data_delayed: todo!(),
write_mask_delayed: todo!(),
write_mode_delayed: todo!(),
},
PortKind::ReadWrite => MemoryPort {
clk_triggered: todo!(),
addr_delayed: todo!(),
en_delayed: todo!(),
data: todo!(),
read_data_delayed: todo!(),
write_data_delayed: todo!(),
write_mask_delayed: todo!(),
write_mode_delayed: todo!(),
},
}
})
.collect();