From cc2781682a47dc331f7bbcb5d7842db5197d29fc Mon Sep 17 00:00:00 2001 From: Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> Date: Tue, 1 Apr 2025 21:54:38 -0400 Subject: GUI and controller on separate threads --- gui/gui.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'gui/gui.h') diff --git a/gui/gui.h b/gui/gui.h index 1b700cc..77a8867 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -2,6 +2,12 @@ #define GUI_H #include +#include +#include +#include +#include +#include +#include "worker.h" QT_BEGIN_NAMESPACE namespace Ui { @@ -17,7 +23,47 @@ public: GUI(QWidget *parent = nullptr); ~GUI(); +signals: + void sendRefreshDram(); + void sendRefreshCache(); + void sendRefreshRegisters(); + void sendRunSteps(int steps); + void sendRunStep(); + +private slots: + void onWorkerClockCycles(int value, int pc); + + void onWorkerShowDram(const std::vector> data); + + void onWorkerShowCache(const std::vector> data); + + void onWorkerShowRegisters(const std::array &data); + + void onWorkerFinished(); + + void on_upload_intructions_btn_clicked(); + + void on_upload_program_state_btn_clicked(); + + void on_refresh_dram_btn_clicked(); + + void on_refresh_cache_btn_clicked(); + + void on_refresh_registers_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: Ui::GUI *ui; + QThread workerThread; + Worker *worker; }; #endif // GUI_H -- cgit v1.2.3