Go to the documentation of this file.
41 #ifndef __CPU_O3_MEM_DEP_UNIT_HH__
42 #define __CPU_O3_MEM_DEP_UNIT_HH__
47 #include <unordered_map>
48 #include <unordered_set>
55 #include "debug/MemDepUnit.hh"
65 unsigned a = (unsigned)seq_num;
66 unsigned hash = (((
a >> 14) ^ ((
a >> 2) & 0xffff))) & 0x7FFFFFFF;
71 struct BaseO3CPUParams;
77 class InstructionQueue;
192 std::string
name()
const {
return "memdepentry"; }
214 static int memdep_count;
215 static int memdep_insert;
216 static int memdep_erase;
226 typedef std::unordered_map<InstSeqNum, MemDepEntryPtr, SNHash>
MemDepHash;
285 #endif // __CPU_O3_MEM_DEP_UNIT_HH__
This is a simple scalar statistic, like a counter.
void insertBarrierSN(const DynInstPtr &barr_inst)
Inserts the SN of a barrier inst.
int memDeps
Number of memory dependencies that need to be satisfied.
bool hasStoreBarrier() const
Is there an outstanding store barrier that loads must wait on.
~MemDepEntry()
Frees any pointers.
InstructionQueue * iqPtr
Pointer to the IQ.
Memory dependence entries that track memory operations, marking when the instruction is ready to exec...
void insertBarrier(const DynInstPtr &barr_inst)
Inserts a barrier instruction.
bool squashed
If the instruction is squashed.
MemDepUnitStats(statistics::Group *parent)
A standard instruction queue class.
~MemDepUnit()
Frees up any memory allocated.
void completeInst(const DynInstPtr &inst)
Notifies completion of an instruction.
void squash(const InstSeqNum &squashed_num, ThreadID tid)
Squashes all instructions up until a given sequence number for a specific thread.
statistics::Scalar conflictingStores
Stat for number of conflicting stores that had to wait for a store.
std::list< DynInstPtr > instList[MaxThreads]
A list of all instructions in the memory dependence unit.
bool hasLoadBarrier() const
Is there an outstanding load barrier that loads must wait on.
std::list< DynInstPtr > instsToReplay
A list of all instructions that are going to be replayed.
Memory dependency unit class.
statistics::Scalar insertedLoads
Stat for number of inserted loads.
std::unordered_set< InstSeqNum > storeBarrierSNs
Sequence numbers of outstanding store barriers.
std::vector< MemDepEntryPtr > dependInsts
A vector of any dependent instructions.
void issue(const DynInstPtr &inst)
Issues the given instruction.
int id
The thread id of this memory dependence unit.
bool completed
If the instruction is completed.
Implements a store set predictor for determining if memory instructions are dependent upon each other...
gem5::o3::MemDepUnit::MemDepUnitStats stats
void replay()
Replays all instructions that have been rescheduled by moving them to the ready list.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
void setIQ(InstructionQueue *iq_ptr)
Sets the pointer to the IQ.
void moveToReady(MemDepEntryPtr &ready_inst_entry)
Moves an entry to the ready list.
bool isDrained() const
Determine if we are drained.
std::list< DynInstPtr >::iterator ListIt
std::unordered_set< InstSeqNum > loadBarrierSNs
Sequence numbers of outstanding load barriers.
DynInstPtr inst
The instruction being tracked.
void nonSpecInstReady(const DynInstPtr &inst)
Indicate that a non-speculative instruction is ready.
void violation(const DynInstPtr &store_inst, const DynInstPtr &violating_load)
Indicates an ordering violation between a store and a younger load.
statistics::Scalar conflictingLoads
Stat for number of conflicting loads that had to wait for a store.
std::shared_ptr< MemDepEntry > MemDepEntryPtr
size_t operator()(const InstSeqNum &seq_num) const
std::string name() const
Returns the name of the memory dependence entry.
void init(const BaseO3CPUParams ¶ms, ThreadID tid, CPU *cpu)
Initializes the unit with parameters and a thread id.
void wakeDependents(const DynInstPtr &inst)
Wakes any dependents of a memory instruction.
MemDepEntryPtr & findInHash(const DynInstConstPtr &inst)
Finds the memory dependence entry in the hash map.
static constexpr int MaxThreads
void regsReady(const DynInstPtr &inst)
Indicate that an instruction has its registers ready.
void dumpLists()
Debugging function to dump the lists of instructions.
void drainSanityCheck() const
Perform sanity checks after a drain.
ListIt listIt
The iterator to the instruction's location inside the list.
void completed(const DynInstPtr &inst)
Completes a memory instruction.
void insertNonSpec(const DynInstPtr &inst)
Inserts a non-speculative memory instruction.
std::string name() const
Returns the name of the memory dependence unit.
statistics::Scalar insertedStores
Stat for number of inserted stores.
void takeOverFrom()
Takes over from another CPU's thread.
MemDepHash memDepHash
A hash map of all memory dependence entries.
MemDepUnit()
Empty constructor.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::unordered_map< InstSeqNum, MemDepEntryPtr, SNHash > MemDepHash
StoreSet depPred
The memory dependence predictor.
MemDepHash::iterator MemDepHashIt
bool regsReady
If the registers are ready or not.
void insert(const DynInstPtr &inst)
Inserts a memory instruction.
MemDepEntry(const DynInstPtr &new_inst)
Constructs a memory dependence entry.
int16_t ThreadID
Thread index/ID type.
void reschedule(const DynInstPtr &inst)
Reschedules an instruction to be re-executed.
Generated on Sun Jul 30 2023 01:56:53 for gem5 by doxygen 1.8.17