Edit Processor tab buttons
MODIFY
src/graphics/shape.cpp
src/graphics/shape.cpp
@@ -149,15 +149,12 @@ void Shape::paint(QPainter *painter,
textRect.translate(-textRect.width() / 2,
-textRect.height() / 2); // center text rect
painter->setFont(font);
- if (m_type == ShapeType::MUX) {
- painter->drawText(textRect, Qt::AlignCenter, m_name);
- } else if (m_type == ShapeType::ALU) {
+ if (m_type == ShapeType::ALU) {
// Shift ALU name a bit to the right
textRect.translate(-rect.width() / 8, 0);
- painter->drawText(textRect, m_name);
- } else {
- painter->drawText(textRect, m_name);
}
+ painter->drawText(textRect, Qt::AlignCenter, m_name);
+
// Iterate through node descriptors and draw text
font.setPointSize(ioFontSize);
font.setBold(false);

MODIFY
src/processortab.cpp
src/processortab.cpp
@@ -7,8 +7,18 @@ ProcessorTab::ProcessorTab(QWidget* parent)
: QWidget(parent), m_ui(new Ui::ProcessorTab) {
m_ui->setupUi(this);
- connect(m_ui->pipeline, &QRadioButton::toggled, m_ui->forwarding,
- &QCheckBox::setEnabled);
+ // Setup buttons
+ connect(m_ui->start, &QPushButton::toggled, [=](bool state) {
+ if (state) {
+ m_ui->start->setText("Pause simulation");
+ } else {
+ m_ui->start->setText("Start simulation");
+ };
+ m_ui->step->setEnabled(!state);
+ });
+
+ connect(m_ui->reset, &QPushButton::clicked,
+ [=] { m_ui->start->setChecked(false); });
}
void ProcessorTab::initRegWidget(std::vector<uint32_t>* regPtr) {

MODIFY
src/processortab.ui
src/processortab.ui
<rect>
<x>0</x>
<y>0</y>
- <width>546</width>
+ <width>1152</width>
<height>411</height>
</rect>
</property>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
- <string>Processor type</string>
+ <string>Simulation settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
- <widget class="QRadioButton" name="singlecycle">
+ <widget class="QPushButton" name="run">
+ <property name="toolTip">
+ <string>Run until encountering a breakpoint or to the end of the program</string>
+ </property>
<property name="text">
- <string>Single cycle</string>
+ <string>Run</string>
</property>
- <property name="checked">
- <bool>true</bool>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
- <widget class="QRadioButton" name="pipeline">
+ <widget class="QPushButton" name="start">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Start simulation, stepping through the program</string>
+ </property>
<property name="text">
- <string>5-stage pipeline</string>
+ <string>Start simulation</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRepeatDelay">
+ <number>300</number>
</property>
</widget>
</item>
<item>
- <widget class="QCheckBox" name="forwarding">
- <property name="enabled">
- <bool>false</bool>
- </property>
+ <widget class="QPushButton" name="step">
<property name="text">
- <string>Forwarding</string>
+ <string>Step</string>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <widget class="QPushButton" name="reset">
+ <property name="toolTip">
+ <string/>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
+ <property name="text">
+ <string>Reset</string>
</property>
- </spacer>
+ </widget>
</item>
<item>
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="label_2">
<property name="text">
- <string>Clock rate</string>
+ <string>Execution speed:</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="lineEdit">
- <property name="text">
- <string>1</string>
+ <widget class="QSlider" name="execSpeed">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimum">
+ <number>1</number>
</property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <property name="maximum">
+ <number>5</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="comboBox">
- <item>
- <property name="text">
- <string>GHz</string>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
+ </widget>
</item>
<item>
+ <widget class="QCheckBox" name="displayValues">
<property name="text">
- <string>MHz</string>
+ <string>Display signal values</string>
</property>
+ </widget>
</item>
<item>
- <property name="text">
- <string>Hz</string>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- </item>
- </widget>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="RegisterContainerWidget" name="registerContainer" native="true"/>
+ <widget class="RegisterContainerWidget" name="registerContainer" native="true">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">

Edit Processor tab buttons