summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resources
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2011-01-07 21:50:29 -0800
committerSteve Reinhardt <steve.reinhardt@amd.com>2011-01-07 21:50:29 -0800
commit6f1187943cf78c2fd0334bd7e4372ae79a587fa4 (patch)
tree8d0eac2e2f4d55d48245266d3930ad4e7f92030f /src/cpu/inorder/resources
parentc22be9f2f016872b05d65c82055ddc936b4aa075 (diff)
downloadgem5-6f1187943cf78c2fd0334bd7e4372ae79a587fa4.tar.xz
Replace curTick global variable with accessor functions.
This step makes it easy to replace the accessor functions (which still access a global variable) with ones that access per-thread curTick values.
Diffstat (limited to 'src/cpu/inorder/resources')
-rw-r--r--src/cpu/inorder/resources/branch_predictor.cc4
-rw-r--r--src/cpu/inorder/resources/cache_unit.cc8
-rw-r--r--src/cpu/inorder/resources/execution_unit.cc6
-rw-r--r--src/cpu/inorder/resources/fetch_seq_unit.cc4
-rw-r--r--src/cpu/inorder/resources/graduation_unit.cc6
-rw-r--r--src/cpu/inorder/resources/mult_div_unit.cc4
6 files changed, 16 insertions, 16 deletions
diff --git a/src/cpu/inorder/resources/branch_predictor.cc b/src/cpu/inorder/resources/branch_predictor.cc
index 33b67ce4a..dc036df64 100644
--- a/src/cpu/inorder/resources/branch_predictor.cc
+++ b/src/cpu/inorder/resources/branch_predictor.cc
@@ -80,7 +80,7 @@ BranchPredictor::execute(int slot_num)
case PredictBranch:
{
if (inst->seqNum > cpu->squashSeqNum[tid] &&
- curTick == cpu->lastSquashCycle[tid]) {
+ curTick() == cpu->lastSquashCycle[tid]) {
DPRINTF(InOrderStage, "[tid:%u]: [sn:%i]: squashed, "
"skipping prediction \n", tid, inst->seqNum);
} else {
@@ -125,7 +125,7 @@ BranchPredictor::execute(int slot_num)
case UpdatePredictor:
{
if (inst->seqNum > cpu->squashSeqNum[tid] &&
- curTick == cpu->lastSquashCycle[tid]) {
+ curTick() == cpu->lastSquashCycle[tid]) {
DPRINTF(InOrderStage, "[tid:%u]: [sn:%i]: squashed, "
"skipping branch predictor update \n",
tid, inst->seqNum);
diff --git a/src/cpu/inorder/resources/cache_unit.cc b/src/cpu/inorder/resources/cache_unit.cc
index 5f9ddd372..bb4caf48a 100644
--- a/src/cpu/inorder/resources/cache_unit.cc
+++ b/src/cpu/inorder/resources/cache_unit.cc
@@ -63,7 +63,7 @@ Tick
CacheUnit::CachePort::recvAtomic(PacketPtr pkt)
{
panic("CacheUnit::CachePort doesn't expect recvAtomic callback!");
- return curTick;
+ return curTick();
}
void
@@ -167,7 +167,7 @@ CacheUnit::getSlot(DynInstPtr inst)
if (new_slot == -1)
return -1;
- inst->memTime = curTick;
+ inst->memTime = curTick();
setAddrDependency(inst);
return new_slot;
} else {
@@ -343,7 +343,7 @@ CacheUnit::getRequest(DynInstPtr inst, int stage_num, int res_idx,
break;
default:
- panic("%i: Unexpected request type (%i) to %s", curTick,
+ panic("%i: Unexpected request type (%i) to %s", curTick(),
sched_entry->cmd, name());
}
@@ -482,7 +482,7 @@ CacheUnit::read(DynInstPtr inst, Addr addr,
if (secondAddr > addr && !inst->split2ndAccess) {
DPRINTF(InOrderCachePort, "%i: sn[%i] Split Read Access (1 of 2) for "
- "(%#x, %#x).\n", curTick, inst->seqNum, addr, secondAddr);
+ "(%#x, %#x).\n", curTick(), inst->seqNum, addr, secondAddr);
// Save All "Total" Split Information
// ==============================
diff --git a/src/cpu/inorder/resources/execution_unit.cc b/src/cpu/inorder/resources/execution_unit.cc
index 4342042e9..9ba7a64c7 100644
--- a/src/cpu/inorder/resources/execution_unit.cc
+++ b/src/cpu/inorder/resources/execution_unit.cc
@@ -55,7 +55,7 @@ ExecutionUnit::regStats()
.name(name() + ".predictedNotTakenIncorrect")
.desc("Number of Branches Incorrectly Predicted As Not Taken).");
- lastExecuteCycle = curTick;
+ lastExecuteCycle = curTick();
executions
.name(name() + ".executions")
@@ -98,8 +98,8 @@ ExecutionUnit::execute(int slot_num)
{
case ExecuteInst:
{
- if (curTick != lastExecuteCycle) {
- lastExecuteCycle = curTick;
+ if (curTick() != lastExecuteCycle) {
+ lastExecuteCycle = curTick();
}
diff --git a/src/cpu/inorder/resources/fetch_seq_unit.cc b/src/cpu/inorder/resources/fetch_seq_unit.cc
index 3bfe912e7..7fd57cc75 100644
--- a/src/cpu/inorder/resources/fetch_seq_unit.cc
+++ b/src/cpu/inorder/resources/fetch_seq_unit.cc
@@ -210,13 +210,13 @@ FetchSeqUnit::squash(DynInstPtr inst, int squash_stage,
}
if (squashSeqNum[tid] <= done_seq_num &&
- lastSquashCycle[tid] == curTick) {
+ lastSquashCycle[tid] == curTick()) {
DPRINTF(InOrderFetchSeq, "[tid:%i]: Ignoring squash from stage %i, "
"since there is an outstanding squash that is older.\n",
tid, squash_stage);
} else {
squashSeqNum[tid] = done_seq_num;
- lastSquashCycle[tid] = curTick;
+ lastSquashCycle[tid] = curTick();
// If The very next instruction number is the done seq. num,
// then we haven't seen the delay slot yet ... if it isn't
diff --git a/src/cpu/inorder/resources/graduation_unit.cc b/src/cpu/inorder/resources/graduation_unit.cc
index a9b96a49f..9d19c2eef 100644
--- a/src/cpu/inorder/resources/graduation_unit.cc
+++ b/src/cpu/inorder/resources/graduation_unit.cc
@@ -64,8 +64,8 @@ GraduationUnit::execute(int slot_num)
// @TODO: Instructions should never really get to this point since
// this should be handled through the request interface. Check to
// make sure this happens and delete this code.
- if (lastCycleGrad != curTick) {
- lastCycleGrad = curTick;
+ if (lastCycleGrad != curTick()) {
+ lastCycleGrad = curTick();
numCycleGrad = 0;
} else if (numCycleGrad > width) {
DPRINTF(InOrderGraduation,
@@ -91,7 +91,7 @@ GraduationUnit::execute(int slot_num)
}
if (inst->traceData) {
- inst->traceData->setStageCycle(stage_num, curTick);
+ inst->traceData->setStageCycle(stage_num, curTick());
}
// Tell CPU that instruction is finished processing
diff --git a/src/cpu/inorder/resources/mult_div_unit.cc b/src/cpu/inorder/resources/mult_div_unit.cc
index d9a887571..55df1cc43 100644
--- a/src/cpu/inorder/resources/mult_div_unit.cc
+++ b/src/cpu/inorder/resources/mult_div_unit.cc
@@ -163,7 +163,7 @@ MultDivUnit::getSlot(DynInstPtr inst)
}
}
- if (lastMDUCycle + repeat_rate > curTick) {
+ if (lastMDUCycle + repeat_rate > curTick()) {
DPRINTF(InOrderMDU, "MDU not ready to process another inst. until %i, "
"denying request.\n", lastMDUCycle + repeat_rate);
return -1;
@@ -173,7 +173,7 @@ MultDivUnit::getSlot(DynInstPtr inst)
rval);
if (rval != -1) {
- lastMDUCycle = curTick;
+ lastMDUCycle = curTick();
lastOpType = inst->opClass();
lastInstName = inst->staticInst->getName();
}