o3: fix tick used for renaming and issue with range selection

Fixes the tick used from rename:
- previously this gathered the tick on leaving rename which was always 1 less
  than the dispatch. This conflated the decode ticks when back pressure built
  in the pipeline.
- now picks up tick on entry.

Added --store_completions flag:
- will additionally display the store completion tail in the viewer.
- this highlights periods when large numbers of stores are outstanding (>16 LSQ
  blocking)

Allows selection by tick range (previously this caused an infinite loop)
This commit is contained in:
Matt Horsnell
2013-02-15 17:40:09 -05:00
parent 6459908069
commit e88e7d88b9
9 changed files with 111 additions and 58 deletions

View File

@@ -60,6 +60,7 @@
#include "debug/CommitRate.hh"
#include "debug/Drain.hh"
#include "debug/ExecFaulting.hh"
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
#include "sim/faults.hh"
#include "sim/full_system.hh"
@@ -1267,7 +1268,9 @@ DefaultCommit<Impl>::commitHead(DynInstPtr &head_inst, unsigned inst_num)
rob->retireHead(tid);
#if TRACING_ON
head_inst->commitTick = curTick() - head_inst->fetchTick;
if (DTRACE(O3PipeView)) {
head_inst->commitTick = curTick() - head_inst->fetchTick;
}
#endif
// If this was a store, record it for this cycle.

View File

@@ -47,6 +47,7 @@
#include "cpu/inst_seq.hh"
#include "debug/Activity.hh"
#include "debug/Decode.hh"
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
#include "sim/full_system.hh"
@@ -714,7 +715,9 @@ DefaultDecode<Impl>::decodeInsts(ThreadID tid)
--insts_available;
#if TRACING_ON
inst->decodeTick = curTick() - inst->fetchTick;
if (DTRACE(O3PipeView)) {
inst->decodeTick = curTick() - inst->fetchTick;
}
#endif
// Ensure that if it was predicted as a branch, it really is a

View File

