aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/programdock.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-25 23:13:31 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-25 23:54:51 +0100
commit635567e0564db4d19741b2478a4129fccb76f64a (patch)
treeb358007ad61d4cc1ae889e851c220ab892f377bf /qtmips_gui/programdock.cpp
parent50361206f7fdccc911ae9dc8095f6304fcb9bc95 (diff)
downloadqtmips-635567e0564db4d19741b2478a4129fccb76f64a.tar.gz
qtmips-635567e0564db4d19741b2478a4129fccb76f64a.tar.bz2
qtmips-635567e0564db4d19741b2478a4129fccb76f64a.zip
Highlight instructions passing through the pipeline stages.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/programdock.cpp')
-rw-r--r--qtmips_gui/programdock.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/qtmips_gui/programdock.cpp b/qtmips_gui/programdock.cpp
index 60a23b0..f3d3d78 100644
--- a/qtmips_gui/programdock.cpp
+++ b/qtmips_gui/programdock.cpp
@@ -101,6 +101,8 @@ ProgramDock::ProgramDock(QWidget *parent, QSettings *settings) : Super(parent) {
program_content, SLOT(focus_address_with_save(std::uint32_t)));
connect(program_content, SIGNAL(doubleClicked(QModelIndex)),
program_model, SLOT(toggle_hw_break(QModelIndex)));
+ connect(this, SIGNAL(stage_addr_changed(uint,std::uint32_t)),
+ program_model, SLOT(update_stage_addr(uint,std::uint32_t)));
}
void ProgramDock::setup(machine::QtMipsMachine *machine) {
@@ -121,31 +123,41 @@ void ProgramDock::set_follow_inst(int follow) {
}
void ProgramDock::fetch_inst_addr(std::uint32_t addr) {
- follow_addr[FOLLOWSRC_FETCH] = addr;
+ if (addr != machine::STAGEADDR_NONE)
+ follow_addr[FOLLOWSRC_FETCH] = addr;
+ emit stage_addr_changed(ProgramModel::STAGEADDR_FETCH, addr);
if (follow_source == FOLLOWSRC_FETCH)
update_follow_position();
}
void ProgramDock::decode_inst_addr(std::uint32_t addr) {
- follow_addr[FOLLOWSRC_DECODE] = addr;
+ if (addr != machine::STAGEADDR_NONE)
+ follow_addr[FOLLOWSRC_DECODE] = addr;
+ emit stage_addr_changed(ProgramModel::STAGEADDR_DECODE, addr);
if (follow_source == FOLLOWSRC_DECODE)
update_follow_position();
}
void ProgramDock::execute_inst_addr(std::uint32_t addr) {
- follow_addr[FOLLOWSRC_EXECUTE] = addr;
+ if (addr != machine::STAGEADDR_NONE)
+ follow_addr[FOLLOWSRC_EXECUTE] = addr;
+ emit stage_addr_changed(ProgramModel::STAGEADDR_EXECUTE, addr);
if (follow_source == FOLLOWSRC_EXECUTE)
update_follow_position();
}
void ProgramDock::memory_inst_addr(std::uint32_t addr) {
- follow_addr[FOLLOWSRC_MEMORY] = addr;
+ if (addr != machine::STAGEADDR_NONE)
+ follow_addr[FOLLOWSRC_MEMORY] = addr;
+ emit stage_addr_changed(ProgramModel::STAGEADDR_MEMORY, addr);
if (follow_source == FOLLOWSRC_MEMORY)
update_follow_position();
}
void ProgramDock::writeback_inst_addr(std::uint32_t addr) {
- follow_addr[FOLLOWSRC_WRITEBACK] = addr;
+ if (addr != machine::STAGEADDR_NONE)
+ follow_addr[FOLLOWSRC_WRITEBACK] = addr;
+ emit stage_addr_changed(ProgramModel::STAGEADDR_WRITEBACK, addr);
if (follow_source == FOLLOWSRC_WRITEBACK)
update_follow_position();
}