summaryrefslogtreecommitdiff
path: root/gui/worker.h
diff options
context:
space:
mode:
authorbd <bdunaisky@umass.edu>2025-04-21 20:01:34 +0000
committerGitHub <noreply@github.com>2025-04-21 20:01:34 +0000
commit282e2644ef0470133184fdf9900cf2565ec5332b (patch)
tree43238110a03ce678f1a68b0b4175ae023527b070 /gui/worker.h
parent4a19129e8499bc187ef6e296e050cc8a20bcc2d3 (diff)
parentd933a0405b7a7dff3cf05839ac99d120cafa4d75 (diff)
Merge pull request #56 from bdunahu/dev-sid
Dev sid
Diffstat (limited to 'gui/worker.h')
-rw-r--r--gui/worker.h90
1 files changed, 51 insertions, 39 deletions
diff --git a/gui/worker.h b/gui/worker.h
index 7512b9b..62c8d84 100644
--- a/gui/worker.h
+++ b/gui/worker.h
@@ -18,56 +18,68 @@
#ifndef WORKER_H
#define WORKER_H
-#include <QObject>
-#include <QThread>
-#include <QDebug>
-
+#include "cache.h"
#include "controller.h"
#include "dram.h"
-#include "cache.h"
+#include "ex.h"
#include "id.h"
#include "if.h"
-#include "ex.h"
#include "mm.h"
#include "wb.h"
+#include <QDebug>
+#include <QMutex>
+#include <QObject>
+#include <QThread>
+#include <deque>
+
+class Worker : public QObject
+{
+ Q_OBJECT
+
+ private:
+ /**
+ * The storage objects, stored smallest to largest.
+ */
+ std::deque<Storage *> s;
+ IF *if_stage;
+ ID *id_stage;
+ EX *ex_stage;
+ MM *mm_stage;
+ WB *wb_stage;
-class Worker : public QObject {
- Q_OBJECT
+ Controller *ct = nullptr;
+ QMutex ct_mutex;
-private:
- Cache *c;
- Dram *d;
- Controller *ct;
- ID *id_stage;
- IF *if_stage;
- EX *ex_stage;
- MM *mm_stage;
- WB *wb_stage;
+ /**
+ * The size each progressive cache level increases by.
+ */
+ unsigned int size_inc;
-public:
- explicit Worker(QObject *parent = nullptr);
- ~Worker();
+ public:
+ explicit Worker(QObject *parent = nullptr);
+ ~Worker();
+ QMutex &get_ct_mutex() { return ct_mutex; }
-public slots:
- void doWork();
- void refreshDram();
- void loadProgram(std::vector<signed int> p);
- void refreshCache();
- void refreshRegisters();
- void runSteps(int steps);
- void runStep();
+ public slots:
+ void runSteps(int steps);
+ void configure(
+ std::vector<unsigned int> ways,
+ std::vector<signed int> program,
+ bool is_pipelined);
-signals:
- void clock_cycles(int value, int pc);
- void dram_storage(const std::vector<std::array<signed int, LINE_SIZE>> data);
- void cache_storage(const std::vector<std::array<signed int, LINE_SIZE>> data);
- void register_storage(const std::array<int, GPR_NUM> data);
- void if_info(const std::vector<int> info);
- void id_info(const std::vector<int> info);
- void ex_info(const std::vector<int> info);
- void mm_info(const std::vector<int> info);
- void wb_info(const std::vector<int> info);
- void finished();
+ signals:
+ void clock_cycles(int value, int pc);
+ void
+ dram_storage(const std::vector<std::array<signed int, LINE_SIZE>> data);
+ void
+ cache_storage(const std::vector<std::array<signed int, LINE_SIZE>> data);
+ void register_storage(const std::array<int, GPR_NUM> data);
+ void if_info(const std::vector<int> info);
+ void id_info(const std::vector<int> info);
+ void ex_info(const std::vector<int> info);
+ void mm_info(const std::vector<int> info);
+ void wb_info(const std::vector<int> info);
+ void finished();
};
#endif // WORKER_H