From d21a1a9caa1f1791343a5376121936e552b1124c Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 29 Mar 2025 17:11:17 -0400 Subject: Fetch stage properly holds objects until parent is ready --- inc/if.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'inc/if.h') diff --git a/inc/if.h b/inc/if.h index a6869f7..9f84e51 100644 --- a/inc/if.h +++ b/inc/if.h @@ -15,7 +15,17 @@ class IF : public Stage */ IF(Stage *next); - Response advance(InstrDTO &i, Response p) override; + Response advance(InstrDTO &next_instr, Response p) override; + + private: + /** + * Performs a fetch only if a current fetch is not pending. Pending means + * that a fetch has completed successfully, but the caller stage in the + * pipeline is not ready to receive it. In this case, `curr_instr` is not + * the nullptr. + * @return STALLED if we are waiting on the storage devices, OK otherwise. + */ + void fetch_with_buffer(); }; #endif /* IF_H_INCLUDED */ -- cgit v1.2.3