summaryrefslogtreecommitdiff
path: root/src/mem/ruby/buffers/MessageBuffer.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2014-03-01 23:59:58 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2014-03-01 23:59:58 -0600
commit5cd9dd29bdb56fe496d78fcef0dfb0d6230ddc77 (patch)
tree92515822d033d60c9ff7c590c671bd519a651026 /src/mem/ruby/buffers/MessageBuffer.cc
parent67cd04b6fefd74e1f7c2da33f70d13af2a40fabb (diff)
downloadgem5-5cd9dd29bdb56fe496d78fcef0dfb0d6230ddc77.tar.xz
ruby: message buffer: changes related to tracking push/pop times
The last pop operation is now tracked as a Tick instead of in Cycles. This helps in avoiding use of the receiver's clock during the enqueue operation.
Diffstat (limited to 'src/mem/ruby/buffers/MessageBuffer.cc')
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mem/ruby/buffers/MessageBuffer.cc b/src/mem/ruby/buffers/MessageBuffer.cc
index 0486f627e..19ad9ee7d 100644
--- a/src/mem/ruby/buffers/MessageBuffer.cc
+++ b/src/mem/ruby/buffers/MessageBuffer.cc
@@ -89,11 +89,11 @@ MessageBuffer::areNSlotsAvailable(unsigned int n)
// size immediately
unsigned int current_size = 0;
- if (m_time_last_time_pop < m_receiver->curCycle()) {
+ if (m_time_last_time_pop < m_sender->clockEdge()) {
// no pops this cycle - heap size is correct
current_size = m_prio_heap.size();
} else {
- if (m_time_last_time_enqueue < m_receiver->curCycle()) {
+ if (m_time_last_time_enqueue < m_sender->curCycle()) {
// no enqueues this cycle - m_size_at_cycle_start is correct
current_size = m_size_at_cycle_start;
} else {
@@ -242,9 +242,9 @@ MessageBuffer::dequeue()
// record previous size and time so the current buffer size isn't
// adjusted until next cycle
- if (m_time_last_time_pop < m_receiver->curCycle()) {
+ if (m_time_last_time_pop < m_receiver->clockEdge()) {
m_size_at_cycle_start = m_prio_heap.size();
- m_time_last_time_pop = m_receiver->curCycle();
+ m_time_last_time_pop = m_receiver->clockEdge();
}
pop_heap(m_prio_heap.begin(), m_prio_heap.end(),
@@ -259,7 +259,7 @@ MessageBuffer::clear()
m_msg_counter = 0;
m_time_last_time_enqueue = Cycles(0);
- m_time_last_time_pop = Cycles(0);
+ m_time_last_time_pop = 0;
m_size_at_cycle_start = 0;
m_msgs_this_cycle = 0;
}