aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-04-05 20:07:10 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-04-05 20:07:10 +0200
commit299504df7e4882908e59fe7493fe133bf6271e8b (patch)
tree2bec45ffbbbaf252d0fbaa9a8889a97339f1a0fe /qtmips_machine
parent7becab88ae5287846299f22d291ccd44740fddbc (diff)
downloadqtmips-299504df7e4882908e59fe7493fe133bf6271e8b.tar.gz
qtmips-299504df7e4882908e59fe7493fe133bf6271e8b.tar.bz2
qtmips-299504df7e4882908e59fe7493fe133bf6271e8b.zip
qtmips_cli: add option to report number of required cycles and stalls.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine')
-rw-r--r--qtmips_machine/core.cpp8
-rw-r--r--qtmips_machine/core.h3
2 files changed, 8 insertions, 3 deletions
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();