summaryrefslogtreecommitdiff
path: root/inc/stage.h
diff options
context:
space:
mode:
authorbd <bdunaisky@umass.edu>2025-03-23 17:47:34 +0000
committerGitHub <noreply@github.com>2025-03-23 17:47:34 +0000
commit877aa98855fad77ef93a8c9f5a5e8191fbb9e699 (patch)
tree75d92632f6e9b2f112e45791af9dc01389039557 /inc/stage.h
parent8a0a483c0e63fd2be6f514a20ae7309e2e768c94 (diff)
parentdf2391b70b89f15be7932d18fa77f950fc452f31 (diff)
Merge pull request #30 from bdunahu/bdunahu
Add controller.h, implementation and tests.
Diffstat (limited to 'inc/stage.h')
-rw-r--r--inc/stage.h35
1 files changed, 35 insertions, 0 deletions
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 <array>
+
+class Stage
+{
+ public:
+ virtual ~Stage() = default;
+
+ protected:
+ /**
+ * The shared pool of general-purpose integer registers.
+ */
+ static std::array<int, GPR_NUM> 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 */