@@ -132,6 +132,7 @@ class BaseO3DynInst : public BaseDynInst<Impl>
int32_t issueTick;
int32_t completeTick;
int32_t commitTick;
int32_t storeTick;
#endif
/** Reads a misc. register, including any side-effects the read

View File

@@ -66,26 +66,35 @@ BaseO3DynInst<Impl>::BaseO3DynInst(StaticInstPtr _staticInst,
template <class Impl>BaseO3DynInst<Impl>::~BaseO3DynInst()
{
#if TRACING_ON
Tick val, fetch = this->fetchTick;
// Print info needed by the pipeline activity viewer.
DPRINTFR(O3PipeView, "O3PipeView:fetch:%llu:0x%08llx:%d:%llu:%s\n",
fetch,
this->instAddr(),
this->microPC(),
this->seqNum,
this->staticInst->disassemble(this->instAddr()));
val = (this->decodeTick == -1) ? 0 : fetch + this->decodeTick;
DPRINTFR(O3PipeView, "O3PipeView:decode:%llu\n", val);
val = (this->renameTick == -1) ? 0 : fetch + this->renameTick;
DPRINTFR(O3PipeView, "O3PipeView:rename:%llu\n", val);
val = (this->dispatchTick == -1) ? 0 : fetch + this->dispatchTick;
DPRINTFR(O3PipeView, "O3PipeView:dispatch:%llu\n", val);
val = (this->issueTick == -1) ? 0 : fetch + this->issueTick;
DPRINTFR(O3PipeView, "O3PipeView:issue:%llu\n", val);
val = (this->completeTick == -1) ? 0 : fetch + this->completeTick;
DPRINTFR(O3PipeView, "O3PipeView:complete:%llu\n", val);
val = (this->commitTick == -1) ? 0 : fetch + this->commitTick;
DPRINTFR(O3PipeView, "O3PipeView:retire:%llu\n", val);
if (DTRACE(O3PipeView)) {
Tick fetch = this->fetchTick;
// fetchTick can be -1 if the instruction fetched outside the trace window.
if (fetch != -1) {
Tick val;
// Print info needed by the pipeline activity viewer.
DPRINTFR(O3PipeView, "O3PipeView:fetch:%llu:0x%08llx:%d:%llu:%s\n",
fetch,
this->instAddr(),
this->microPC(),
this->seqNum,
this->staticInst->disassemble(this->instAddr()));
val = (this->decodeTick == -1) ? 0 : fetch + this->decodeTick;
DPRINTFR(O3PipeView, "O3PipeView:decode:%llu\n", val);
val = (this->renameTick == -1) ? 0 : fetch + this->renameTick;
DPRINTFR(O3PipeView, "O3PipeView:rename:%llu\n", val);
val = (this->dispatchTick == -1) ? 0 : fetch + this->dispatchTick;
DPRINTFR(O3PipeView, "O3PipeView:dispatch:%llu\n", val);
val = (this->issueTick == -1) ? 0 : fetch + this->issueTick;
DPRINTFR(O3PipeView, "O3PipeView:issue:%llu\n", val);
val = (this->completeTick == -1) ? 0 : fetch + this->completeTick;
DPRINTFR(O3PipeView, "O3PipeView:complete:%llu\n", val);
val = (this->commitTick == -1) ? 0 : fetch + this->commitTick;
Tick valS = (this->storeTick == -1) ? 0 : fetch + this->storeTick;
DPRINTFR(O3PipeView, "O3PipeView:retire:%llu:store:%llu\n", val, valS);
}
}
#endif
};
@@ -119,6 +128,7 @@ BaseO3DynInst<Impl>::initVars()
issueTick = -1;
completeTick = -1;
commitTick = -1;
storeTick = -1;
#endif
}

View File

@@ -60,6 +60,7 @@
#include "debug/Activity.hh"
#include "debug/Drain.hh"
#include "debug/Fetch.hh"
#include "debug/O3PipeView.hh"
#include "mem/packet.hh"
#include "params/DerivO3CPU.hh"
#include "sim/byteswap.hh"
@@ -1313,7 +1314,9 @@ DefaultFetch<Impl>::fetch(bool &status_change)
numInst++;
#if TRACING_ON
instruction->fetchTick = curTick();
if (DTRACE(O3PipeView)) {
instruction->fetchTick = curTick();
}
#endif
nextPC = thisPC;

View File

@@ -56,6 +56,7 @@
#include "debug/Decode.hh"
#include "debug/Drain.hh"
#include "debug/IEW.hh"
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
using namespace std;
@@ -1611,7 +1612,9 @@ DefaultIEW<Impl>::updateExeInstStats(DynInstPtr &inst)
iewExecutedInsts++;
#if TRACING_ON
inst->completeTick = curTick() - inst->fetchTick;
if (DTRACE(O3PipeView)) {
inst->completeTick = curTick() - inst->fetchTick;
}
#endif
//

View File

@@ -51,6 +51,7 @@
#include "debug/Activity.hh"
#include "debug/IEW.hh"
#include "debug/LSQUnit.hh"
#include "debug/O3PipeView.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
@@ -1137,6 +1138,13 @@ LSQUnit<Impl>::completeStore(int store_idx)
"idx:%i\n",
storeQueue[store_idx].inst->seqNum, store_idx, storeHead);
#if TRACING_ON
if (DTRACE(O3PipeView)) {
storeQueue[store_idx].inst->storeTick =
curTick() - storeQueue[store_idx].inst->fetchTick;
}
#endif
if (isStalled() &&
storeQueue[store_idx].inst->seqNum == stallingStoreIsn) {
DPRINTF(LSQUnit, "Unstalling, stalling store [sn:%lli] "

View File

@@ -49,6 +49,7 @@
#include "cpu/o3/rename.hh"
#include "debug/Activity.hh"
#include "debug/Rename.hh"
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
using namespace std;
@@ -658,9 +659,6 @@ DefaultRename<Impl>::renameInsts(ThreadID tid)
++renamed_insts;
#if TRACING_ON
inst->renameTick = curTick() - inst->fetchTick;
#endif
// Put instruction in rename queue.
toIEW->insts[toIEWIndex] = inst;
@@ -736,6 +734,11 @@ DefaultRename<Impl>::sortInsts()
for (int i = 0; i < insts_from_decode; ++i) {
DynInstPtr inst = fromDecode->insts[i];
insts[inst->threadNumber].push_back(inst);
#if TRACING_ON
if (DTRACE(O3PipeView)) {
inst->renameTick = curTick() - inst->fetchTick;
}
#endif
}
}