summaryrefslogtreecommitdiff
path: root/inc/stage.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-26 12:21:52 -0400
committerbd <bdunahu@operationnull.com>2025-03-26 12:21:52 -0400
commitb81c86b438123457be86af2e7c24375856afa742 (patch)
tree74f271585bce27de2434d8cd826fee09f6a71738 /inc/stage.h
parent9eeea1ab8bf4eb17e5da46d57a6c1d455a0a262e (diff)
Add fetch stage implementation, tests, program loading, DTO object
Diffstat (limited to 'inc/stage.h')
-rw-r--r--inc/stage.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/inc/stage.h b/inc/stage.h
index 494f3d3..ac810a9 100644
--- a/inc/stage.h
+++ b/inc/stage.h
@@ -1,6 +1,7 @@
#ifndef STAGE_H
#define STAGE_H
#include "definitions.h"
+#include "instrDTO.h"
#include "response.h"
#include "storage.h"
#include <array>
@@ -8,14 +9,21 @@
class Stage
{
public:
+ /**
+ * Constructor.
+ * @param The next stage in the pipeline.
+ * @return A newly allocated stage object.
+ */
Stage(Stage *next);
virtual ~Stage() = default;
/**
* Advances this stage by a single clock cycle.
+ * @param a DTO object containing various information about an instruction
+ * moving through the pipeline.
* @return a response, indicating whether this pipeline stage is stalled,
* busy, or done.
*/
- virtual Response advance() = 0;
+ virtual Response advance(InstrDTO &i) = 0;
protected:
/**
@@ -37,7 +45,11 @@ class Stage
/**
* A flag indicating whether pipelining should be used.
*/
- bool is_pipelined;
+ static bool is_pipelined;
+ /**
+ * The current clock cycle.
+ */
+ static int clock_cycle;
};
#endif /* STAGE_H_INCLUDED */