From a3528b83dd10fa9cdf7ef5635f615c1b295f3f4c Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 25 Apr 2025 21:12:58 -0400 Subject: Pass full DTO to GUI --- gui/gui.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gui/gui.h') diff --git a/gui/gui.h b/gui/gui.h index 7b03f75..b3a3110 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -57,15 +57,15 @@ class GUI : public QMainWindow private slots: void on_worker_refresh_gui(int value, int pc); - void onWorkerFetchInfo(const std::vector info); + void onWorkerFetchInfo(const InstrDTO *); - void onWorkerDecodeInfo(const std::vector info); + void onWorkerDecodeInfo(const InstrDTO *); - void onWorkerExecuteInfo(const std::vector info); + void onWorkerExecuteInfo(const InstrDTO *); - void onWorkerMemoryInfo(const std::vector info); + void onWorkerMemoryInfo(const InstrDTO *); - void onWorkerWriteBackInfo(const std::vector info); + void onWorkerWriteBackInfo(const InstrDTO *); void onWorkerShowStorage( const std::vector> data, int i); -- cgit v1.2.3 From 55a5a757dea26efad1e57fa7805c62ed19206ad3 Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 25 Apr 2025 21:23:02 -0400 Subject: Remove onWorkerFinished --- gui/gui.cc | 6 ------ gui/gui.h | 2 -- gui/worker.cc | 3 --- 3 files changed, 11 deletions(-) (limited to 'gui/gui.h') diff --git a/gui/gui.cc b/gui/gui.cc index bf9e6cf..905b018 100644 --- a/gui/gui.cc +++ b/gui/gui.cc @@ -92,7 +92,6 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) }); // Proper cleanup when worker finishes - connect(worker, &Worker::finished, this, &GUI::onWorkerFinished); connect(worker, &Worker::finished, &workerThread, &QThread::quit); connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater); @@ -254,12 +253,8 @@ void GUI::onWorkerShowRegisters(const std::array &data) displayArrayHTML(this->tab_text_boxes.at(0), data); } -void GUI::onWorkerFinished() { qDebug() << "Worker has finished processing."; } - void GUI::on_upload_intructions_btn_clicked() { - qDebug() << "Upload intructions button clicked."; - // why ui->register_table, or now ui->storage QString filePath = QFileDialog::getOpenFileName( ui->storage, "Open Binary File", QDir::homePath(), @@ -311,7 +306,6 @@ void GUI::on_base_toggle_checkbox_checkStateChanged(const Qt::CheckState &state) void GUI::on_step_btn_clicked() { - qDebug() << "Run step button clicked."; // try to configure first if (!this->ready) this->on_config_clicked(); diff --git a/gui/gui.h b/gui/gui.h index b3a3110..26e9b03 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -72,8 +72,6 @@ class GUI : public QMainWindow void onWorkerShowRegisters(const std::array &data); - void onWorkerFinished(); - void on_upload_intructions_btn_clicked(); void on_upload_program_state_btn_clicked(); diff --git a/gui/worker.cc b/gui/worker.cc index 22f8738..a0e21f6 100644 --- a/gui/worker.cc +++ b/gui/worker.cc @@ -23,8 +23,6 @@ Worker::Worker(QObject *parent) : QObject(parent) {} Worker::~Worker() { emit finished(); - qDebug() << "Worker destructor called in thread:" - << QThread::currentThread(); delete this->ct; } @@ -74,7 +72,6 @@ void Worker::configure( void Worker::runSteps(int steps) { - qDebug() << "Running for " << steps << "steps"; this->ct->run_for(steps); this->update(); } -- cgit v1.2.3 From c98a0c26c4ccb5c4ae0e9f5810be910a7b299037 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 26 Apr 2025 03:06:14 -0400 Subject: Add proper tables display for storage devices --- gui/gui.cc | 71 ++++++++++++++------------------------- gui/gui.h | 6 ++-- gui/resources/styles.qss | 30 ++++++++++++----- gui/storageview.cc | 70 +++++++++++++++++++++++++++++++++++++++ gui/storageview.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ gui/worker.cc | 20 +++++++++-- gui/worker.h | 9 ++++- 7 files changed, 229 insertions(+), 63 deletions(-) create mode 100644 gui/storageview.cc create mode 100644 gui/storageview.h (limited to 'gui/gui.h') diff --git a/gui/gui.cc b/gui/gui.cc index 905b018..9baed38 100644 --- a/gui/gui.cc +++ b/gui/gui.cc @@ -19,8 +19,11 @@ #include "./ui_gui.h" #include "dynamicwaysentry.h" #include "messages.h" +#include "storageview.h" #include #include +#include +#include GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) { @@ -131,37 +134,6 @@ void displayArrayHTML(QTextEdit *textEdit, const std::array &data) textEdit->setReadOnly(true); } -void displayTableHTML( - QTextEdit *textEdit, - const std::vector> &data) -{ - textEdit->setReadOnly(false); - QString tableText = ""; - - int index = 0; - for (const auto &row : data) { - tableText += ""; - for (signed int value : row) { - tableText += QString("") - .arg(QString::asprintf("%04X", value)) - .arg(index); - index++; - } - tableText += ""; - } - - tableText += "
" - "%1 %2" - "
"; - - textEdit->setHtml(tableText); - textEdit->setReadOnly(true); -} - void GUI::on_worker_refresh_gui(int cycles, int pc) { ui->p_counter->set_value(pc); @@ -241,16 +213,15 @@ void GUI::onWorkerWriteBackInfo(const InstrDTO *i) } } -void GUI::onWorkerShowStorage( - const std::vector> data, int i) +void GUI::onWorkerShowStorage(const QVector> &data, int i) { - std::cout << this->tab_text_boxes.size() << std::endl; - displayTableHTML(this->tab_text_boxes.at(i), data); + this->tab_boxes.at(i)->set_data(data); } void GUI::onWorkerShowRegisters(const std::array &data) { - displayArrayHTML(this->tab_text_boxes.at(0), data); + ; + // displayArrayHTML(this->tab_boxes.at(0), data); } void GUI::on_upload_intructions_btn_clicked() @@ -368,27 +339,33 @@ void GUI::on_config_clicked() void GUI::make_tabs(int num) { int i; - QStringList names; - QTextEdit *e; + QStringList xTra; + StorageView *e; + QTableView *t; QString n; - names = {"Registers", "DRAM"}; + xTra = {"Registers", "DRAM"}; ui->storage->clear(); - this->tab_text_boxes.clear(); + + this->tab_boxes.clear(); + qDeleteAll(this->tab_boxes); for (i = 0; i < num; ++i) { - e = new QTextEdit(); - e->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + e = new StorageView(10, this); + + t = new QTableView; + t->setModel(e); + t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); // make the name - if (i < names.size()) - n = names[i]; + if (i < xTra.size()) + n = xTra[i]; else - n = QString("Level %1").arg(i - 1); + n = QString("L%1").arg(i - 1); - ui->storage->addTab(e, n); - this->tab_text_boxes.push_back(e); + ui->storage->addTab(t, n); + this->tab_boxes.push_back(e); } } diff --git a/gui/gui.h b/gui/gui.h index 26e9b03..f723729 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -18,6 +18,7 @@ #ifndef GUI_H #define GUI_H +#include "storageview.h" #include "worker.h" #include #include @@ -67,8 +68,7 @@ class GUI : public QMainWindow void onWorkerWriteBackInfo(const InstrDTO *); - void onWorkerShowStorage( - const std::vector> data, int i); + void onWorkerShowStorage(const QVector> &data, int i); void onWorkerShowRegisters(const std::array &data); @@ -104,7 +104,7 @@ class GUI : public QMainWindow /** * The list of storage displays. */ - std::vector tab_text_boxes; + std::vector tab_boxes; /** * Whether or not numerical values are currently displaying in hex. diff --git a/gui/resources/styles.qss b/gui/resources/styles.qss index 76d0311..a61035e 100644 --- a/gui/resources/styles.qss +++ b/gui/resources/styles.qss @@ -50,15 +50,27 @@ QGroupBox::title { QLabel { } -/* text entry */ -QLineEdit { - font-size: 18pt; - border-radius: 0px; - padding: 0 4px; - selection-background-color: "#00cc00"; +QTableView { + border: 0px; + selection-background-color: transparent; + selection-color: black; + outline: none; +} + +QTableView::item { + border: none; + padding: 4px; +} + +QHeaderView::section { + color: "#00cc00"; + background-color: "#000200"; + border: none; } -QTextEdit, QListView { +QTableView QTableCornerButton::section { + background-color: "#000200"; + border: none; } QPushButton { @@ -71,8 +83,8 @@ QPushButton { QPushButton:pressed { color: "#00cc00"; - background-color: "#000200"; -} + background-color: "#000200";} + QPushButton:flat { border: none; /* no border for a flat push button */ diff --git a/gui/storageview.cc b/gui/storageview.cc new file mode 100644 index 0000000..f6f9736 --- /dev/null +++ b/gui/storageview.cc @@ -0,0 +1,70 @@ +// Simulator for the RISC-V[ECTOR] mini-ISA +// Copyright (C) 2025 Siddarth Suresh +// Copyright (C) 2025 bdunahu + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "storageview.h" +#include "definitions.h" +#include +#include + +StorageView::StorageView(int rows, QObject *parent) + : QAbstractTableModel(parent) +{ + this->r = rows; + this->d.resize(rows); + for (auto &row : this->d) + row.resize(LINE_SIZE, 0); +} + +int StorageView::rowCount(const QModelIndex &) const { return this->r; } + +int StorageView::columnCount(const QModelIndex &) const { return LINE_SIZE; } + +QVariant StorageView::data(const QModelIndex &i, int role) const +{ + Qt::Alignment a; + + if (role == Qt::TextAlignmentRole) { + a = Qt::AlignRight | Qt::AlignVCenter; + return QVariant(static_cast(a)); + } + if (!i.isValid() || role != Qt::DisplayRole) + return QVariant(); + return this->d[i.row()][i.column()]; +} + +QVariant StorageView::headerData(int section, Qt::Orientation o, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (o == Qt::Vertical) { + return section * 4; + } + return QVariant(); +} + +Qt::ItemFlags StorageView::flags(const QModelIndex &i) const { + (void)i; + return Qt::ItemIsEnabled; +} + +void StorageView::set_data(const QVector> &data) +{ + beginResetModel(); + this->d = data; + endResetModel(); +} diff --git a/gui/storageview.h b/gui/storageview.h new file mode 100644 index 0000000..4956f23 --- /dev/null +++ b/gui/storageview.h @@ -0,0 +1,86 @@ +// Simulator for the RISC-V[ECTOR] mini-ISA +// Copyright (C) 2025 Siddarth Suresh +// Copyright (C) 2025 bdunahu + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#ifndef STORAGEVIEW_H +#define STORAGEVIEW_H + +#include +#include + +// see https://doc.qt.io/qt-6/qabstracttablemodel.html +class StorageView : public QAbstractTableModel +{ + Q_OBJECT + public: + /** + * Constructor. Initializes a clean StorageView object with + * `rows' rows. + * @param the number of rows + */ + StorageView(int rows, QObject *parent = nullptr); + + /** + * Returns the number of rows in this table. + * @param the parent + * @return the number of rows under the given parent. + */ + int rowCount(const QModelIndex &) const override; + /** + * Returns the number of columns in this table. + * @param the parent + * @return the number of columns under the given parent (hint: it's + * LINE_SIZE) + */ + int columnCount(const QModelIndex &) const override; + + /** + * Returns a properly formatted cell, including alignment.This function is + * specific to the implementation details of QAbstractTableModel. + */ + QVariant + data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + + /** + * Adds custom formatting options for row and column headers. + */ + QVariant headerData( + int section, + Qt::Orientation o, + int role = Qt::DisplayRole) const override; + + /** + * Ensures the table is enabled, but not selectable. + */ + Qt::ItemFlags flags(const QModelIndex &i) const override; + + /** + * @param field to assign to `this->d' + */ + void set_data(const QVector> &data); + + private: + /** + * The number of rows in this table. + */ + int r; + /** + * The data this table displays. + */ + QVector> d; +}; + +#endif // STORAGEVIEW_H diff --git a/gui/worker.cc b/gui/worker.cc index a0e21f6..6419b73 100644 --- a/gui/worker.cc +++ b/gui/worker.cc @@ -83,11 +83,10 @@ void Worker::update() this->ct_mutex.lock(); emit register_storage(this->ct->get_gprs()); - emit storage(this->s.at(0)->view(0, 255), 1); + emit storage(this->data_to_QT(this->s.at(0)->get_data()), 1); for (i = 1; i < s.size(); ++i) - emit storage( - this->s.at(i - 1)->view(0, 1 << this->size_inc * i), i + 1); + emit storage(this->data_to_QT(this->s.at(i - 1)->get_data()), i + 1); emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc()); emit if_info(this->if_stage->get_instr()); @@ -97,3 +96,18 @@ void Worker::update() emit wb_info(this->wb_stage->get_instr()); this->ct_mutex.unlock(); } + +QVector> +Worker::data_to_QT(std::vector> data) +{ + QVector> r; + QVector tmp; + + r.reserve(static_cast(data.size())); + + for (const auto &line : data) { + tmp = QVector(line.begin(), line.end()); + r.append(tmp); + } + return r; +} diff --git a/gui/worker.h b/gui/worker.h index 06e4a16..c0e72d3 100644 --- a/gui/worker.h +++ b/gui/worker.h @@ -70,7 +70,7 @@ class Worker : public QObject signals: void clock_cycles(int value, int pc); void - storage(const std::vector> data, int i); + storage(QVector> data, int i); void register_storage(const std::array data); void if_info(const InstrDTO *); void id_info(const InstrDTO *); @@ -80,6 +80,13 @@ class Worker : public QObject void finished(); private: + /** + * Converts a vector of arrays into a QVector of QVectors. + * @param the original data + * @return a less universal version of the same thing + */ + QVector> + data_to_QT(std::vector> data); /** * Sets the GUI signals to update the storage, clock cycle, and stage * displays. -- cgit v1.2.3 From a78163745b43a0c420ae4ea5792def30a94420eb Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 26 Apr 2025 03:39:28 -0400 Subject: Partial cache size generation, full cache display --- gui/gui.cc | 26 +++++++++++++++----------- gui/gui.h | 5 +++++ gui/util.cc | 16 ++++++++++++++++ gui/util.h | 8 ++++++++ gui/worker.cc | 8 +++----- gui/worker.h | 5 ----- 6 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 gui/util.cc create mode 100644 gui/util.h (limited to 'gui/gui.h') diff --git a/gui/gui.cc b/gui/gui.cc index 9baed38..ecdf9d3 100644 --- a/gui/gui.cc +++ b/gui/gui.cc @@ -20,10 +20,11 @@ #include "dynamicwaysentry.h" #include "messages.h" #include "storageview.h" +#include "util.h" +#include #include #include #include -#include GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) { @@ -332,6 +333,8 @@ void GUI::on_config_clicked() else this->set_status(get_initialize, "happy"); + this->curr_cache_levels = ways.size(); + emit sendConfigure(ways, this->p, is_pipelined); make_tabs(2 + ways.size()); } @@ -339,31 +342,32 @@ void GUI::on_config_clicked() void GUI::make_tabs(int num) { int i; - QStringList xTra; StorageView *e; QTableView *t; QString n; - xTra = {"Registers", "DRAM"}; - ui->storage->clear(); this->tab_boxes.clear(); qDeleteAll(this->tab_boxes); for (i = 0; i < num; ++i) { - e = new StorageView(10, this); + // make the name + if (i == 0) { + n = "Registers"; + e = new StorageView(0, this); + } else if (i == 1) { + n = "DRAM"; + e = new StorageView(MEM_LINES, this); + } else { + n = QString("L%1").arg(i - 1); + e = new StorageView(cache_size_mapper(this->curr_cache_levels, i), this); + } t = new QTableView; t->setModel(e); t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - // make the name - if (i < xTra.size()) - n = xTra[i]; - else - n = QString("L%1").arg(i - 1); - ui->storage->addTab(t, n); this->tab_boxes.push_back(e); } diff --git a/gui/gui.h b/gui/gui.h index f723729..10c8f67 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -101,6 +101,11 @@ class GUI : public QMainWindow */ bool ready; + /** + * The current number of cache levels. + */ + int curr_cache_levels; + /** * The list of storage displays. */ diff --git a/gui/util.cc b/gui/util.cc new file mode 100644 index 0000000..ee75e56 --- /dev/null +++ b/gui/util.cc @@ -0,0 +1,16 @@ +#include "util.h" + +int cache_size_mapper(int total_levels, int level) +{ + const int y_min = 4; + const int y_max = 12; + double f, r; + + if (total_levels <= 1) + return 8; + + f = level / total_levels; + r = y_min + f * (y_max - y_min); + + return r; +} diff --git a/gui/util.h b/gui/util.h new file mode 100644 index 0000000..87c33f6 --- /dev/null +++ b/gui/util.h @@ -0,0 +1,8 @@ +/** + * Given `total_levels', returns an integer between 4 and 12 which is a linear map of `level' onto `total_levels'. + * This is used for generating cache sizes given a number of levels. + * @param the total number of cache levels, zero-indexed. + * @param a numberedcache level, zero-indexed. + * @return an integer between 4-12, linearly scaled with level. + */ +int cache_size_mapper(int total_levels, int level); diff --git a/gui/worker.cc b/gui/worker.cc index 6419b73..93ccbea 100644 --- a/gui/worker.cc +++ b/gui/worker.cc @@ -17,6 +17,7 @@ #include "worker.h" #include "storage.h" +#include "util.h" Worker::Worker(QObject *parent) : QObject(parent) {} @@ -39,10 +40,6 @@ void Worker::configure( this->s.clear(); this->ct_mutex.lock(); - if (ways.size() != 0) { - // TODO optimal proper sizes - this->size_inc = ((MEM_LINE_SPEC * 0.75) / ways.size()); - } d = new Dram(DRAM_DELAY); s = static_cast(d); @@ -51,7 +48,8 @@ void Worker::configure( for (i = ways.size(); i > 0; --i) { s = static_cast(new Cache( - s, this->size_inc * (i), ways.at(i - 1), CACHE_DELAY + i)); + s, cache_size_mapper(ways.size() - 1, i), ways.at(i - 1), + CACHE_DELAY + i)); this->s.push_front(s); } diff --git a/gui/worker.h b/gui/worker.h index c0e72d3..c62f4ed 100644 --- a/gui/worker.h +++ b/gui/worker.h @@ -50,11 +50,6 @@ class Worker : public QObject Controller *ct = nullptr; QMutex ct_mutex; - /** - * The size each progressive cache level increases by. - */ - unsigned int size_inc; - public: explicit Worker(QObject *parent = nullptr); ~Worker(); -- cgit v1.2.3 From d449750f789076459de8d47c2960a1279e543c32 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 26 Apr 2025 16:38:07 -0400 Subject: Fix some issues in GUI looking for memory leak --- gui/gui.cc | 19 +++++++++++-------- gui/gui.h | 4 ++-- gui/util.cc | 5 +++-- 3 files changed, 16 insertions(+), 12 deletions(-) (limited to 'gui/gui.h') diff --git a/gui/gui.cc b/gui/gui.cc index 2555435..7df1bfc 100644 --- a/gui/gui.cc +++ b/gui/gui.cc @@ -349,28 +349,31 @@ void GUI::make_tabs(int num) ui->storage->clear(); - this->tab_boxes.clear(); qDeleteAll(this->tab_boxes); + this->tab_boxes.clear(); for (i = 0; i < num; ++i) { if (i == 0) { n = "Registers"; e = new StorageView(0, this); - } else if (i == 1) { + } else if (i == num - 1) { n = "DRAM"; - e = new StorageView(MEM_LINES, this); + e = new StorageView(4, this); } else { - n = QString("L%1").arg(i - 1); + n = QString("L%1").arg(i); e = new StorageView( - cache_size_mapper(this->curr_cache_levels, i), this); + // cache_size_mapper(this->curr_cache_levels-1, i-1) + 4, this); } + std::cout << "total levels: " << num << ":" + << this->curr_cache_levels - 1 << " level: " << i + << std::endl; - t = new QTableView; + t = new QTableView(ui->storage); t->setModel(e); d = new DigitLabelDelegate(t); - connect( - this, &GUI::hex_toggled, e, &StorageView::set_hex_display); + connect(this, &GUI::hex_toggled, e, &StorageView::set_hex_display); connect( this, &GUI::hex_toggled, d, &DigitLabelDelegate::set_hex_display); diff --git a/gui/gui.h b/gui/gui.h index 10c8f67..3db88ff 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -99,12 +99,12 @@ class GUI : public QMainWindow /** * Indicates if the program has been initialized. */ - bool ready; + bool ready = false; /** * The current number of cache levels. */ - int curr_cache_levels; + int curr_cache_levels = 0; /** * The list of storage displays. diff --git a/gui/util.cc b/gui/util.cc index 72c0d87..21bf0be 100644 --- a/gui/util.cc +++ b/gui/util.cc @@ -1,16 +1,17 @@ #include "util.h" +#include "definitions.h" #include int cache_size_mapper(int total_levels, int level) { const int y_min = 4; - const int y_max = 12; + const int y_max = MEM_LINES - 2; double f, r; if (total_levels <= 1) return 8; - f = level / total_levels; + f = level / (double)total_levels; r = y_min + f * (y_max - y_min); return r; -- cgit v1.2.3 From 2c99a2eab1919af938c03418c551a1f035b99a5c Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 27 Apr 2025 02:42:40 -0400 Subject: Add two new high-value step options in the step slider --- gui/gui.h | 2 +- gui/gui.ui | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gui/gui.h') diff --git a/gui/gui.h b/gui/gui.h index 3db88ff..5c95db5 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -138,7 +138,7 @@ class GUI : public QMainWindow /** * The possible step slider values. */ - QVector step_values = {1, 5, 20, 50, 250, 1000, 10000}; + QVector step_values = {1, 5, 20, 50, 250, 1000, 10000, 100000, 500000}; QThread workerThread; diff --git a/gui/gui.ui b/gui/gui.ui index a21a200..ec1c23b 100644 --- a/gui/gui.ui +++ b/gui/gui.ui @@ -630,7 +630,7 @@ 0 - 6 + 8 1 -- cgit v1.2.3 From a4dd1f00a5d0108058fb3bfbd5f399a507792859 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 27 Apr 2025 03:02:37 -0400 Subject: Add a slider value for 100 million cycles --- gui/gui.cc | 2 +- gui/gui.h | 2 +- gui/gui.ui | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'gui/gui.h') diff --git a/gui/gui.cc b/gui/gui.cc index 6e7da5f..b4feda6 100644 --- a/gui/gui.cc +++ b/gui/gui.cc @@ -139,6 +139,7 @@ void GUI::on_worker_refresh_gui(int cycles, int pc) { ui->p_counter->set_value(pc); ui->cycle_counter->set_value(cycles); + this->set_status(get_waiting, "idle"); } void GUI::onWorkerFetchInfo(const InstrDTO *i) @@ -288,7 +289,6 @@ void GUI::on_step_btn_clicked() this->set_status(get_running, "busy"); int steps = step_values[ui->step_slider->value()]; emit sendRunSteps(steps); - this->set_status(get_waiting, "idle"); } void GUI::on_save_program_state_btn_clicked() diff --git a/gui/gui.h b/gui/gui.h index 5c95db5..830d852 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -138,7 +138,7 @@ class GUI : public QMainWindow /** * The possible step slider values. */ - QVector step_values = {1, 5, 20, 50, 250, 1000, 10000, 100000, 500000}; + QVector step_values = {1, 5, 20, 50, 250, 1000, 10000, 100000, 500000, 100000000}; QThread workerThread; diff --git a/gui/gui.ui b/gui/gui.ui index ec1c23b..67cca60 100644 --- a/gui/gui.ui +++ b/gui/gui.ui @@ -630,7 +630,7 @@ 0 - 8 + 9 1 -- cgit v1.2.3