summaryrefslogtreecommitdiff
path: root/src/dev/arm/hdlcd.cc
diff options
context:
space:
mode:
authorDam Sunwoo <dam.sunwoo@arm.com>2013-04-22 13:20:31 -0400
committerDam Sunwoo <dam.sunwoo@arm.com>2013-04-22 13:20:31 -0400
commite8381142b061fbdf2f22d958f1c7559e9ffb3bd8 (patch)
tree452e96de7f6322d62f325992a9ce5d1d2a3c3bbb /src/dev/arm/hdlcd.cc
parent2c1e34431326381833de289b1d90f2427ba16c98 (diff)
downloadgem5-e8381142b061fbdf2f22d958f1c7559e9ffb3bd8.tar.xz
sim: separate nextCycle() and clockEdge() in clockedObjects
Previously, nextCycle() could return the *current* cycle if the current tick was already aligned with the clock edge. This behavior is not only confusing (not quite what the function name implies), but also caused problems in the drainResume() function. When exiting/re-entering the sim loop (e.g., to take checkpoints), the CPUs will drain and resume. Due to the previous behavior of nextCycle(), the CPU tick events were being rescheduled in the same ticks that were already processed before draining. This caused divergence from runs that did not exit/re-entered the sim loop. (Initially a cycle difference, but a significant impact later on.) This patch separates out the two behaviors (nextCycle() and clockEdge()), uses nextCycle() in drainResume, and uses clockEdge() everywhere else. Nothing (other than name) should change except for the drainResume timing.
Diffstat (limited to 'src/dev/arm/hdlcd.cc')
-rw-r--r--src/dev/arm/hdlcd.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dev/arm/hdlcd.cc b/src/dev/arm/hdlcd.cc
index 14128c730..c5daebc9b 100644
--- a/src/dev/arm/hdlcd.cc
+++ b/src/dev/arm/hdlcd.cc
@@ -282,7 +282,7 @@ HDLcd::write(PacketPtr pkt)
if (new_command.enable) {
doUpdateParams = true;
if (!frameUnderway) {
- schedule(startFrameEvent, nextCycle());
+ schedule(startFrameEvent, clockEdge());
}
}
}
@@ -514,7 +514,7 @@ HDLcd::renderPixel()
frameUnderrun = true;
int_rawstat.underrun = 1;
if (!intEvent.scheduled())
- schedule(intEvent, nextCycle());
+ schedule(intEvent, clockEdge());
} else {
// emulate the pixel read from the internal buffer
pixelBufferSize -= bytesPerPixel() * count;
@@ -524,7 +524,7 @@ HDLcd::renderPixel()
// the DMA may have previously stalled due to the buffer being full;
// give it a kick; it knows not to fill if at end of frame, underrun, etc
if (!fillPixelBufferEvent.scheduled())
- schedule(fillPixelBufferEvent, nextCycle());
+ schedule(fillPixelBufferEvent, clockEdge());
// schedule the next pixel read according to where it is in the frame
pixelIndex += count;
@@ -597,7 +597,7 @@ HDLcd::dmaDone(DmaDoneEvent *event)
if ((dmaCurAddr < dmaMaxAddr) &&
(bytesFreeInPixelBuffer() + targetTransSize < PIXEL_BUFFER_CAPACITY) &&
!fillPixelBufferEvent.scheduled()) {
- schedule(fillPixelBufferEvent, nextCycle());
+ schedule(fillPixelBufferEvent, clockEdge());
}
}