From 8c46ba4f216aec9f512cd398317f891be9b07e84 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 30 Mar 2025 14:28:45 -0400 Subject: Add mock stage, proper decode tests --- inc/stage.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'inc/stage.h') diff --git a/inc/stage.h b/inc/stage.h index c0dc6a8..56a3589 100644 --- a/inc/stage.h +++ b/inc/stage.h @@ -28,15 +28,25 @@ 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. -- cgit v1.2.3