44 #ifndef __CPU_O3_COMMIT_HH__
45 #define __CPU_O3_COMMIT_HH__
55 struct DerivO3CPUParams;
87 typedef typename Impl::O3CPU
O3CPU;
89 typedef typename Impl::CPUPol
CPUPol;
92 typedef typename CPUPol::ROB
ROB;
99 typedef typename CPUPol::Fetch
Fetch;
100 typedef typename CPUPol::IEW
IEW;
165 std::string
name()
const;
533 #endif // __CPU_O3_COMMIT_HH__
const unsigned commitWidth
Commit width, in instructions.
void handleInterrupt()
Handles processing an interrupt.
void regProbePoints()
Registers probes.
const Cycles fetchToCommitDelay
Cycles is a wrapper class for representing cycle counts, i.e.
void setRenameMap(RenameMap rm_ptr[Impl::MaxThreads])
Sets pointer to the commited state rename map.
Stats::Scalar commitEligibleSamples
Number of cycles where the commit bandwidth limit is reached.
bool trapInFlight[Impl::MaxThreads]
Records if there is a trap currently in flight.
Class that has various thread state, such as the status, the current instruction being processed...
TimeBuffer< TimeStruct >::wire toIEW
Wire to write information heading to previous stages.
TheISA::PCState pc[Impl::MaxThreads]
The commit PC state of each thread.
bool drainImminent
Is a drain imminent? Commit has found an instruction boundary while no interrupts were present or in ...
TimeBuffer< FetchStruct >::wire fromFetch
void squashFromTC(ThreadID tid)
Handles squashing due to an TC write.
Addr instAddr(ThreadID tid)
Returns the PC of a specific thread.
const Cycles renameToROBDelay
Rename to ROB delay.
Stats::Vector statComBranches
Total number of committed branches.
Stats::Vector statComSwp
Total number of software prefetches committed.
CPUPol::RenameMap RenameMap
TimeBuffer< FetchStruct > * fetchQueue
const Cycles commitToIEWDelay
Commit to IEW delay.
Stats::Vector statComRefs
Stat for the total number of committed memory references.
CommitStatus
Overall commit status.
void squashFromSquashAfter(ThreadID tid)
Handles a squash from a squashAfter() request.
TimeBuffer< TimeStruct >::wire robInfoFromIEW
Wire to read information from IEW (for ROB).
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the main time buffer pointer, used for backwards communication.
IEW * iewStage
The pointer to the IEW stage.
A vector of scalar stats.
bool tcSquash[Impl::MaxThreads]
Records if a thread has to squash this cycle due to an XC write.
void updateStatus()
Updates the overall status of commit with the nextStatus, and tell the CPU if commit is active/inacti...
Stats::Vector2d statCommittedInstType
Committed instructions by instruction type (OpClass)
bool isDrained() const
Has the stage drained?
void getInsts()
Gets instructions from rename and inserts them into the ROB.
CPUPol::RenameStruct RenameStruct
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets the pointer to the queue coming from rename.
std::string name() const
Returns the name of the DefaultCommit.
bool avoidQuiesceLiveLock
Have we had an interrupt pending and then seen it de-asserted because of a masking change...
DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
Construct a DefaultCommit with the given parameters.
Stats::Vector statComLoads
Stat for the total number of committed loads.
Declaration of Statistics objects.
void tick()
Ticks the commit stage, which tries to commit instructions.
This is a simple scalar statistic, like a counter.
std::list< ThreadID > * activeThreads
Pointer to the list of active threads.
RenameMap * renameMap[Impl::MaxThreads]
Rename map interface.
ThreadID roundRobin()
Returns the thread ID to use based on a round robin policy.
void commitInsts()
Commits as many instructions as possible.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue interface, for ROB.
CPUPol::FetchStruct FetchStruct
DefaultCommit handles single threaded and SMT commit.
void setIEWStage(IEW *iew_stage)
Sets the pointer to the IEW stage.
void drainResume()
Resumes execution after draining.
void propagateInterrupt()
Get fetch redirecting so we can handle an interrupt.
Stats::Vector opsCommitted
Total number of ops (including micro ops) committed.
void generateTrapEvent(ThreadID tid, Fault inst_fault)
Generates an event to schedule a squash due to a trap.
Stats::Vector statComFloating
Total number of floating point instructions.
const Cycles trapLatency
The latency to handle a trap.
Addr microPC(ThreadID tid)
Reads the micro PC of a specific thread.
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
void squashFromTrap(ThreadID tid)
Handles squashing due to a trap.
const unsigned renameWidth
Rename width, in instructions.
TheISA::PCState pcState(ThreadID tid)
Reads the PC of a specific thread.
Stats::Scalar branchMispredicts
Stat for the total number of branch mispredicts that caused a squash.
ThreadID oldestReady()
Returns the thread ID to use based on an oldest instruction policy.
void setThreads(std::vector< Thread * > &threads)
Sets the list of threads.
unsigned numRobs
Number of Reorder Buffers.
Stats::Vector statComMembars
Total number of committed memory barriers.
TimeBuffer< IEWStruct >::wire fromIEW
Wire to read information from IEW queue.
A simple distribution stat.
ThreadStatus commitStatus[Impl::MaxThreads]
Per-thread status.
Stats::Distribution numCommittedDist
Distribution of the number of committed instructions each cycle.
O3ThreadState< Impl > Thread
CPUPol::IEWStruct IEWStruct
void squashAll(ThreadID tid)
Squashes all in flight instructions.
void generateTCEvent(ThreadID tid)
Records that commit needs to initiate a squash due to an external state update through the TC...
O3CPU * cpu
Pointer to O3CPU.
void squashAfter(ThreadID tid, DynInstPtr &head_inst)
Handle squashing from instruction with SquashAfter set.
void regStats()
Registers statistics.
ProbePointArg< DynInstPtr > * ppCommit
Probe Points.
void deactivateThread(ThreadID tid)
Deschedules a thread from scheduling.
void setROB(ROB *rob_ptr)
Sets pointer to the ROB.
bool checkEmptyROB[Impl::MaxThreads]
Records if commit should check if the ROB is truly empty (see commit_impl.hh).
Fault interrupt
The interrupt fault.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void takeOverFrom()
Takes over from another CPU's thread.
ProbePointArg< DynInstPtr > * ppSquash
To probe when an instruction is squashed.
ThreadStatus
Individual thread status.
const Cycles iewToCommitDelay
IEW to Commit delay.
bool changedROBEntries()
Returns if any of the threads have the number of ROB entries changed on this cycle.
bool drainPending
Is a drain pending? Commit is looking for an instruction boundary while there are no pending interrup...
CommitPolicy
Commit policy for SMT mode.
CommitPolicy commitPolicy
Commit policy used in SMT mode.
CPUPol::TimeStruct TimeStruct
TimeBuffer< TimeStruct > * timeBuffer
Time buffer interface.
void drain()
Initializes the draining of commit.
size_t numROBFreeEntries(ThreadID tid)
Returns the number of free ROB entries for a specific thread.
int16_t ThreadID
Thread index/ID type.
InstSeqNum lastCommitedSeqNum[Impl::MaxThreads]
The sequence number of the last commited instruction.
void pcState(const TheISA::PCState &val, ThreadID tid)
Sets the PC of a specific thread.
void drainSanityCheck() const
Perform sanity checks after a drain.
std::list< ThreadID > priority_list
Priority List used for Commit Policy.
bool trapSquash[Impl::MaxThreads]
Records if a thread has to squash this cycle due to a trap.
void commit()
Handles any squashes that are sent from IEW, and adds instructions to the ROB and tries to commit ins...
InstSeqNum youngestSeqNum[Impl::MaxThreads]
The sequence number of the youngest valid instruction in the ROB.
GenericISA::SimplePCState< MachInst > PCState
Stats::Scalar commitNonSpecStalls
Stat for the total number of times commit has had to stall due to a non- speculative instruction reac...
const ThreadID numThreads
Number of Active Threads.
void updateComInstStats(DynInstPtr &inst)
Updates commit stats based on this instruction.
ThreadID getCommittingThread()
Gets the thread to commit, based on the SMT policy.
void setIEWQueue(TimeBuffer< IEWStruct > *iq_ptr)
Sets the pointer to the queue coming from IEW.
Stats::Vector instsCommitted
Total number of instructions committed.
TimeBuffer< RenameStruct >::wire fromRename
Wire to read information from rename queue.
bool committedStores[Impl::MaxThreads]
Records if there were any stores committed this cycle.
Stats::Scalar commitSquashedInsts
Stat for the total number of squashed instructions discarded by commit.
TrapEvent(DefaultCommit< Impl > *_commit, ThreadID _tid)
TimeBuffer< IEWStruct > * iewQueue
IEW instruction queue interface.
A 2-Dimensional vecto of scalar stats.
DynInstPtr squashAfterInst[Impl::MaxThreads]
Instruction passed to squashAfter().
const char * description() const
Return a C string describing the event.
Event class used to schedule a squash due to a trap (fault or interrupt) to happen on a specific cycl...
CommitStatus _nextStatus
Next commit status, to be set at the end of the cycle.
bool wroteToTimeBuffer
Records that commit has written to the time buffer this cycle.
Addr nextInstAddr(ThreadID tid)
Returns the next PC of a specific thread.
Impl::DynInstPtr DynInstPtr
Stats::Vector statComFunctionCalls
Total number of function calls.
DefaultCommit< Impl > * commit
std::shared_ptr< FaultBase > Fault
Stats::Vector statComInteger
Total number of integer instructions.
bool commitHead(DynInstPtr &head_inst, unsigned inst_num)
Tries to commit the head ROB instruction passed in.
CommitStatus _status
Overall commit status.
bool canHandleInterrupts
True if last committed microop can be followed by an interrupt.
void startupStage()
Initializes stage by sending back the number of free entries.
bool changedROBNumEntries[Impl::MaxThreads]
Records if the number of ROB entries has changed this cycle.
ProbePointArg< DynInstPtr > * ppCommitStall
std::vector< Thread * > thread
Vector of all of the threads.
void markCompletedInsts()
Marks completed instructions using information sent from IEW.