Skip to content

Commit

Permalink
[tui] refactor emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed May 13, 2024
1 parent 05ff2ac commit 3fa52be
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/emulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl MemInfo {

impl fmt::Display for MemInfo {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "wen: {}, waddr: {:#x}, wdata: {:#x}", self.wen, self.addr, self.data)
write!(f, "waddr: {:#x}, wdata: {:#x}", self.addr, self.data)
}
}

Expand Down Expand Up @@ -356,12 +356,16 @@ impl Emulator {

// trace ui mtrace
if let Some(cpu_diff) = cpu_diff {
self.ui.selected_tab.trace.mtrace[0].push(cpu_diff.mem.to_string());
if cpu_diff.mem.wen {
self.ui.selected_tab.trace.mtrace[0].push(format!("pc: {:#010x}, {}", self.cpu.pc, cpu_diff.mem.to_string()));
}
}

// trace ui mtrace
if let Some(dut_diff) = dut_diff {
self.ui.selected_tab.trace.mtrace[1].push(dut_diff.mem.to_string());
if dut_diff.mem.wen {
self.ui.selected_tab.trace.mtrace[1].push(format!("pc: {:#010x}, {}", self.cpu.pc, dut_diff.mem.to_string()));
}
}
}

Expand Down

0 comments on commit 3fa52be

Please sign in to comment.