Redo processor tab UI file
MODIFY
src/processorselectiondialog.cpp
src/processorselectiondialog.cpp
@@ -34,13 +34,17 @@ ProcessorSelectionDialog::~ProcessorSelectionDialog() {
}
void ProcessorSelectionDialog::accept() {
- ProcessorID id = qvariant_cast<ProcessorID>(ui->processorList->currentItem()->data(Qt::UserRole));
- ProcessorRegistry::selectProcessor(id);
+ const ProcessorID id = qvariant_cast<ProcessorID>(ui->processorList->currentItem()->data(Qt::UserRole));
+ if (ProcessorRegistry::selectProcessor(id)) {
+ // New processor model was selected
return QDialog::accept();
+ } else {
+ return QDialog::reject();
+ }
}
void ProcessorSelectionDialog::selectionChanged(QListWidgetItem* current, QListWidgetItem* previous) {
- ProcessorID id = qvariant_cast<ProcessorID>(current->data(Qt::UserRole));
+ const ProcessorID id = qvariant_cast<ProcessorID>(current->data(Qt::UserRole));
const auto& desc = ProcessorRegistry::getAvailableProcessors().at(id);
ui->name->setText(desc.name);

MODIFY
src/processortab.cpp
src/processortab.cpp
#include <QScrollBar>
#include <QSpinBox>
-#include "graphics/pipelinewidget.h"
#include "instructionmodel.h"
#include "parser.h"
#include "pipeline.h"
+#include "processorregistry.h"
#include "processorselectiondialog.h"
#include "rundialog.h"
+#include "VSRTL/graphics/vsrtl_widget.h"
+
#include "processors/ripesprocessor.h"
ProcessorTab::ProcessorTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent), m_ui(new Ui::ProcessorTab) {
m_ui->setupUi(this);
+ m_vsrtlWidget = m_ui->vsrtlWidget;
+
+ // Load the default processor
+ m_vsrtlWidget->setDesign(ProcessorRegistry::getProcessor());
+
setupSimulatorActions();
+ // Create temporary pipeline widget to reduce changeset during VSRTL integration
+ tmp_pipelineWidget = new PipelineWidget(this);
+
// Setup updating signals
connect(this, &ProcessorTab::update, m_ui->registerContainer, &RegisterContainerWidget::update);
- connect(this, &ProcessorTab::update, m_ui->pipelineWidget, &PipelineWidget::update);
+ connect(this, &ProcessorTab::update, tmp_pipelineWidget, &PipelineWidget::update);
connect(this, &ProcessorTab::update, this, &ProcessorTab::updateMetrics);
// Connect ECALL functionality to application output log and scroll to bottom
@@ -30,12 +40,14 @@ ProcessorTab::ProcessorTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolba
m_ui->console->verticalScrollBar()->setValue(m_ui->console->verticalScrollBar()->maximum());
});
- // Setup splitter such that consoles are always as small as possible
- m_ui->pipelinesplitter->setStretchFactor(0, 2);
+ // Make processor view stretch wrt. consoles
+ m_ui->pipelinesplitter->setStretchFactor(0, 1);
+ m_ui->pipelinesplitter->setStretchFactor(1, 0);
+
+ // Make processor view stretch wrt. right side tabs
+ m_ui->viewSplitter->setStretchFactor(0, 1);
+ m_ui->viewSplitter->setStretchFactor(1, 0);
- const auto splitterSize = m_ui->pipelinesplitter->size();
- m_ui->pipelinesplitter->setSizes(QList<int>() << splitterSize.height() - (m_ui->consolesTab->minimumHeight() - 1)
- << (m_ui->consolesTab->minimumHeight() + 1));
m_ui->consolesTab->removeTab(1);
// Initially, no file is loaded, disable toolbuttons
@@ -123,7 +135,10 @@ void ProcessorTab::setupSimulatorActions() {
void ProcessorTab::processorSelection() {
ProcessorSelectionDialog diag;
- diag.exec();
+ if (diag.exec()) {
+ // New processor model was selected
+ m_vsrtlWidget->setDesign(ProcessorRegistry::getProcessor());
+ }
}
void ProcessorTab::restart() {
@@ -159,7 +174,7 @@ void ProcessorTab::initInstructionView() {
connect(m_instrModel, &InstructionModel::currentIFRow, this, &ProcessorTab::setCurrentInstruction);
// Connect instruction model text changes to the pipeline widget (changing instruction names displayed above each
// stage)
- connect(m_instrModel, &InstructionModel::textChanged, m_ui->pipelineWidget, &PipelineWidget::stageTextChanged);
+ connect(m_instrModel, &InstructionModel::textChanged, tmp_pipelineWidget, &PipelineWidget::stageTextChanged);
}
ProcessorTab::~ProcessorTab() {
@@ -167,11 +182,11 @@ ProcessorTab::~ProcessorTab() {
}
void ProcessorTab::expandView() {
- m_ui->pipelineWidget->expandToView();
+ tmp_pipelineWidget->expandToView();
}
void ProcessorTab::displayValues(bool checked) {
- m_ui->pipelineWidget->displayAllValues(checked);
+ tmp_pipelineWidget->displayAllValues(checked);
}
void ProcessorTab::run() {

MODIFY
src/processortab.h
src/processortab.h
#include "pipelinetablemodel.h"
#include "ripestab.h"
+#include "graphics/pipelinewidget.h"
+
namespace Ui {
class ProcessorTab;
}
+namespace vsrtl {
+class VSRTLWidget;
+}
+
class InstructionModel;
class Parser;
@@ -59,6 +65,8 @@ private:
Ui::ProcessorTab* m_ui;
InstructionModel* m_instrModel;
+ vsrtl::VSRTLWidget* m_vsrtlWidget = nullptr;
+
// Actions
QAction* m_selectProcessorAction = nullptr;
QAction* m_clockAction = nullptr;
@@ -71,6 +79,8 @@ private:
QAction* m_resetAction = nullptr;
QSpinBox* m_autoClockInterval = nullptr;
+
+ PipelineWidget* tmp_pipelineWidget = nullptr;
};
#endif // PROCESSORTAB_H

MODIFY
src/processortab.ui
src/processortab.ui
<rect>
<x>0</x>
<y>0</y>
- <width>1152</width>
- <height>563</height>
+ <width>815</width>
+ <height>428</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
- <widget class="QSplitter" name="splitter">
+ <widget class="QSplitter" name="viewSplitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <widget class="PipelineWidget" name="pipelineWidget"/>
- <widget class="QTabWidget" name="consolesTab">
+ <property name="childrenCollapsible">
+ <bool>false</bool>
+ </property>
+ <widget class="vsrtl::VSRTLWidget" name="vsrtlWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ </widget>
+ <widget class="QTabWidget" name="consolesTab">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>150</height>
+ </size>
+ </property>
<property name="currentIndex">
<number>0</number>
</property>
- <widget class="QWidget" name="tab_5">
+ <widget class="QWidget" name="tab">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
<attribute name="title">
- <string>Application output</string>
+ <string>Output</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPlainTextEdit" name="console">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
</widget>
</item>
</layout>
</widget>
- <widget class="QWidget" name="tab_6">
+ <widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="1,1,0,0">
<item>
<widget class="RegisterContainerWidget" name="registerContainer" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>0</width>
<item row="0" column="0">
<widget class="QTableView" name="instructionView">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item>
<widget class="QLineEdit" name="cycleCount">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="readOnly">
<bool>true</bool>
</property>
</item>
<item>
<widget class="QLineEdit" name="nInstrExecuted">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="readOnly">
<bool>true</bool>
</property>
<container>1</container>
</customwidget>
<customwidget>
- <class>PipelineWidget</class>
- <extends>QGraphicsView</extends>
- <header>graphics/pipelinewidget.h</header>
+ <class>vsrtl::VSRTLWidget</class>
+ <extends>QWidget</extends>
+ <header>VSRTL/graphics/vsrtl_widget.h</header>
+ <container>1</container>
</customwidget>
</customwidgets>
<resources/>

Redo processor tab UI file