Implement setting for VSRTL reverse stack size
MODIFY
external/VSRTL
external/VSRTL
-Subproject commit 7078fcfaa4746ecce1c70eac559103a73fe4394c
+Subproject commit 8d51b2bfd65df07316d2ff9b1cd493893179361d

MODIFY
src/mainwindow.cpp
src/mainwindow.cpp
#include "processorhandler.h"
#include "processortab.h"
#include "registerwidget.h"
+#include "ripessettings.h"
#include "savedialog.h"
+#include "settingsdialog.h"
#include "version/version.h"
#include "fancytabbar/fancytabbar.h"
@@ -90,6 +92,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_ui(new Ui::Main
connect(m_ui->actionOpen_wiki, &QAction::triggered, this, &MainWindow::wiki);
connect(m_ui->actionVersion, &QAction::triggered, this, &MainWindow::version);
+ connect(m_ui->actionSettings, &QAction::triggered, this, &MainWindow::settingsTriggered);
}
void MainWindow::fitToView() {
@@ -271,6 +274,11 @@ void MainWindow::saveFilesAsTriggered() {
saveFilesTriggered();
}
+void MainWindow::settingsTriggered() {
+ SettingsDialog diag;
+ diag.exec();
+}
+
void MainWindow::newProgramTriggered() {
QMessageBox mbox;
mbox.setWindowTitle("New Program...");

MODIFY
src/mainwindow.h
src/mainwindow.h
@@ -39,6 +39,7 @@ private slots:
void saveFilesTriggered();
void saveFilesAsTriggered();
void newProgramTriggered();
+ void settingsTriggered();
void processorUpdated() { emit updateMemoryTab(); }

MODIFY
src/mainwindow.ui
src/mainwindow.ui
<addaction name="actionOpen_wiki"/>
<addaction name="actionVersion"/>
</widget>
+ <widget class="QMenu" name="menuEdit">
+ <property name="title">
+ <string>Edit</string>
+ </property>
+ <addaction name="actionSettings"/>
+ </widget>
<addaction name="menuFile"/>
+ <addaction name="menuEdit"/>
<addaction name="menuHelp"/>
</widget>
<action name="actionOpen_wiki">
<string>Version</string>
</property>
</action>
+ <action name="actionSettings">
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>

MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
#include "parser.h"
#include "processorregistry.h"
#include "program.h"
+#include "ripessettings.h"
#include <QMessageBox>
#include <QtConcurrent/QtConcurrent>
@@ -12,6 +13,12 @@ namespace Ripes {
ProcessorHandler::ProcessorHandler() {
// Contruct the default processor
selectProcessor(m_currentID, ProcessorRegistry::getDescription(m_currentID).defaultRegisterVals);
+
+ // Connect relevant settings changes to VSRTL
+ connect(RipesSettings::getObserver(RIPES_SETTING_REWINDSTACKSIZE), &SettingObserver::modified,
+ [=](const auto& size) { m_currentProcessor->setReverseStackSize(size.toUInt()); });
+ // Update VSRTL reverse stack size to reflect current settings
+ m_currentProcessor->setReverseStackSize(RipesSettings::value(RIPES_SETTING_REWINDSTACKSIZE).toUInt());
}
void ProcessorHandler::loadProgram(const Program* p) {

MODIFY
src/processortab.cpp
src/processortab.cpp
#include "processorregistry.h"
#include "processorselectiondialog.h"
#include "registermodel.h"
+#include "ripessettings.h"
#include "stagetablemodel.h"
#include "stagetablewidget.h"
@@ -55,6 +56,10 @@ ProcessorTab::ProcessorTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolba
m_ui->console->verticalScrollBar()->setValue(m_ui->console->verticalScrollBar()->maximum());
});
+ // Connect changes in VSRTL reversible stack size to checking whether the simulator is reversible
+ connect(RipesSettings::getObserver(RIPES_SETTING_REWINDSTACKSIZE), &SettingObserver::modified,
+ [=](const auto& size) { m_reverseAction->setEnabled(m_vsrtlWidget->isReversible()); });
+
// Make processor view stretch wrt. consoles
m_ui->pipelinesplitter->setStretchFactor(0, 1);
m_ui->pipelinesplitter->setStretchFactor(1, 0);

Implement setting for VSRTL reverse stack size