Skip to content

Commit

Permalink
Fixed bug in RAT recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziang95 committed Nov 11, 2019
1 parent c52535a commit 48273a3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion InputTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ CDB buffer entries = 1

R1=12, R2=32, F20=3.0
Mem[4]=3.0, Mem[8]=2.0, Mem[12]=1.0, Mem[24]=6.0, Mem[28]=5.0, Mem[32]=4.0

ld F2, 0(R1)
mult.d F4, F2, F20
ld F6, 0(R2)
Expand Down
1 change: 1 addition & 0 deletions ROB.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ROBEntry
opCode code; // Opcode of the operation.
timeLine output; // Output display
int instr_i; // The Correspond instruction index
unordered_map<string, int> bkupRAT;
};

class ROB
Expand Down
6 changes: 2 additions & 4 deletions branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ void branchCtrl::branch_automat()
{
int R_f = CPU_ROB->get_front();
int R_r = CPU_ROB->get_rear();
for (auto m = RAT.begin(); m != RAT.end(); m++)
if (is_prev_index(i, m->second, R_f, R_r))
RAT.erase(m);
ROBEntry *R = CPU_ROB->get_entry(i);
RAT = R->bkupRAT;
main_mem.squash(i);
at_falling_edge(next_vdd);
fCDB.squash(i);
Expand All @@ -72,7 +71,6 @@ void branchCtrl::branch_automat()
fu->squash(i);
for (auto fu : lsUnit)
fu->squash(i);
ROBEntry *R = CPU_ROB->get_entry(i);
R->finished = true;
at_rising_edge(next_vdd);
CPU_ROB->squash(i);
Expand Down
1 change: 1 addition & 0 deletions issue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ void *issue_automat(void *arg)
}
ROBEntry *R = CPU_ROB->get_entry(dest);
R->instr_i = instr_Q->get_head();
R->bkupRAT = RAT;
avai->set_code(tmp->code);
avai->fill_rs(dest, tmp, Qj, Qk, Vj, Vk);
if (BTBEntry* predctr = CPU_BTB.getEntry(R->instr_i))
Expand Down
2 changes: 1 addition & 1 deletion output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void* output_automat(void *args)
cout<<s<<endl;
cout<<endl;
memCell m;
cout<<"INT_REG:\t\t\t\t\tFLP_REG:"<<endl;
cout<<"\tINT_REG:\t\t\t\tFLP_REG:"<<endl;
for (int i = 0; i<REG_NUM/2; i++)
{
stringstream tmp;
Expand Down

0 comments on commit 48273a3

Please sign in to comment.