From c9b553e68dbd95a8faf5abf4f8e1362261bec99f Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 19 Apr 2025 04:07:01 -0400 Subject: Readd logic to initialize pipeline --- gui/worker.h | 80 ++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 32 deletions(-) (limited to 'gui/worker.h') 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 -#include -#include - +#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 +#include +#include +#include -class Worker : public QObject { - Q_OBJECT +class Worker : public QObject +{ + Q_OBJECT -private: - std::vector s; - std::vector p; - Controller *ct; + private: + /** + * The storage objects, stored smallest to largest. + */ + std::deque 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 ways, bool is_pipelined); + public slots: + void refreshDram(); + void refreshCache(); + void refreshRegisters(); + void runSteps(int steps); + void configure( + std::vector ways, + std::vector program, + bool is_pipelined); -signals: - void clock_cycles(int value, int pc); - void dram_storage(const std::vector> data); - void cache_storage(const std::vector> data); - void register_storage(const std::array data); - void if_info(const std::vector info); - void id_info(const std::vector info); - void ex_info(const std::vector info); - void mm_info(const std::vector info); - void wb_info(const std::vector info); - void finished(); + signals: + void clock_cycles(int value, int pc); + void + dram_storage(const std::vector> data); + void + cache_storage(const std::vector> data); + void register_storage(const std::array data); + void if_info(const std::vector info); + void id_info(const std::vector info); + void ex_info(const std::vector info); + void mm_info(const std::vector info); + void wb_info(const std::vector info); + void finished(); }; #endif // WORKER_H -- cgit v1.2.3