From 2416cce2eec7ecdf0587896620806c465747eada Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 22 Mar 2025 14:19:10 -0400 Subject: Add controller.h, implementation and tests. --- inc/stage.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 inc/stage.h (limited to 'inc/stage.h') diff --git a/inc/stage.h b/inc/stage.h new file mode 100644 index 0000000..769818c --- /dev/null +++ b/inc/stage.h @@ -0,0 +1,35 @@ +#ifndef STAGE_H +#define STAGE_H +#include "definitions.h" +#include "storage.h" +#include + +class Stage +{ + public: + virtual ~Stage() = default; + + protected: + /** + * The shared pool of general-purpose integer registers. + */ + static std::array gprs; + /** + * The address of the currently executing instruction. + */ + static int pc; + /** + * A pointer to the next stage in the pipeline. + */ + Stage *next; + /** + * A pointer to the top-level storage device. + */ + static Storage *storage; + /** + * A flag indicating whether pipelining should be used. + */ + bool is_pipelined; +}; + +#endif /* STAGE_H_INCLUDED */ -- cgit v1.2.3