From e311366e8f6ee9aaa2bb0caccac58060a528468b Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Sun, 26 May 2024 22:33:34 +0200 Subject: [PATCH] ipod4g: Log originating core for memory requests Helps understanding whether some memory requests originate from CPU or COP. --- clicky-core/src/devices/platform/pp.rs | 9 +++++++++ clicky-core/src/sys/ipod4g/mod.rs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/clicky-core/src/devices/platform/pp.rs b/clicky-core/src/devices/platform/pp.rs index 1ef96a7..b33fd6d 100644 --- a/clicky-core/src/devices/platform/pp.rs +++ b/clicky-core/src/devices/platform/pp.rs @@ -48,4 +48,13 @@ pub mod common { Cpu, Cop, } + + impl std::fmt::Display for CpuId { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + CpuId::Cpu => write!(f, "CPU"), + CpuId::Cop => write!(f, "COP"), + } + } + } } diff --git a/clicky-core/src/sys/ipod4g/mod.rs b/clicky-core/src/sys/ipod4g/mod.rs index 2b43fab..4478b7c 100644 --- a/clicky-core/src/sys/ipod4g/mod.rs +++ b/clicky-core/src/sys/ipod4g/mod.rs @@ -195,7 +195,7 @@ impl Ipod4g { MemExceptionCtx { pc: cpu.reg_get(cpu.mode(), reg::PC), access, - in_device: format!("{}", devices.probe(access.offset)), + in_device: format!("{}, {}", cpuid, devices.probe(access.offset)), }, )?; }