aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/qtmipsmachine.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-11 22:19:23 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-11 22:19:23 +0100
commit54d7ef4272673e55b6a4324373d11875280dad84 (patch)
treefc59ca3ca89408e6c8ceda594ed9994ffcd5aa90 /qtmips_machine/qtmipsmachine.cpp
parentbb7092e96401e4c89c44773c932788c9b0f87b53 (diff)
downloadqtmips-54d7ef4272673e55b6a4324373d11875280dad84.tar.gz
qtmips-54d7ef4272673e55b6a4324373d11875280dad84.tar.bz2
qtmips-54d7ef4272673e55b6a4324373d11875280dad84.zip
Display red background for instruction causing exception and skip HW breakpoint for first cycle after resume.
Instruction for stage is updated when given stage is flushed as well. But other signals are left intact, it is duty of memory stage to discard effect of instruction causing interrupt. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/qtmipsmachine.cpp')
-rw-r--r--qtmips_machine/qtmipsmachine.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/qtmips_machine/qtmipsmachine.cpp b/qtmips_machine/qtmipsmachine.cpp
index 23a83d3..382a9f2 100644
--- a/qtmips_machine/qtmipsmachine.cpp
+++ b/qtmips_machine/qtmipsmachine.cpp
@@ -68,7 +68,7 @@ QtMipsMachine::QtMipsMachine(const MachineConfig &cc) : QObject(), mcnf(&cc) {
run_t = new QTimer(this);
set_speed(0); // In default run as fast as possible
- connect(run_t, SIGNAL(timeout()), this, SLOT(step()));
+ connect(run_t, SIGNAL(timeout()), this, SLOT(step_timer()));
}
QtMipsMachine::~QtMipsMachine() {
@@ -150,6 +150,7 @@ void QtMipsMachine::play() {
CTL_GUARD;
set_status(ST_RUNNING);
run_t->start();
+ step_internal(true);
}
void QtMipsMachine::pause() {
@@ -159,13 +160,13 @@ void QtMipsMachine::pause() {
run_t->stop();
}
-void QtMipsMachine::step() {
+void QtMipsMachine::step_internal(bool skip_break) {
CTL_GUARD;
enum Status stat_prev = stat;
set_status(ST_BUSY);
emit tick();
try {
- cr->step();
+ cr->step(skip_break);
} catch (QtMipsException &e) {
run_t->stop();
set_status(ST_TRAPPED);
@@ -183,6 +184,14 @@ void QtMipsMachine::step() {
emit post_tick();
}
+void QtMipsMachine::step() {
+ step_internal(true);
+}
+
+void QtMipsMachine::step_timer() {
+ step_internal();
+}
+
void QtMipsMachine::restart() {
pause();
regs->reset();