47 #ifndef __CPU_O3_CPU_HH__
48 #define __CPU_O3_CPU_HH__
56 #include "arch/types.hh"
58 #include "config/the_isa.hh"
68 #include "params/DerivO3CPU.hh"
277 this->
itb->demapPage(vaddr, asn);
278 this->
dtb->demapPage(vaddr, asn);
283 this->
itb->demapPage(vaddr, asn);
288 this->
dtb->demapPage(vaddr, asn);
297 void init()
override;
519 std::set<InstSeqNum> snList;
645 return thread[tid]->getTC();
682 return this->
iew.ldstQueue.read(req, sreqLow, sreqHigh, load_idx);
687 uint8_t *
data,
int store_idx)
689 return this->
iew.ldstQueue.write(req, sreqLow, sreqHigh,
733 #endif // __CPU_O3_CPU_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
DcachePort dcachePort
Data port.
DcachePort(LSQ< Impl > *_lsq, FullO3CPU< Impl > *_cpu)
Default constructor.
MasterPort & getDataPort() override
Get the dcache port (used to find block size for translations).
std::vector< ThreadID > tids
Available thread ids in the cpu.
Stats::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
void demapDataPage(Addr vaddr, uint64_t asn)
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
Struct that defines the information passed from IEW to commit.
DefaultRename handles both single threaded and SMT rename.
virtual void recvReqRetry()
Handles doing a retry of a failed fetch.
void setArchFloatReg(int reg_idx, float val, ThreadID tid)
Cycles is a wrapper class for representing cycle counts, i.e.
void syscall(int64_t callnum, ThreadID tid, Fault *fault)
Executes a syscall.
ThreadID getFreeTid()
Gets a free thread id.
const char * description() const
Returns the description of the tick event.
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
void demapInstPage(Addr vaddr, uint64_t asn)
IcachePort icachePort
Instruction port.
System * system
Pointer to the system.
uint64_t readIntReg(int reg_idx)
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
std::vector< Thread * > thread
Pointers to all of the threads in the CPU.
DrainState
Object drain/handover states.
Fault getInterrupts()
Returns the Fault for any valid interrupt.
TickEvent(FullO3CPU< Impl > *c)
Constructs a tick event.
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
Simple physical register file class.
const std::string name() const
Return port name (for DPRINTF).
Stats::Formula ipc
Stat for the IPC per thread.
DefaultIEW handles both single threaded and SMT IEW (issue/execute/writeback).
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
Stats::Scalar intRegfileReads
Fault hwrei(ThreadID tid)
HW return from error interrupt.
CPUPolicy::FetchStruct FetchStruct
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
Stats::Vector committedInsts
Stat for the number of committed instructions per thread.
TheISA::CCReg readArchCCReg(int reg_idx, ThreadID tid)
bool scheduled() const
Determine if the current event is scheduled.
Status _status
Overall CPU status.
CPUPolicy::Decode decode
The decode stage.
void activity()
Records that there is activity this cycle.
BaseO3CPU(BaseCPUParams *params)
CPUPolicy::FreeList freeList
The free list.
Stats::Scalar miscRegfileReads
A vector of scalar stats.
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
DefaultDecode class handles both single threaded and SMT decode.
TheISA::MiscReg readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
uint64_t readArchIntReg(int reg_idx, ThreadID tid)
void setArchIntReg(int reg_idx, uint64_t val, ThreadID tid)
Architectural register accessors.
Stats::Vector committedOps
Stat for the number of committed ops (including micro ops) per thread.
IcachePort(DefaultFetch< Impl > *_fetch, FullO3CPU< Impl > *_cpu)
Default constructor.
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
FullO3CPU(DerivO3CPUParams *params)
Constructs a CPU with the given parameters.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
Declaration of Statistics objects.
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
CPUPolicy::Fetch fetch
The fetch stage.
MasterPort & getInstPort() override
Used by the fetch unit to get a hold of the instruction port.
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
This is a simple scalar statistic, like a counter.
void setMiscRegNoEffect(int misc_reg, const TheISA::MiscReg &val, ThreadID tid)
Sets a miscellaneous register.
void removeFrontInst(DynInstPtr &inst)
Remove an instruction from the front end of the list.
CPUPolicy::ROB rob
The re-order buffer.
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
void drainSanityCheck() const
Perform sanity checks after a drain.
void deactivateStage(const int idx)
Deactivates a stage.
std::map< ThreadID, unsigned > threadMap
Mapping for system thread id to cpu id.
int numActiveThreads()
Returns the Number of Active Threads in the CPU.
Stats::Formula totalCpi
Stat for the total CPI.
DefaultCommit handles single threaded and SMT commit.
void verifyMemoryMode() const override
virtual void recvReqRetry()
Handles doing a retry of the previous send.
Implements a simple scoreboard to track which registers are ready.
void setArchFloatRegInt(int reg_idx, uint64_t val, ThreadID tid)
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
std::list< ThreadID > activeThreads
Active Threads List.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
CPUPolicy::RenameStruct RenameStruct
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
uint64_t Tick
Tick count type.
Stats::Scalar miscRegfileWrites
Stats::Scalar intRegfileWrites
DefaultFetch class handles both single threaded and SMT fetch.
void activateStage(const int idx)
Marks a stage as active.
CPUPolicy::Commit commit
The commit stage.
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
ActivityRecorder helper class that informs the CPU if it can switch over to being idle or not...
CPUPolicy::DecodeStruct DecodeStruct
Addr instAddr(ThreadID tid)
Reads the commit PC of a specific thread.
ProbePointArg< PacketPtr > * ppInstAccessComplete
bool squashed() const
Check whether the event is squashed.
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
Unified register rename map for all classes of registers.
ListIt addInst(DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
MicroPC microPC(ThreadID tid)
Reads the commit micro PC of a specific thread.
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
TheISA::CCReg readCCReg(int reg_idx)
virtual void recvTimingSnoopReq(PacketPtr pkt)
Receive a timing snoop request from the slave port.
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
virtual void recvFunctionalSnoop(PacketPtr pkt)
Receive a functional snoop request packet from the slave port.
void init() override
Initialize the CPU.
void squash()
Squash the current event.
int instcount
Count of total number of dynamic instructions in flight.
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
void activateStage(const StageIdx idx)
Changes a stage's status to active within the activity recorder.
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Fault read(RequestPtr &req, RequestPtr &sreqLow, RequestPtr &sreqHigh, int load_idx)
CPU read function, forwards read to LSQ.
IcachePort class for instruction fetch.
Stats::Scalar fpRegfileReads
int64_t Counter
Statistics counter type.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Stats::Scalar fpRegfileWrites
virtual bool recvTimingResp(PacketPtr pkt)
Timing version of receive.
bool tryDrain()
Check if the pipeline has drained and signal drain done.
Struct that defines the information passed from fetch to decode.
DcachePort class for the load/store queue.
Stats::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
void halt()
Halts the CPU.
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
CPUPolicy::TimeStruct TimeStruct
Typedefs from the Impl to get the structs that each of the time buffers should use.
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
Stats::Formula cpi
Stat for the CPI per thread.
Checker< Impl > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
LSQ< Impl > * lsq
Pointer to LSQ.
FreeList class that simply holds the list of free integer and floating point registers.
void setIntReg(int reg_idx, uint64_t val)
int16_t ThreadID
Thread index/ID type.
TheISA::FloatReg readFloatReg(int reg_idx)
DefaultFetch< Impl > * fetch
Pointer to fetch.
StageIdx
Enum to give each stage a specific index, so when calling activateStage() or deactivateStage(), they can specify which stage is being activated/deactivated.
void switchOut() override
Switches out this CPU.
ProbePointArg generates a point for the class of Arg.
ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
void process()
Processes a tick event, calling tick() on the CPU.
bool simPalCheck(int palFunc, ThreadID tid)
std::ostream CheckpointOut
O3ThreadState< Impl > Thread
InstSeqNum getAndIncrementInstSeq()
Get the current instruction sequence number, and increment it.
::ROB< Impl > ROB
Typedef for the ROB.
PhysRegFile regFile
The register file.
void setMiscReg(int misc_reg, const TheISA::MiscReg &val, ThreadID tid)
Sets a misc.
void dumpInsts()
Debug function to print all instructions on the list.
GenericISA::SimplePCState< MachInst > PCState
void setFloatRegBits(int reg_idx, TheISA::FloatRegBits val)
ActivityRecorder activityRec
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and...
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
void setFloatReg(int reg_idx, TheISA::FloatReg val)
Stats::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
TheISA::FloatRegBits readFloatRegBits(int reg_idx)
virtual bool isSnooping() const
As this CPU requires snooping to maintain the load store queue change the behaviour from the base CPU...
Addr nextInstAddr(ThreadID tid)
Reads the next PC of a specific thread.
uint64_t readArchFloatRegInt(int reg_idx, ThreadID tid)
void setCCReg(int reg_idx, TheISA::CCReg val)
CPUPolicy::RenameMap commitRenameMap[Impl::MaxThreads]
The commit rename map.
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
Stats::Scalar ccRegfileReads
InstSeqNum globalSeqNum
The global sequence number counter.
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
TheISA::MiscReg readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
CPUPolicy::IEWStruct IEWStruct
Scoreboard scoreboard
Integer Register Scoreboard.
Derived ThreadContext class for use with the O3CPU.
void regStats() override
Registers statistics.
Struct that defines the information passed from rename to IEW.
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses...
Struct that defines all backwards communication.
CPUPolicy::IEW iew
The issue/execute/writeback stages.
void setArchCCReg(int reg_idx, TheISA::CCReg val, ThreadID tid)
void demapPage(Addr vaddr, uint64_t asn)
std::list< DynInstPtr >::iterator ListIt
float readArchFloatReg(int reg_idx, ThreadID tid)
FullO3CPU< Impl > * cpu
Pointer to the CPU.
std::vector< TheISA::ISA * > isa
Fault write(RequestPtr &req, RequestPtr &sreqLow, RequestPtr &sreqHigh, uint8_t *data, int store_idx)
CPU write function, forwards write to LSQ.
std::list< DynInstPtr > instList
List of all the instructions in flight.
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
virtual bool recvTimingResp(PacketPtr pkt)
Timing version of receive.
TickEvent tickEvent
The tick event used for scheduling CPU ticks.
void drainResume() override
Resumes execution after a drain.
Impl::DynInstPtr DynInstPtr
O3ThreadState< Impl > ImplState
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
virtual void wakeup(ThreadID tid) override
std::shared_ptr< FaultBase > Fault
std::list< int > cpuWaitList
Threads Scheduled to Enter CPU.
void instDone(ThreadID tid, DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
void updateThreadPriority()
Update The Order In Which We Process Threads.
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
Stats::Formula totalIpc
Stat for the total IPC.
CPUPolicy::RenameMap renameMap[Impl::MaxThreads]
The rename map.
bool isDrained() const
Check if a system is in a drained state.
Struct that defines the information passed from decode to rename.
void deactivateStage(const StageIdx idx)
Changes a stage's status to inactive within the activity recorder.
void pcState(const TheISA::PCState &newPCState, ThreadID tid)
Sets the commit PC state of a specific thread.
FullO3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time ...
void regProbePoints() override
Register probe points.
void activityThisCycle()
Records that there was time buffer activity this cycle.
Stats::Scalar ccRegfileWrites
bool isDraining() const
Is the CPU draining?
CPUPolicy::Rename rename
The dispatch stage.