summaryrefslogtreecommitdiff
path: root/gui/worker.h
diff options
context:
space:
mode:
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