diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-01 23:59:58 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-01 23:59:58 -0600 |
commit | 5cd9dd29bdb56fe496d78fcef0dfb0d6230ddc77 (patch) | |
tree | 92515822d033d60c9ff7c590c671bd519a651026 /src/mem/ruby | |
parent | 67cd04b6fefd74e1f7c2da33f70d13af2a40fabb (diff) | |
download | gem5-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')
-rw-r--r-- | src/mem/ruby/buffers/MessageBuffer.cc | 10 | ||||
-rw-r--r-- | src/mem/ruby/buffers/MessageBuffer.hh | 6 |
2 files changed, 8 insertions, 8 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; } diff --git a/src/mem/ruby/buffers/MessageBuffer.hh b/src/mem/ruby/buffers/MessageBuffer.hh index 444a7fc30..6019f3d6c 100644 --- a/src/mem/ruby/buffers/MessageBuffer.hh +++ b/src/mem/ruby/buffers/MessageBuffer.hh @@ -186,7 +186,9 @@ class MessageBuffer // variables used so enqueues appear to happen imediately, while // pop happen the next cycle Cycles m_time_last_time_enqueue; - Cycles m_time_last_time_pop; + Tick m_time_last_time_pop; + Tick m_last_arrival_time; + unsigned int m_size_at_cycle_start; unsigned int m_msgs_this_cycle; @@ -198,8 +200,6 @@ class MessageBuffer bool m_ordering_set; bool m_randomization; - Tick m_last_arrival_time; - int m_input_link_id; int m_vnet_id; }; |