Rename "Stage table" -> "Pipeline Diagram"
RENAME
src/stagetablemodel.cpp
src/pipelinediagrammodel.cpp
-#include "stagetablemodel.h"
+#include "pipelinediagrammodel.h"
#include <vector>
@@ -11,12 +11,12 @@ static inline uint32_t indexToAddress(unsigned index) {
return 0;
}
-StageTableModel::StageTableModel(QObject* parent) : QAbstractTableModel(parent) {
+PipelineDiagramModel::PipelineDiagramModel(QObject* parent) : QAbstractTableModel(parent) {
connect(ProcessorHandler::get(), &ProcessorHandler::procStateChangedNonRun, this,
- &StageTableModel::processorWasClocked);
+ &PipelineDiagramModel::processorWasClocked);
}
-QVariant StageTableModel::headerData(int section, Qt::Orientation orientation, int role) const {
+QVariant PipelineDiagramModel::headerData(int section, Qt::Orientation orientation, int role) const {
if (role != Qt::DisplayRole)
return QVariant();
if (orientation == Qt::Horizontal) {
@@ -28,26 +28,26 @@ QVariant StageTableModel::headerData(int section, Qt::Orientation orientation, i
}
}
-int StageTableModel::rowCount(const QModelIndex&) const {
+int PipelineDiagramModel::rowCount(const QModelIndex&) const {
return ProcessorHandler::getCurrentProgramSize() / ProcessorHandler::currentISA()->bytes();
}
-int StageTableModel::columnCount(const QModelIndex&) const {
+int PipelineDiagramModel::columnCount(const QModelIndex&) const {
return m_cycleStageInfos.size();
}
-void StageTableModel::processorWasClocked() {
+void PipelineDiagramModel::processorWasClocked() {
gatherStageInfo();
}
-void StageTableModel::reset() {
+void PipelineDiagramModel::reset() {
beginResetModel();
m_cycleStageInfos.clear();
endResetModel();
gatherStageInfo();
}
-void StageTableModel::gatherStageInfo() {
+void PipelineDiagramModel::gatherStageInfo() {
long long cycleCount = ProcessorHandler::getProcessor()->getCycleCount();
if (m_cycleStageInfos.count(cycleCount)) {
return;
@@ -58,7 +58,7 @@ void StageTableModel::gatherStageInfo() {
}
}
-QVariant StageTableModel::data(const QModelIndex& index, int role) const {
+QVariant PipelineDiagramModel::data(const QModelIndex& index, int role) const {
if (!index.isValid())
return QVariant();

RENAME
src/stagetablemodel.h
src/pipelinediagrammodel.h
namespace Ripes {
-class StageTableModel : public QAbstractTableModel {
+class PipelineDiagramModel : public QAbstractTableModel {
Q_OBJECT
public:
enum Column { Breakpoint = 0, PC = 1, Stage = 2, Instruction = 3, NColumns };
- StageTableModel(QObject* parent = nullptr);
+ PipelineDiagramModel(QObject* parent = nullptr);
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;

RENAME
src/stagetablewidget.cpp
src/pipelinediagramwidget.cpp
-#include "stagetablewidget.h"
-#include "ui_stagetablewidget.h"
+#include "pipelinediagramwidget.h"
+#include "ui_pipelinediagramwidget.h"
#include <QClipboard>
#include <QHeaderView>
-#include "stagetablemodel.h"
+#include "pipelinediagrammodel.h"
namespace Ripes {
-StageTableWidget::StageTableWidget(StageTableModel* model, QWidget* parent)
- : QDialog(parent), m_ui(new Ui::StageTableWidget) {
+PipelineDiagramWidget::PipelineDiagramWidget(PipelineDiagramModel* model, QWidget* parent)
+ : QDialog(parent), m_ui(new Ui::PipelineDiagramWidget) {
m_ui->setupUi(this);
m_stageModel = model;
- m_ui->stageTableView->setModel(m_stageModel);
+ m_ui->pipelineDiagramView->setModel(m_stageModel);
- m_ui->stageTableView->resizeColumnsToContents();
+ m_ui->pipelineDiagramView->resizeColumnsToContents();
m_ui->copy->setIcon(QIcon(":/icons/documents.svg"));
}
-StageTableWidget::~StageTableWidget() {
+PipelineDiagramWidget::~PipelineDiagramWidget() {
delete m_ui;
}
-void StageTableWidget::on_copy_clicked() {
+void PipelineDiagramWidget::on_copy_clicked() {
// Copy entire table to clipboard, including headers
Q_ASSERT(m_stageModel != nullptr);
QString textualRepr;

ADD
src/pipelinediagramwidget.h
+#pragma once
+
+#include <QDialog>
+
+QT_FORWARD_DECLARE_CLASS(QAbstractItemModel)
+
+namespace Ripes {
+class PipelineDiagramModel;
+namespace Ui {
+class PipelineDiagramWidget;
+}
+
+class PipelineDiagramWidget : public QDialog {
+ Q_OBJECT
+
+public:
+ PipelineDiagramWidget(PipelineDiagramModel* model, QWidget* parent = nullptr);
+ ~PipelineDiagramWidget() override;
+
+private slots:
+ void on_copy_clicked();
+
+private:
+ Ui::PipelineDiagramWidget* m_ui = nullptr;
+ PipelineDiagramModel* m_stageModel = nullptr;
+};
+} // namespace Ripes

RENAME
src/stagetablewidget.ui
src/pipelinediagramwidget.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>Ripes::StageTableWidget</class>
- <widget class="QDialog" name="Ripes::StageTableWidget">
+ <class>Ripes::PipelineDiagramWidget</class>
+ <widget class="QDialog" name="Ripes::PipelineDiagramWidget">
<property name="geometry">
<rect>
<x>0</x>
</rect>
</property>
<property name="windowTitle">
- <string>Stage table</string>
+ <string>Pipeline diagram</string>
</property>
<property name="windowIcon">
<iconset>
</layout>
</item>
<item>
- <widget class="QTableView" name="stageTableView"/>
+ <widget class="QTableView" name="pipelineDiagramView"/>
</item>
</layout>
</item>

MODIFY
src/processortab.cpp
src/processortab.cpp
#include <QTemporaryFile>
#include "instructionmodel.h"
+#include "pipelinediagrammodel.h"
+#include "pipelinediagramwidget.h"
#include "processorhandler.h"
#include "processorregistry.h"
#include "processorselectiondialog.h"
#include "registercontainerwidget.h"
#include "registermodel.h"
#include "ripessettings.h"
-#include "stagetablemodel.h"
-#include "stagetablewidget.h"
#include "syscall/systemio.h"
#include "VSRTL/graphics/vsrtl_widget.h"
@@ -88,7 +88,7 @@ ProcessorTab::ProcessorTab(QToolBar* controlToolbar, QToolBar* additionalToolbar
// By default, lock the VSRTL widget
m_vsrtlWidget->setLocked(true);
- m_stageModel = new StageTableModel(this);
+ m_stageModel = new PipelineDiagramModel(this);
updateInstructionModel();
m_ui->registerContainerWidget->initialize();
@@ -248,9 +248,9 @@ void ProcessorTab::setupSimulatorActions(QToolBar* controlToolbar) {
connect(m_displayValuesAction, &QAction::triggered, m_vsrtlWidget, &vsrtl::VSRTLWidget::setOutputPortValuesVisible);
const QIcon tableIcon = QIcon(":/icons/spreadsheet.svg");
- m_stageTableAction = new QAction(tableIcon, "Show stage table", this);
- connect(m_stageTableAction, &QAction::triggered, this, &ProcessorTab::showStageTable);
- m_toolbar->addAction(m_stageTableAction);
+ m_pipelineDiagramAction = new QAction(tableIcon, "Show pipeline diagram", this);
+ connect(m_pipelineDiagramAction, &QAction::triggered, this, &ProcessorTab::showPipelineDiagram);
+ m_toolbar->addAction(m_pipelineDiagramAction);
m_darkmodeAction = new QAction("Processor darkmode", this);
m_darkmodeAction->setCheckable(true);
@@ -414,7 +414,7 @@ void ProcessorTab::enableSimulatorControls() {
m_runAction->setEnabled(true);
m_reverseAction->setEnabled(m_vsrtlWidget->isReversible());
m_resetAction->setEnabled(true);
- m_stageTableAction->setEnabled(!m_hasRun);
+ m_pipelineDiagramAction->setEnabled(!m_hasRun);
}
void ProcessorTab::updateInstructionLabels() {
@@ -498,7 +498,7 @@ void ProcessorTab::run(bool state) {
m_reverseAction->setEnabled(!state);
m_resetAction->setEnabled(!state);
m_displayValuesAction->setEnabled(!state);
- m_stageTableAction->setEnabled(false);
+ m_pipelineDiagramAction->setEnabled(false);
// Disable widgets which are not updated when running the processor
m_vsrtlWidget->setEnabled(!state);
@@ -521,8 +521,8 @@ void ProcessorTab::clock() {
m_reverseAction->setEnabled(m_vsrtlWidget->isReversible());
}
-void ProcessorTab::showStageTable() {
- auto w = StageTableWidget(m_stageModel);
+void ProcessorTab::showPipelineDiagram() {
+ auto w = PipelineDiagramWidget(m_stageModel);
w.exec();
}
} // namespace Ripes

MODIFY
src/processortab.h
src/processortab.h
@@ -22,7 +22,7 @@ class ProcessorTab;
class InstructionModel;
class RegisterModel;
-class StageTableModel;
+class PipelineDiagramModel;
struct Layout;
class ProcessorTab : public RipesTab {
@@ -54,7 +54,7 @@ private slots:
void run(bool state);
void clock();
void setInstructionViewCenterAddr(uint32_t address);
- void showStageTable();
+ void showPipelineDiagram();
private:
void setupSimulatorActions(QToolBar* controlToolbar);
@@ -66,7 +66,7 @@ private:
Ui::ProcessorTab* m_ui = nullptr;
InstructionModel* m_instrModel = nullptr;
- StageTableModel* m_stageModel = nullptr;
+ PipelineDiagramModel* m_stageModel = nullptr;
vsrtl::VSRTLWidget* m_vsrtlWidget = nullptr;
@@ -80,7 +80,7 @@ private:
QAction* m_autoClockAction = nullptr;
QAction* m_runAction = nullptr;
QAction* m_displayValuesAction = nullptr;
- QAction* m_stageTableAction = nullptr;
+ QAction* m_pipelineDiagramAction = nullptr;
QAction* m_reverseAction = nullptr;
QAction* m_resetAction = nullptr;
QAction* m_darkmodeAction = nullptr;

DELETE
src/stagetablewidget.h
-#pragma once
-
-#include <QDialog>
-
-QT_FORWARD_DECLARE_CLASS(QAbstractItemModel)
-
-namespace Ripes {
-class StageTableModel;
-namespace Ui {
-class StageTableWidget;
-}
-
-class StageTableWidget : public QDialog {
- Q_OBJECT
-
-public:
- StageTableWidget(StageTableModel* model, QWidget* parent = nullptr);
- ~StageTableWidget() override;
-
-private slots:
- void on_copy_clicked();
-
-private:
- Ui::StageTableWidget* m_ui = nullptr;
- StageTableModel* m_stageModel = nullptr;
-};
-} // namespace Ripes

Rename "Stage table" -> "Pipeline Diagram"