summaryrefslogtreecommitdiff
path: root/src/mem/ruby/buffers/MessageBuffer.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2014-05-23 06:07:02 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2014-05-23 06:07:02 -0500
commit8bf41e41c142b2c8618eed0b786c64e10dcacb1e (patch)
tree7f43fa0ea9407beb0cc535b567e248f2db7078e9 /src/mem/ruby/buffers/MessageBuffer.cc
parent1e26b7ea29ead4a67a060cc66cd72a193db9c766 (diff)
downloadgem5-8bf41e41c142b2c8618eed0b786c64e10dcacb1e.tar.xz
ruby: message buffer: drop dequeue_getDelayCycles()
The functionality of updating and returning the delay cycles would now be performed by the dequeue() function itself.
Diffstat (limited to 'src/mem/ruby/buffers/MessageBuffer.cc')
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mem/ruby/buffers/MessageBuffer.cc b/src/mem/ruby/buffers/MessageBuffer.cc
index 19ad9ee7d..298fdb3c3 100644
--- a/src/mem/ruby/buffers/MessageBuffer.cc
+++ b/src/mem/ruby/buffers/MessageBuffer.cc
@@ -220,8 +220,11 @@ MessageBuffer::enqueue(MsgPtr message, Cycles delta)
}
Cycles
-MessageBuffer::dequeue_getDelayCycles()
+MessageBuffer::dequeue()
{
+ DPRINTF(RubyQueue, "Popping\n");
+ assert(isReady());
+
// get MsgPtr of the message about to be dequeued
MsgPtr message = m_prio_heap.front().m_msgptr;
@@ -229,16 +232,6 @@ MessageBuffer::dequeue_getDelayCycles()
message->updateDelayedTicks(m_receiver->clockEdge());
Cycles delayCycles =
m_receiver->ticksToCycles(message->getDelayedTicks());
- dequeue();
-
- return delayCycles;
-}
-
-void
-MessageBuffer::dequeue()
-{
- DPRINTF(RubyQueue, "Popping\n");
- assert(isReady());
// record previous size and time so the current buffer size isn't
// adjusted until next cycle
@@ -250,6 +243,8 @@ MessageBuffer::dequeue()
pop_heap(m_prio_heap.begin(), m_prio_heap.end(),
greater<MessageBufferNode>());
m_prio_heap.pop_back();
+
+ return delayCycles;
}
void