41#ifndef __CPU_O3_DEP_GRAPH_HH__
42#define __CPU_O3_DEP_GRAPH_HH__
53template <
class DynInstPtr>
76template <
class DynInstPtr>
144template <
class DynInstPtr>
149template <
class DynInstPtr>
157template <
class DynInstPtr>
186template <
class DynInstPtr>
197 new_entry->
inst = new_inst;
206template <
class DynInstPtr>
225 while (curr->
inst != inst_to_remove) {
230 assert(curr != NULL);
244template <
class DynInstPtr>
261template <
class DynInstPtr>
272template <
class DynInstPtr>
283 cprintf(
"dependGraph[%i]: producer: %s [sn:%lli] consumer: ",
286 cprintf(
"dependGraph[%i]: No producer. consumer: ",
i);
289 while (curr->
next != NULL) {
DependencyEntry< DynInstPtr > * next
void clearInst(RegIndex idx)
Clears the producing instruction.
DependencyGraph()
Default construction.
void insert(RegIndex idx, const DynInstPtr &new_inst)
Inserts an instruction to be dependent on the given index.
bool empty(RegIndex idx) const
Checks if there are any dependents on a specific register.
bool empty() const
Checks if the entire dependency graph is empty.
void remove(RegIndex idx, const DynInstPtr &inst_to_remove)
Removes an instruction from a single linked list.
void reset()
Clears all of the linked lists.
int numEntries
Number of linked lists; identical to the number of registers.
DynInstPtr pop(RegIndex idx)
Removes and returns the newest dependent of a specific register.
void resize(int num_entries)
Resize the dependency graph to have num_entries registers.
std::vector< DepEntry > dependGraph
Array of linked lists.
void setInst(RegIndex idx, const DynInstPtr &new_inst)
Sets the producing instruction of a given register.
void dump()
Debugging function to dump out the dependency graph.
DependencyEntry< DynInstPtr > DepEntry
const PCStateBase & pcState() const override
Read the PC state of this instruction.
InstSeqNum seqNum
The sequence number of the instruction.
RefCountingPtr< DynInst > DynInstPtr
Copyright (c) 2024 Arm Limited All rights reserved.
void cprintf(const char *format, const Args &...args)