summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-08-28 14:30:33 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-08-28 14:30:33 -0400
commit0cacf7e8178defce4063b7cfc8a592c595f56fa2 (patch)
treeac2a57952c3d8b87b1a2d0190d26ab149c12f65e /src/dev
parentd53d04473e0d6ca1765f1117072eec59187a7f7b (diff)
downloadgem5-0cacf7e8178defce4063b7cfc8a592c595f56fa2.tar.xz
Clock: Add a Cycles wrapper class and use where applicable
This patch addresses the comments and feedback on the preceding patch that reworks the clocks and now more clearly shows where cycles (relative cycle counts) are used to express time. Instead of bumping the existing patch I chose to make this a separate patch, merely to try and focus the discussion around a smaller set of changes. The two patches will be pushed together though. This changes done as part of this patch are mostly following directly from the introduction of the wrapper class, and change enough code to make things compile and run again. There are definitely more places where int/uint/Tick is still used to represent cycles, and it will take some time to chase them all down. Similarly, a lot of parameters should be changed from Param.Tick and Param.Unsigned to Param.Cycles. In addition, the use of curTick is questionable as there should not be an absolute cycle. Potential solutions can be built on top of this patch. There is a similar situation in the o3 CPU where lastRunningCycle is currently counting in Cycles, and is still an absolute time. More discussion to be had in other words. An additional change that would be appropriate in the future is to perform a similar wrapping of Tick and probably also introduce a Ticks class along with suitable operators for all these classes.
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/arm/pl111.cc9
-rw-r--r--src/dev/i8254xGBe.cc2
-rw-r--r--src/dev/sinic.cc2
3 files changed, 8 insertions, 5 deletions
diff --git a/src/dev/arm/pl111.cc b/src/dev/arm/pl111.cc
index 7990e02ed..22eba1458 100644
--- a/src/dev/arm/pl111.cc
+++ b/src/dev/arm/pl111.cc
@@ -475,7 +475,7 @@ Pl111::fillFifo()
void
Pl111::dmaDone()
{
- Tick maxFrameTime = lcdTiming2.cpl * height;
+ Cycles maxFrameTime(lcdTiming2.cpl * height);
--dmaPendingNum;
@@ -503,8 +503,11 @@ Pl111::dmaDone()
// argument into a relative number of cycles in the future by
// subtracting curCycle()
if (lcdControl.lcden)
- schedule(readEvent, clockEdge(startTime + maxFrameTime -
- curCycle()));
+ // @todo: This is a terrible way of doing the time
+ // keeping, make it all relative
+ schedule(readEvent,
+ clockEdge(Cycles(startTime - curCycle() +
+ maxFrameTime)));
}
if (dmaPendingNum > (maxOutstandingDma - waterMark))
diff --git a/src/dev/i8254xGBe.cc b/src/dev/i8254xGBe.cc
index 3ba140bce..71b88377d 100644
--- a/src/dev/i8254xGBe.cc
+++ b/src/dev/i8254xGBe.cc
@@ -2052,7 +2052,7 @@ IGbE::restartClock()
{
if (!tickEvent.scheduled() && (rxTick || txTick || txFifoTick) &&
getState() == SimObject::Running)
- schedule(tickEvent, clockEdge(1));
+ schedule(tickEvent, clockEdge(Cycles(1)));
}
unsigned int
diff --git a/src/dev/sinic.cc b/src/dev/sinic.cc
index 623dcf2c1..cdfa844d9 100644
--- a/src/dev/sinic.cc
+++ b/src/dev/sinic.cc
@@ -1321,7 +1321,7 @@ Device::transferDone()
DPRINTF(Ethernet, "transfer complete: data in txFifo...schedule xmit\n");
- reschedule(txEvent, curTick() + ticks(1), true);
+ reschedule(txEvent, curTick() + clockPeriod(), true);
}
bool