summaryrefslogtreecommitdiff
path: root/inc/stage.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-30 14:28:45 -0400
committerbd <bdunahu@operationnull.com>2025-03-30 14:28:45 -0400
commit8c46ba4f216aec9f512cd398317f891be9b07e84 (patch)
treecb502366f721c6bca60becc309fd9de288769d87 /inc/stage.h
parent916949133a5797772dcd6966e469c12230ffc3fa (diff)
Add mock stage, proper decode tests
Diffstat (limited to 'inc/stage.h')
-rw-r--r--inc/stage.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/inc/stage.h b/inc/stage.h
index c0dc6a8..56a3589 100644
--- a/inc/stage.h
+++ b/inc/stage.h
@@ -28,16 +28,26 @@ class Stage
virtual ~Stage();
/**
* Advances this stage by a single clock cycle.
+ * A boilerplate version is provided in stage.cc.
+ *
* @param a DTO object containing the next instruction to be processed.
* @param a response, indicating whether or not the parent pipe stage is
* ready to accept a new instruction object next cycle.
* @return a response, indicating whether this pipeline stage is stalling,
* busy, or done.
+ *
+ * Must set the status to STALLED when an operation completes.
*/
- virtual InstrDTO *advance(Response p) = 0;
+ virtual InstrDTO *advance(Response p);
protected:
/**
+ * The function expected to do the majority of the work.
+ *
+ * Must set the status to OK when an operation is ready.
+ */
+ virtual void advance_helper() = 0;
+ /**
* Sets the bit in the condition code register corresponding to `c`.
* @param the condition code to set.
* @param the truthy value to set it to.