diff options
author | bd <bdunahu@operationnull.com> | 2025-04-19 04:07:01 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-19 04:07:01 -0400 |
commit | c9b553e68dbd95a8faf5abf4f8e1362261bec99f (patch) | |
tree | 38b40e4c97682286d35d76c00004cbd425fa80bb /gui/worker.h | |
parent | bb3d940fb4ce0dd3efc56b934a7b4ea8ffab4b13 (diff) |
Readd logic to initialize pipeline
Diffstat (limited to 'gui/worker.h')
-rw-r--r-- | gui/worker.h | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/gui/worker.h b/gui/worker.h index df7d9cc..b6332b0 100644 --- a/gui/worker.h +++ b/gui/worker.h @@ -1,49 +1,65 @@ #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 <QObject> +#include <QThread> +#include <deque> -class Worker : public QObject { - Q_OBJECT +class Worker : public QObject +{ + Q_OBJECT -private: - std::vector<Storage*> s; - std::vector<Stage*> p; - Controller *ct; + private: + /** + * The storage objects, stored smallest to largest. + */ + std::deque<Storage *> s; + /** + * The stage objects, starting with fetch. + */ + IF *if_stage; + ID *id_stage; + EX *ex_stage; + MM *mm_stage; + WB *wb_stage; + Controller *ct; -public: - explicit Worker(QObject *parent = nullptr); - ~Worker(); + public: + explicit Worker(QObject *parent = nullptr); + ~Worker(); -public slots: - void refreshDram(); - void refreshCache(); - void refreshRegisters(); - void runSteps(int steps); - void configure(std::vector<unsigned int> ways, bool is_pipelined); + public slots: + void refreshDram(); + void refreshCache(); + void refreshRegisters(); + 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 |