Skip to content

Commit

Permalink
cpu-o3: change the condition of dispatchInst
Browse files Browse the repository at this point in the history
 now it needs all iqs to be ready

Change-Id: I6efa102dd03a120b8f8d5d63c554445fab7d3906
  • Loading branch information
Llemonade committed Mar 4, 2025
1 parent d865947 commit 965a384
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cpu/o3/iew.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,10 @@ IEW::dispatchInstFromDispQue(ThreadID tid)
bool add_to_iq = false;
int dis_num_inst = 0;

if (!CanDispatch(tid)){
return;
}

for (int i = 0; i < NumDQ; i++) {
int dispatched = 0;
while (!dispQue[i].empty() && dispatched < dispWidth[i]) {
Expand Down Expand Up @@ -1311,6 +1315,12 @@ IEW::dispatchInstFromDispQue(ThreadID tid)
iewStats.dispDist.sample(dis_num_inst);
}

bool
IEW::CanDispatch(ThreadID tid)
{
return scheduler->Allready();
}

void
IEW::printAvailableInsts()
{
Expand Down
3 changes: 3 additions & 0 deletions src/cpu/o3/iew.hh
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ class IEW
* second, receive new inst from rename, store it to DQ
*/
void dispatchInstFromDispQue(ThreadID tid);

bool CanDispatch(ThreadID tid);

void classifyInstToDispQue(ThreadID tid);

/** Executes instructions. In the case of memory operations, it informs the
Expand Down
10 changes: 10 additions & 0 deletions src/cpu/o3/issue_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,16 @@ Scheduler::ready(const DynInstPtr& inst)
DPRINTF(Schedule, "IQ not ready, opclass: %s\n", enums::OpClassStrings[inst->opClass()]);
return false;
}
bool
Scheduler::Allready()
{
for (auto iq :issueQues){
if (!iq->ready()) {
return false;
}
}
return true;
}

bool
Scheduler::full(const DynInstPtr& inst)
Expand Down
1 change: 1 addition & 0 deletions src/cpu/o3/issue_queue.hh
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ class Scheduler : public SimObject
void issueAndSelect();
bool full(const DynInstPtr& inst);
bool ready(const DynInstPtr& inst);
bool Allready();
DynInstPtr getInstByDstReg(RegIndex flatIdx);

void addProducer(const DynInstPtr& inst);
Expand Down

0 comments on commit 965a384

Please sign in to comment.