Skip to content
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

cpu-o3: change the condition of dispatchInst #312

Open
wants to merge 1 commit into
base: xs-dev
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
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
Loading