cpu: Move commit stats from simple to base cpu
Created stat group CommitCPUStats in BaseCPU and copied stats from the simple cpu model. The stats copied from SimpleCPU are numCondCtrlInsts, numFpInsts, numIntInsts, numLoadInsts, numStoreInsts, numVecInsts. Copied committedControl of MinorCPU to BaseCPU::CommittedCPUStats. In MinorCPU, this stat was a 2D vector, where the first dimension is the thread ID. In base it is now a 1D vector that is tied to a thread ID via the commitStats vector. The committedControl stat vector in CommitCPUStats is updated in the same way in all CPU models. The function updateComCtrlStats will update committedControl and the CPU models will call this function instead of updating committedControl directly. This function takes a StaticInstPtr as input, which Simple, Minor, and O3 CPU models are able to provide. Duplicate stat "branches" in O3 commit with BaseCPU::CommittedCPUStats::committedControl::IsControl. O3 commit stats floating, integer, loads, memRefs, vectorInstructions are duplicated by numFpInsts, numIntInsts, numLoadInsts, numMemRefs, numVecInsts from BaseCPU::CommitCPUStats respectively. Implemented numStoreInsts from BaseCPU::commitCPUStats for O3 commit stage. Change-Id: Ie6f176623091159622d53e9899d780f235fce525 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69099 Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
committed by
Bobby Bruce
parent
32b18dcc60
commit
ea2bbe26fc
@@ -408,6 +408,7 @@ BaseSimpleCPU::postExecute()
|
||||
if (curStaticInst->isInteger()){
|
||||
// update both old and new stats
|
||||
executeStats[t_info.thread->threadId()]->numIntAluAccesses++;
|
||||
commitStats[t_info.thread->threadId()]->numIntInsts++;
|
||||
t_info.execContextStats.numIntAluAccesses++;
|
||||
t_info.execContextStats.numIntInsts++;
|
||||
}
|
||||
@@ -416,6 +417,7 @@ BaseSimpleCPU::postExecute()
|
||||
if (curStaticInst->isFloating()){
|
||||
// update both old and new stats
|
||||
executeStats[t_info.thread->threadId()]->numFpAluAccesses++;
|
||||
commitStats[t_info.thread->threadId()]->numFpInsts++;
|
||||
t_info.execContextStats.numFpAluAccesses++;
|
||||
t_info.execContextStats.numFpInsts++;
|
||||
}
|
||||
@@ -424,6 +426,7 @@ BaseSimpleCPU::postExecute()
|
||||
if (curStaticInst->isVector()){
|
||||
// update both old and new stats
|
||||
executeStats[t_info.thread->threadId()]->numVecAluAccesses++;
|
||||
commitStats[t_info.thread->threadId()]->numVecInsts++;
|
||||
t_info.execContextStats.numVecAluAccesses++;
|
||||
t_info.execContextStats.numVecInsts++;
|
||||
}
|
||||
@@ -446,14 +449,22 @@ BaseSimpleCPU::postExecute()
|
||||
|
||||
//result bus acceses
|
||||
if (curStaticInst->isLoad()){
|
||||
// update both old and new stats
|
||||
commitStats[t_info.thread->threadId()]->numLoadInsts++;
|
||||
t_info.execContextStats.numLoadInsts++;
|
||||
}
|
||||
|
||||
if (curStaticInst->isStore() || curStaticInst->isAtomic()){
|
||||
// update both old and new stats
|
||||
commitStats[t_info.thread->threadId()]->numStoreInsts++;
|
||||
t_info.execContextStats.numStoreInsts++;
|
||||
}
|
||||
/* End power model statistics */
|
||||
|
||||
// update both old and new stats
|
||||
commitStats[t_info.thread->threadId()]
|
||||
->committedInstType[curStaticInst->opClass()]++;
|
||||
commitStats[t_info.thread->threadId()]->updateComCtrlStats(curStaticInst);
|
||||
t_info.execContextStats.statExecutedInstType[curStaticInst->opClass()]++;
|
||||
|
||||
if (FullSystem)
|
||||
|
||||
Reference in New Issue
Block a user