summaryrefslogtreecommitdiff
path: root/gui/worker.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-01 22:07:04 -0400
committerbd <bdunahu@operationnull.com>2025-04-01 22:07:04 -0400
commit05a873027d01cdf6318d67b77a4eaad120b05527 (patch)
tree418621dd347ee8daeaebe7ce83316f21fd736e56 /gui/worker.h
parentd4e3a7a3b1cff6885978093d5cc125e38cc397b3 (diff)
parent24f0bd8af57381ab3112b5774d4ad23ac80f0718 (diff)
Merge remote-tracking branch 'origin/master' into bdunahu
Diffstat (limited to 'gui/worker.h')
-rw-r--r--gui/worker.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/gui/worker.h b/gui/worker.h
new file mode 100644
index 0000000..99ab39a
--- /dev/null
+++ b/gui/worker.h
@@ -0,0 +1,50 @@
+#ifndef WORKER_H
+#define WORKER_H
+
+#include <QObject>
+#include <QThread>
+#include <QDebug>
+
+#include "controller.h"
+#include "dram.h"
+#include "cache.h"
+#include "id.h"
+#include "if.h"
+#include "ex.h"
+#include "mm.h"
+#include "wb.h"
+
+class Worker : public QObject {
+ Q_OBJECT
+
+private:
+ Cache *c;
+ Dram *d;
+ Controller *ct;
+ ID *id_stage;
+ IF *if_stage;
+ EX *ex_stage;
+ MM *mm_stage;
+ WB *wb_stage;
+
+public:
+ explicit Worker(QObject *parent = nullptr);
+ ~Worker();
+
+public slots:
+ void doWork();
+ void refreshDram();
+ void refreshCache();
+ void refreshRegisters();
+ void runSteps(int steps);
+ void runStep();
+
+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 finished();
+};
+
+#endif // WORKER_H \ No newline at end of file