summaryrefslogtreecommitdiff
path: root/inc/if.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-29 22:14:42 -0400
committerGitHub <noreply@github.com>2025-03-29 22:14:42 -0400
commitd20623d031cf909d8892c2db38cf2e2e02bc6a9b (patch)
tree56ef4ae4325a5b803c484a3e5c8d87b89572cedf /inc/if.h
parentcaeff52f029920e027d18bc01149425560801f82 (diff)
parent1250c3765f59801d060152d5f6eed0a9faa11b50 (diff)
Merge pull request #37 from bdunahu/bdunahu
Instr, InstrDTO gets/sets, other structures required for decode -- tests as we move forward -- base classes -- decode stage implemented
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 */