Indicate stalled stages by '-' character in StageTableModel
MODIFY
src/stagetablemodel.cpp
src/stagetablemodel.cpp
@@ -47,9 +47,8 @@ void StageTableModel::reset() {
}
void StageTableModel::gatherStageInfo() {
- for (int i = 0; i < ProcessorHandler::get()->getProcessor()->stageCount(); i++) {
- const auto& stageName = ProcessorHandler::get()->getProcessor()->stageName(i);
- m_cycleStageInfos[ProcessorHandler::get()->getProcessor()->getCycleCount()][stageName] =
+ for (unsigned i = 0; i < ProcessorHandler::get()->getProcessor()->stageCount(); i++) {
+ m_cycleStageInfos[ProcessorHandler::get()->getProcessor()->getCycleCount()][i] =
ProcessorHandler::get()->getProcessor()->stageInfo(i);
}
}
@@ -70,10 +69,18 @@ QVariant StageTableModel::data(const QModelIndex& index, int role) const {
const uint32_t addr = indexToAddress(index.row());
const auto& stageInfo = m_cycleStageInfos.at(index.column());
+
QStringList stagesForAddr;
for (const auto& si : stageInfo) {
if (si.second.pc == addr && si.second.stage_valid) {
- stagesForAddr << si.first;
+ if (m_cycleStageInfos.count(index.column() - 1)) {
+ const auto& prevCycleStageInfo = m_cycleStageInfos.at(index.column() - 1);
+ if (prevCycleStageInfo.at(si.first).stage_valid && prevCycleStageInfo.at(si.first).pc == si.second.pc) {
+ stagesForAddr << "-";
+ continue;
+ }
+ }
+ stagesForAddr << ProcessorHandler::get()->getProcessor()->stageName(si.first);
}
}

MODIFY
src/stagetablemodel.h
src/stagetablemodel.h
@@ -25,6 +25,10 @@ public slots:
private:
void gatherStageInfo();
- std::map<unsigned, std::map<QString, StageInfo>> m_cycleStageInfos;
+ /**
+ * @brief m_cycleStageInfos
+ * map<cycle, map<stageId, stageInfo>>
+ */
+ std::map<long long, std::map<unsigned, StageInfo>> m_cycleStageInfos;
};
} // namespace Ripes

MODIFY
src/stagetablewidget.cpp
src/stagetablewidget.cpp
@@ -15,7 +15,6 @@ StageTableWidget::StageTableWidget(StageTableModel* model, QWidget* parent)
m_stageModel = model;
m_ui->stageTableView->setModel(m_stageModel);
- m_ui->stageTableView->horizontalHeader()->setMinimumSectionSize(0);
m_ui->stageTableView->resizeColumnsToContents();
m_ui->copy->setIcon(QIcon(":/icons/documents.svg"));
}

Indicate stalled stages by '-' character in StageTableModel