summaryrefslogtreecommitdiff
path: root/inc/if.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/if.h')
-rw-r--r--inc/if.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/inc/if.h b/inc/if.h
index 437fa8d..3fafe53 100644
--- a/inc/if.h
+++ b/inc/if.h
@@ -1,5 +1,6 @@
#ifndef IF_H
#define IF_H
+#include "accessor.h"
#include "instrDTO.h"
#include "response.h"
#include "stage.h"
@@ -7,15 +8,24 @@
class IF : public Stage
{
public:
- using Stage::Stage;
+ /**
+ * Constructor.
+ * @param The next stage in the pipeline.
+ * @return A newly allocated IF object.
+ */
+ IF(Stage *next);
- Response advance(InstrDTO &i) override;
+ Response advance(InstrDTO &next_instr, Response p) override;
private:
/**
- * The name this pipeline stages uses to access storage.
+ * 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.
*/
- const Accessor id = FETCH;
+ void advance_helper();
};
#endif /* IF_H_INCLUDED */