Skip to content

add more changes - not working #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: feature-arya-dependency_graph_caching
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions src/cpu/o3/dep_graph.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ class DependencyEntry
{
public:
DependencyEntry()
: inst(NULL), next(NULL)
: inst(NULL), next(NULL), more(0)
{ }

DynInstPtr inst;
//Might want to include data about what arch. register the
//dependence is waiting on.
DependencyEntry<DynInstPtr> *next;
int more;
};

/** Array of linked list that maintains the dependencies between
Expand Down Expand Up @@ -95,10 +96,16 @@ class DependencyGraph
/** Inserts an instruction to be dependent on the given index. */
void insert(RegIndex idx, const DynInstPtr &new_inst);

void insert(RegIndex idx, const DynInstPtr &new_inst, const int more);

/** Sets the producing instruction of a given register. */
void setInst(RegIndex idx, const DynInstPtr &new_inst)
{ dependGraph[idx].inst = new_inst; }

const DynInstPtr &getInst(RegIndex idx) {
return dependGraph[idx].inst;
}

/** Clears the producing instruction. */
void clearInst(RegIndex idx)
{ dependGraph[idx].inst = NULL; }
Expand Down Expand Up @@ -139,7 +146,7 @@ class DependencyGraph
}
}

private:
public:
/** Array of linked lists. Each linked list is a list of all the
* instructions that depend upon a given register. The actual
* register's index is used to index into the graph; ie all
Expand Down Expand Up @@ -222,6 +229,25 @@ DependencyGraph<DynInstPtr>::insert(RegIndex idx, const DynInstPtr &new_inst)
++memAllocCounter;
}

template <class DynInstPtr>
void
DependencyGraph<DynInstPtr>::insert(RegIndex idx, const DynInstPtr &new_inst, const int more)
{
//Add this new, dependent instruction at the head of the dependency
//chain.

// First create the entry that will be added to the head of the
// dependency chain.
DepEntry *new_entry = new DepEntry;
new_entry->next = dependGraph[idx].next;
new_entry->inst = new_inst;
new_entry->more = more;

// Then actually add it to the chain.
dependGraph[idx].next = new_entry;

++memAllocCounter;
}

template <class DynInstPtr>
void
Expand Down
23 changes: 19 additions & 4 deletions src/cpu/o3/dyn_inst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ DynInst::DynInst(const Arrays &arrays, const StaticInstPtr &static_inst,
cpu->dumpInsts();
dumpSNList();
#endif
assert(cpu->instcount <= 1500);
// assert(cpu->instcount <= 1500);
}

DPRINTF(DynInst,
Expand Down Expand Up @@ -304,9 +304,24 @@ DynInst::dump(std::string &outstring)
void
DynInst::markSrcRegReady()
{
DPRINTF(IQ, "[sn:%lli] has %d ready out of %d sources. RTI %d)\n",
seqNum, readyRegs+1, numSrcRegs(), readyToIssue());
if (++readyRegs == numSrcRegs()) {
int numRegsReady = 0;

// for (int i = 0; i < numSrcRegs(); i++) {
// if (readySrcIdx(renamedSrcIdx(i)->index())) {
// numRegsReady++;
// }
// }

// if (numRegsReady == numSrcRegs()) {
// setCanIssue();
// }

DPRINTF(IQ, "[sn:%lli] has actual: %d vs fake: %d ready out of %d sources. RTI %d)\n",
seqNum, numRegsReady, readyRegs+1, numSrcRegs(), readyToIssue());

++readyRegs;

if (readyRegs == numSrcRegs()) {
setCanIssue();
}
}
Expand Down
Loading