From ac0ae7206491a42cdba70560b0db41cfc8c7f642 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 29 Mar 2025 12:58:14 -0400 Subject: Add parameter to Stage::advance so status can transfer down the pipe --- inc/controller.h | 2 +- inc/ex.h | 2 +- inc/id.h | 2 +- inc/if.h | 2 +- inc/mm.h | 2 +- inc/stage.h | 6 ++++-- inc/wb.h | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) (limited to 'inc') diff --git a/inc/controller.h b/inc/controller.h index 4b102ce..ac83a78 100644 --- a/inc/controller.h +++ b/inc/controller.h @@ -36,7 +36,7 @@ class Controller : public Stage * @return the pc. */ int get_pc(); - Response advance(InstrDTO &i) override; + Response advance(InstrDTO &i, Response p) override; }; #endif /* CONTROLLER_H_INCLUDED */ diff --git a/inc/ex.h b/inc/ex.h index fef411a..c7b7663 100644 --- a/inc/ex.h +++ b/inc/ex.h @@ -14,7 +14,7 @@ class EX : public Stage */ EX(Stage *next); - Response advance(InstrDTO &i) override; + Response advance(InstrDTO &i, Response p) override; }; #endif /* EX_H_INCLUDED */ diff --git a/inc/id.h b/inc/id.h index 2411402..95dde37 100644 --- a/inc/id.h +++ b/inc/id.h @@ -15,7 +15,7 @@ class ID : public Stage */ ID(Stage *next); - Response advance(InstrDTO &i) override; + Response advance(InstrDTO &i, Response p) override; /** * Parse an instruction into a type, opcode, and fields. If the type is diff --git a/inc/if.h b/inc/if.h index 7906c22..a6869f7 100644 --- a/inc/if.h +++ b/inc/if.h @@ -15,7 +15,7 @@ class IF : public Stage */ IF(Stage *next); - Response advance(InstrDTO &i) override; + Response advance(InstrDTO &i, Response p) override; }; #endif /* IF_H_INCLUDED */ diff --git a/inc/mm.h b/inc/mm.h index 90ebe5a..edee589 100644 --- a/inc/mm.h +++ b/inc/mm.h @@ -14,7 +14,7 @@ class MM : public Stage */ MM(Stage *next); - Response advance(InstrDTO &i) override; + Response advance(InstrDTO &i, Response p) override; }; #endif /* MM_H_INCLUDED */ diff --git a/inc/stage.h b/inc/stage.h index 0348263..761b9f6 100644 --- a/inc/stage.h +++ b/inc/stage.h @@ -22,10 +22,12 @@ class Stage * 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, + * @param a response, indicating whether or not the parent pipe stage is + * busy. + * @return a response, indicating whether this pipeline stage is stalling, * busy, or done. */ - virtual Response advance(InstrDTO &i) = 0; + virtual Response advance(InstrDTO &i, Response p) = 0; protected: /** diff --git a/inc/wb.h b/inc/wb.h index b8f5d8f..c1a6a32 100644 --- a/inc/wb.h +++ b/inc/wb.h @@ -14,7 +14,7 @@ class WB : public Stage */ WB(Stage *next); - Response advance(InstrDTO &i) override; + Response advance(InstrDTO &i, Response p) override; }; #endif /* WB_H_INCLUDED */ -- cgit v1.2.3