From da25748edb6997629ffb380683c8c736f24033a8 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 19 Apr 2025 02:23:03 -0400 Subject: Add custom QWidget to keep track of up to 4 user cache ways --- gui/gui.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'gui/gui.h') diff --git a/gui/gui.h b/gui/gui.h index 85f965a..09fe0d9 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -24,10 +24,18 @@ class GUI : public QMainWindow Q_OBJECT public: + /** + * Constructor. + * @return A newly allocated GUI object. + */ GUI(QWidget *parent = nullptr); ~GUI(); - bool is_pipelined = false; - std::vector ways; + + /** + * Uses `func' to set the current status. + * @param a function which returns a string. + */ + void set_status(const std::function &func); signals: void sendRefreshDram(); @@ -82,11 +90,21 @@ class GUI : public QMainWindow */ std::vector p; + /** + * The current cache configurations. + */ + std::vector c; + + /** + * If this stage is pipelined or not. + */ + bool is_pipelined = false; + QThread workerThread; Worker *worker; - QVector step_values = {1, 5, 10, 50, 250, 1000, 10000}; + QVector step_values = {1, 5, 20, 50, 250, 1000, 10000}; const std::map mnemonicNameMap = { {Mnemonic::ADD, "ADD"}, {Mnemonic::SUB, "SUB"}, @@ -115,6 +133,5 @@ class GUI : public QMainWindow return (it != mnemonicNameMap.end()) ? it->second : "Unknown"; } - QString make_status(const std::function &func); }; #endif // GUI_H -- cgit v1.2.3