Skip to content
Snippets Groups Projects
Commit 633ad434 authored by Hugues Cassé's avatar Hugues Cassé
Browse files

etime: fixed dependency generation for load/store instruction.

parent 8521b31b
No related branches found
No related tags found
No related merge requests found
......@@ -313,20 +313,24 @@ private:
void addEdgesForMemoryOrder(void) {
static string memory_order = "memory order";
// !!HUG!! Memory stage?
ParExeStage *stage = _proc->execStage();
// looking in turn each FU
for(int i = 0; i< stage->numFus(); i++) {
ParExeStage *fu_stage = stage->fu(i)->firstStage();
ParExeNode * previous_load = NULL;
ParExeNode * previous_store = NULL;
ParExeNode * previous_load = nullptr;
ParExeNode * previous_store = nullptr;
// look for each node of this FU
for(int j = 0; j < fu_stage->numNodes(); j++){
ParExeNode *new_load = previous_load;
ParExeNode *new_store = previous_store;
ParExeNode *node = fu_stage->node(j);
// found a load instruction
if(node->inst()->inst()->isLoad()) {
new_load = node;
// if any, dependency on previous store
if(previous_store)
......@@ -340,6 +344,7 @@ private:
// found a store instruction
if(node->inst()->inst()->isStore()) {
new_store = node;
// if any, dependency on previous store
if(previous_store)
......@@ -354,6 +359,10 @@ private:
if (last_node->stage()->category() == ParExeStage::FU)
previous_store = *last_node;
}
// update previous load and store
previous_load = new_load;
previous_store = new_store;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment