diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/simulator.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/simulator.rs b/src/simulator.rs index dd851e5..c1a300d 100644 --- a/src/simulator.rs +++ b/src/simulator.rs @@ -384,22 +384,25 @@ impl<'a, T: SyscallHandler> Simulator<'a, T> { core.cache.borrow_mut().step(); ran = true; } - if !ran { - println!("All cores are not running, stopping..."); - for (i, core) in self.cores.iter().enumerate() { - println!("Core {}: stalled {} of {}", i, core.stall_count, core.cycle_count); - } - } ran } + fn report(&self) { + for (i, core) in self.cores.iter().enumerate() { + println!("Core {}: stalled {} of {}", i, core.stall_count, core.cycle_count); + } + } + pub fn run(&mut self) { loop { if !self.step() { break } } + + println!("All cores are not running, stopping..."); + self.report(); } pub fn run_max(&mut self, cycles: usize) { @@ -408,5 +411,8 @@ impl<'a, T: SyscallHandler> Simulator<'a, T> { break } } + + println!("Out of cycles, stopping..."); + self.report(); } } |