From b81c86b438123457be86af2e7c24375856afa742 Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 26 Mar 2025 12:21:52 -0400 Subject: Add fetch stage implementation, tests, program loading, DTO object --- inc/stage.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'inc/stage.h') 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 @@ -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 */ -- cgit v1.2.3