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: Fix topdown duplicate statistics load_stall and store_stall #283

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 5 additions & 3 deletions src/cpu/o3/cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,11 @@ CPU::CPUStats::CPUStats(CPU *cpu)

Scheduler* scheduler = cpu->iew.getScheduler();
const auto &stats = scheduler->getStats();
// coreBound = (EXEC_STALL_CYCLE - MEMSTALL_ANYLOAD - MEMSTALL_STORE)/CPU_CYCLE
coreBound = (stats.exec_stall_cycle - stats.memstall_any_load - stats.memstall_any_store) / cpu->baseStats.numCycles;
memoryBound = (stats.memstall_any_load + stats.memstall_any_store) / cpu->baseStats.numCycles;
// coreBound = (EXEC_STALL_CYCLE - MEMSTALL_ANYLOAD - MEMSTALL_STORE + MENSTALL_BOTH_LOAD_STALL)/CPU_CYCLE
coreBound = (stats.exec_stall_cycle - stats.memstall_any_load - stats.memstall_any_store
+ stats.menstall_both_load_stall) / cpu->baseStats.numCycles;
memoryBound = (stats.memstall_any_load + stats.memstall_any_store
- stats.menstall_both_load_stall) / cpu->baseStats.numCycles;
l1Bound = (stats.memstall_any_load - stats.memstall_l1miss) / cpu->baseStats.numCycles;
l2Bound = (stats.memstall_l1miss - stats.memstall_l2miss) / cpu->baseStats.numCycles;
l3Bound = (stats.memstall_l2miss - stats.memstall_l3miss) / cpu->baseStats.numCycles;
Expand Down
13 changes: 11 additions & 2 deletions src/cpu/o3/issue_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -784,17 +784,26 @@ Scheduler::issueAndSelect()
for (auto it : issueQues) {
it->issueToFu();
}
bool mentall_store = false, menstall_load = false;

if (instsToFu.size() < intel_fewops) {
stats.exec_stall_cycle++;
if (lsq->anyStoreNotExecute()) stats.memstall_any_store++;
if (lsq->anyStoreNotExecute()) {
stats.memstall_any_store++;
mentall_store = true;
}
}
if (instsToFu.size() == 0) {
int misslevel = lsq->anyInflightLoadsNotComplete();
if (misslevel != 0) stats.memstall_any_load++;
if (misslevel != 0) {
stats.memstall_any_load++;
menstall_load = true;
}
if ((misslevel & ((1<<1) - 1)) == ((1<<1) - 1)) stats.memstall_l1miss++;
if ((misslevel & ((1<<2) - 1)) == ((1<<2) - 1)) stats.memstall_l2miss++;
if ((misslevel & ((1<<3) - 1)) == ((1<<3) - 1)) stats.memstall_l3miss++;
}
stats.menstall_both_load_stall += (menstall_load && mentall_store);

// must wait for all insts was issued
for (auto it : issueQues) {
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 @@ -222,6 +222,7 @@ class Scheduler : public SimObject
statistics::Scalar memstall_l1miss;
statistics::Scalar memstall_l2miss;
statistics::Scalar memstall_l3miss;
statistics::Scalar menstall_both_load_stall;
} stats;

struct disp_policy
Expand Down