summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-18 19:03:35 -0400
committerbd <bdunahu@operationnull.com>2025-04-18 19:03:35 -0400
commit80063914f09975f24451ce1acb9875cea0d2d384 (patch)
tree10973bf14631925f9432eaf3bf137de3b2339102
parent2f239d57373ed8fba5d94ed3b5a85ff33acf3734 (diff)
Remove run_steps button
-rw-r--r--gui/gui.cc23
-rw-r--r--gui/gui.h20
-rw-r--r--gui/worker.cc22
-rw-r--r--gui/worker.h7
4 files changed, 18 insertions, 54 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index b7f3d8a..e2e7beb 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -54,9 +54,6 @@ GUI::GUI(QWidget *parent)
// Refresh Registers from worker thread
connect(this, &GUI::sendRefreshRegisters, worker, &Worker::refreshRegisters, Qt::QueuedConnection);
- // Advance controller by #steps
- connect(this, &GUI::sendRunSteps, worker, &Worker::runSteps, Qt::QueuedConnection);
-
// Advance controller by 1 step
connect(this, &GUI::sendRunStep, worker, &Worker::runStep, Qt::QueuedConnection);
@@ -274,7 +271,7 @@ void GUI::on_set_levels_btn_clicked()
{
qDebug() << "Set levels button clicked.";
bool ok;
- int value = QInputDialog::getInt(this, "Enter Value", "Enter value:",
+ int value = QInputDialog::getInt(this, "Enter Value", "Enter value:",
0,
0, 10, 1, &ok);
if (ok) {
@@ -284,7 +281,7 @@ void GUI::on_set_levels_btn_clicked()
ui->cache_levels_dropdwn->addItem(QString::number(i));
ways.push_back(2);
size.push_back(5);
- }
+ }
} else {
qDebug() << "User cancelled input.";
}
@@ -305,7 +302,6 @@ void GUI::on_set_cache_btn_clicked() {
// }
}
-
void GUI::on_enable_pipeline_checkbox_checkStateChanged(const Qt::CheckState &arg1)
{
//TODO: handle pipeline enabling
@@ -318,7 +314,6 @@ void GUI::on_enable_pipeline_checkbox_checkStateChanged(const Qt::CheckState &ar
}
}
-
void GUI::on_enabl_cache_checkbox_checkStateChanged(const Qt::CheckState &arg1)
{
//TODO: handle cache enabling
@@ -326,27 +321,18 @@ void GUI::on_enabl_cache_checkbox_checkStateChanged(const Qt::CheckState &arg1)
qDebug() << "enable cache checkbox checked.";
is_cache_enabled = true;
} else {
- qDebug() << "enable cache checkbox unchecked.";
- is_cache_enabled = false;
+ qDebug() << "enable cache checkbox unchecked.";
+ is_cache_enabled = false;
}
}
-
-void GUI::on_run_steps_btn_clicked()
-{
- qDebug() << "Run steps button clicked.";
- emit sendRunSteps(ui->number_steps_inp->text().toInt());
-}
-
-
void GUI::on_step_btn_clicked()
{
qDebug() << "Run step button clicked.";
emit sendRunStep();
}
-
void GUI::on_save_program_state_btn_clicked()
{
//TODO: save program state
@@ -358,4 +344,3 @@ void GUI::on_Configure_Btn_clicked()
emit sendConfigure(ways, size, is_pipelined, is_cache_enabled);
QMessageBox::information(ui->register_table, "Pipeline Configuration", "Pipeline and memory subsystem configured successfully!");
}
-
diff --git a/gui/gui.h b/gui/gui.h
index c25ab93..ee871a1 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -55,29 +55,27 @@ private slots:
void onWorkerShowDram(const std::vector<std::array<signed int, LINE_SIZE>> data);
void onWorkerShowCache(const std::vector<std::array<signed int, LINE_SIZE>> data);
-
+
void onWorkerShowRegisters(const std::array<int, GPR_NUM> &data);
-
+
void onWorkerFinished();
-
+
void on_upload_intructions_btn_clicked();
-
+
void on_upload_program_state_btn_clicked();
void on_Configure_Btn_clicked();
-
+
void on_set_levels_btn_clicked();
void on_set_cache_btn_clicked();
-
+
void on_enable_pipeline_checkbox_checkStateChanged(const Qt::CheckState &arg1);
-
+
void on_enabl_cache_checkbox_checkStateChanged(const Qt::CheckState &arg1);
-
- void on_run_steps_btn_clicked();
-
+
void on_step_btn_clicked();
-
+
void on_save_program_state_btn_clicked();
private:
diff --git a/gui/worker.cc b/gui/worker.cc
index 2612eb1..4465268 100644
--- a/gui/worker.cc
+++ b/gui/worker.cc
@@ -8,7 +8,7 @@ void Worker::configure(std::vector<int> ways, std::vector<int> size, bool is_pip
setSize(size);
qDebug() << "is cache enabled:" << is_cache_enabled;
qDebug() << "is pipelined:" << is_pipelined;
- this->cache_enabled = is_cache_enabled;
+ this->cache_enabled = is_cache_enabled;
if (!is_cache_enabled || ways.size() == 0) {
this->ct = new Controller(wb_stage, this->d, is_pipelined);
} else {
@@ -46,7 +46,7 @@ std::vector<int> Worker::getSize() {
void Worker::doWork()
{
qDebug() << "Initializing...";
-
+
this->if_stage = new IF(nullptr);
this->id_stage = new ID(if_stage);
this->ex_stage = new EX(id_stage);
@@ -90,24 +90,6 @@ void Worker::refreshRegisters()
emit register_storage(this->ct->get_gprs());
}
-void Worker::runSteps(int steps)
-{
- qDebug() << "Running for steps: " << steps;
- this->ct->run_for(steps);
- emit dram_storage(this->d->view(0, 255));
- if(this->cache_enabled && getWays().size() > 0) {
- unsigned int size = this->c.at(getWays().size()-1)->get_size();
- emit cache_storage(this->c.at(getWays().size()-1)->view(0, 1<<size));
- }
- emit register_storage(this->ct->get_gprs());
- emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc());
- emit if_info(this->if_stage->stage_info());
- emit id_info(this->id_stage->stage_info());
- emit ex_info(this->ex_stage->stage_info());
- emit mm_info(this->mm_stage->stage_info());
- emit wb_info(this->wb_stage->stage_info());
-}
-
void Worker::runStep()
{
qDebug() << "Running for 1 step ";
diff --git a/gui/worker.h b/gui/worker.h
index fe539fe..60bbce3 100644
--- a/gui/worker.h
+++ b/gui/worker.h
@@ -43,9 +43,8 @@ public slots:
void refreshDram();
void loadProgram(std::vector<signed int> p);
void configure(std::vector<int> ways, std::vector<int> size, bool is_pipelined, bool is_cache_enabled);
- void refreshCache();
- void refreshRegisters();
- void runSteps(int steps);
+ void refreshCache();
+ void refreshRegisters();
void runStep();
signals:
@@ -61,4 +60,4 @@ signals:
void finished();
};
-#endif // WORKER_H \ No newline at end of file
+#endif // WORKER_H