From 299504df7e4882908e59fe7493fe133bf6271e8b Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Fri, 5 Apr 2019 20:07:10 +0200 Subject: qtmips_cli: add option to report number of required cycles and stalls. Signed-off-by: Pavel Pisa --- qtmips_machine/core.cpp | 8 ++++++-- qtmips_machine/core.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'qtmips_machine') diff --git a/qtmips_machine/core.cpp b/qtmips_machine/core.cpp index 88b2fe2..96ae0ad 100644 --- a/qtmips_machine/core.cpp +++ b/qtmips_machine/core.cpp @@ -72,10 +72,14 @@ void Core::reset() { do_reset(); } -unsigned Core::cycles() { +unsigned Core::cycles() const { return cycle_c; } +unsigned Core::stalls() const { + return stall_c; +} + Registers *Core::get_regs() { return regs; } @@ -935,7 +939,7 @@ bool StopExceptionHandler::handle_exception(Core *core, Registers *regs, (unsigned long)regs->read_pc(), (unsigned long)mem_ref_addr); #else (void)excause; (void)inst_addr; (void)next_addr; (void)mem_ref_addr; (void)regs; - (void)jump_branch_pc; (void)in_delay_slot; + (void)jump_branch_pc; (void)in_delay_slot, (void)core; #endif return true; }; diff --git a/qtmips_machine/core.h b/qtmips_machine/core.h index ff589c5..fd15315 100644 --- a/qtmips_machine/core.h +++ b/qtmips_machine/core.h @@ -76,7 +76,8 @@ public: void step(bool skip_break = false); // Do single step void reset(); // Reset core (only core, memory and registers has to be reseted separately) - unsigned cycles(); // Returns number of executed cycles + unsigned cycles() const; // Returns number of executed cycles + unsigned stalls() const; // Returns number of stall cycles Registers *get_regs(); Cop0State *get_cop0state(); -- cgit v1.2.3