1 //===---------------------- RetireStage.h -----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// This file defines the retire stage of an instruction pipeline.
12 /// The RetireStage represents the process logic that interacts with the
13 /// simulated RetireControlUnit hardware.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H
18 #define LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H
20 #include "RegisterFile.h"
21 #include "RetireControlUnit.h"
26 class RetireStage : public Stage {
27 // Owner will go away when we move listeners/eventing to the stages.
28 RetireControlUnit &RCU;
32 RetireStage(RetireControlUnit &R, RegisterFile &F)
33 : Stage(), RCU(R), PRF(F) {}
34 RetireStage(const RetireStage &Other) = delete;
35 RetireStage &operator=(const RetireStage &Other) = delete;
37 virtual bool hasWorkToComplete() const override final {
38 return !RCU.isEmpty();
40 virtual void cycleStart() override final;
41 virtual bool execute(InstRef &IR) override final { return true; }
42 void notifyInstructionRetired(const InstRef &IR);
43 void onInstructionExecuted(unsigned TokenID);
48 #endif // LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H