Hi Nate,

I just pulled in these changes and I noticed that you only applied your style 
pass on a subset of ruby directories.  Is there a reason for that?  
Specifically, you didn't modify the following directories: network, profiler, 
recorder, storebuffer, and tester.  I realize that some of those directories 
(recorder, storebuffer, and tester) aren't currently used, but we are keeping 
them around because we (at least I) hope that we can eventually reintroduce 
their functionality.  Meanwhile the network and profiler directories are 
commonly used in Ruby today.

Are you planning on updating those other directories?

Thanks,

Brad


> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Nathan Binkert
> Sent: Monday, March 22, 2010 6:47 PM
> To: [email protected]
> Subject: [m5-dev] changeset in m5: ruby: style pass
>
> changeset bc0b6ea676b5 in /z/repo/m5
> details: http://repo.m5sim.org/m5?cmd=changeset;node=bc0b6ea676b5
> description:
>       ruby: style pass
>
> diffstat:
>
> 92 files changed, 6869 insertions(+), 8071 deletions(-)
> src/mem/ruby/buffers/MessageBuffer.cc                        |  490 +-
> src/mem/ruby/buffers/MessageBuffer.hh                        |  214 -
> src/mem/ruby/buffers/MessageBufferNode.cc                    |   11
> src/mem/ruby/buffers/MessageBufferNode.hh                    |   80
> src/mem/ruby/common/Address.cc                               |   48
> src/mem/ruby/common/Address.hh                               |  300 -
> src/mem/ruby/common/Consumer.hh                              |  132
> src/mem/ruby/common/DataBlock.cc                             |   20
> src/mem/ruby/common/DataBlock.hh                             |  185 -
> src/mem/ruby/common/Debug.cc                                 |  427 +-
> src/mem/ruby/common/Debug.hh                                 |  418 +-
> src/mem/ruby/common/Driver.cc                                |   40
> src/mem/ruby/common/Driver.hh                                |   77
> src/mem/ruby/common/Global.cc                                |    1
> src/mem/ruby/common/Global.hh                                |   46
> src/mem/ruby/common/Histogram.cc                             |  218 -
> src/mem/ruby/common/Histogram.hh                             |   96
> src/mem/ruby/common/Message.cc                               |   34
> src/mem/ruby/common/NetDest.cc                               |  294 -
> src/mem/ruby/common/NetDest.hh                               |  150
> src/mem/ruby/common/SConscript                               |    1
> src/mem/ruby/common/SubBlock.cc                              |   51
> src/mem/ruby/common/SubBlock.hh                              |   87
> src/mem/ruby/eventqueue/RubyEventQueue.cc                    |   43
> src/mem/ruby/eventqueue/RubyEventQueue.hh                    |   69
> src/mem/ruby/eventqueue/RubyEventQueueNode.cc                |   23
> src/mem/ruby/eventqueue/RubyEventQueueNode.hh                |   78
> src/mem/ruby/filters/AbstractBloomFilter.hh                  |   57
> src/mem/ruby/filters/BlockBloomFilter.cc                     |  207 -
> src/mem/ruby/filters/BlockBloomFilter.hh                     |   69
> src/mem/ruby/filters/BulkBloomFilter.cc                      |  383 +-
> src/mem/ruby/filters/BulkBloomFilter.hh                      |   75
> src/mem/ruby/filters/GenericBloomFilter.cc                   |  136
> src/mem/ruby/filters/GenericBloomFilter.hh                   |   82
> src/mem/ruby/filters/H3BloomFilter.cc                        | 1791 ++-
> -------
> src/mem/ruby/filters/H3BloomFilter.hh                        |  100
> src/mem/ruby/filters/LSB_CountingBloomFilter.cc              |  195 -
> src/mem/ruby/filters/LSB_CountingBloomFilter.hh              |   69
> src/mem/ruby/filters/MultiBitSelBloomFilter.cc               |  287 -
> src/mem/ruby/filters/MultiBitSelBloomFilter.hh               |   94
> src/mem/ruby/filters/MultiGrainBloomFilter.cc                |  167
> src/mem/ruby/filters/MultiGrainBloomFilter.hh                |   81
> src/mem/ruby/filters/NonCountingBloomFilter.cc               |  193 -
> src/mem/ruby/filters/NonCountingBloomFilter.hh               |   79
> src/mem/ruby/libruby.cc                                      |  267 -
> src/mem/ruby/libruby.hh                                      |   84
> src/mem/ruby/libruby_internal.hh                             |   10
> src/mem/ruby/slicc_interface/AbstractCacheEntry.cc           |   19
> src/mem/ruby/slicc_interface/AbstractCacheEntry.hh           |   53
> src/mem/ruby/slicc_interface/AbstractController.hh           |   45
> src/mem/ruby/slicc_interface/AbstractEntry.cc                |    9
> src/mem/ruby/slicc_interface/AbstractEntry.hh                |   49
> src/mem/ruby/slicc_interface/AbstractProtocol.hh             |   36
> src/mem/ruby/slicc_interface/Message.hh                      |   80
> src/mem/ruby/slicc_interface/NetworkMessage.hh               |  101
> src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.cc   |    2
> src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh   |  131
> src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.cc |   84
> src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh |   44
> src/mem/ruby/slicc_interface/RubySlicc_Util.hh               |  167
> src/mem/ruby/slicc_interface/RubySlicc_includes.hh           |    6
> src/mem/ruby/system/AbstractMemOrCache.hh                    |   56
> src/mem/ruby/system/AbstractReplacementPolicy.hh             |   76
> src/mem/ruby/system/CacheMemory.cc                           |  618 +--
> src/mem/ruby/system/CacheMemory.hh                           |  219 -
> src/mem/ruby/system/DMASequencer.cc                          |  207 -
> src/mem/ruby/system/DMASequencer.hh                          |   62
> src/mem/ruby/system/DirectoryMemory.cc                       |  303 -
> src/mem/ruby/system/DirectoryMemory.hh                       |  125
> src/mem/ruby/system/LRUPolicy.hh                             |   73
> src/mem/ruby/system/MachineID.hh                             |   70
> src/mem/ruby/system/MemoryControl.cc                         |  826 ++-
> -
> src/mem/ruby/system/MemoryControl.hh                         |  234 -
> src/mem/ruby/system/MemoryNode.cc                            |   13
> src/mem/ruby/system/MemoryNode.hh                            |   93
> src/mem/ruby/system/MemoryVector.hh                          |  164
> src/mem/ruby/system/NodeID.hh                                |   25
> src/mem/ruby/system/PerfectCacheMemory.hh                    |  216 -
> src/mem/ruby/system/PersistentTable.cc                       |  262 -
> src/mem/ruby/system/PersistentTable.hh                       |  103
> src/mem/ruby/system/PseudoLRUPolicy.hh                       |  141
> src/mem/ruby/system/RubyPort.cc                              |  140
> src/mem/ruby/system/RubyPort.hh                              |   49
> src/mem/ruby/system/Sequencer.cc                             |  842 ++-
> -
> src/mem/ruby/system/Sequencer.hh                             |  163
> src/mem/ruby/system/SparseMemory.cc                          |  158
> src/mem/ruby/system/SparseMemory.hh                          |   48
> src/mem/ruby/system/System.cc                                |  186 -
> src/mem/ruby/system/System.hh                                |  183 -
> src/mem/ruby/system/TBETable.hh                              |  167
> src/mem/ruby/system/TimerTable.cc                            |  139
> src/mem/ruby/system/TimerTable.hh                            |   94
>
> diffs (truncated from 19018 to 300 lines):
>
> diff -r 5ae66d5f5ca2 -r bc0b6ea676b5
> src/mem/ruby/buffers/MessageBuffer.cc
> --- a/src/mem/ruby/buffers/MessageBuffer.cc   Mon Mar 22 17:19:48
> 2010 -0400
> +++ b/src/mem/ruby/buffers/MessageBuffer.cc   Mon Mar 22 18:43:53
> 2010 -0700
> @@ -1,4 +1,3 @@
> -
>  /*
>   * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
>   * All rights reserved.
> @@ -27,318 +26,341 @@
>   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
> DAMAGE.
>   */
>
> -/*
> - * $Id$
> - */
> -
>  #include "mem/ruby/buffers/MessageBuffer.hh"
>  #include "mem/ruby/system/System.hh"
>
>  MessageBuffer::MessageBuffer(const string &name)
>  {
> -  m_msg_counter = 0;
> -  m_consumer_ptr = NULL;
> -  m_ordering_set = false;
> -  m_strict_fifo = true;
> -  m_size = 0;
> -  m_max_size = -1;
> -  m_last_arrival_time = 0;
> -  m_randomization = true;
> -  m_size_last_time_size_checked = 0;
> -  m_time_last_time_size_checked = 0;
> -  m_time_last_time_enqueue = 0;
> -  m_time_last_time_pop = 0;
> -  m_size_at_cycle_start = 0;
> -  m_msgs_this_cycle = 0;
> -  m_not_avail_count = 0;
> -  m_priority_rank = 0;
> -  m_name = name;
> +    m_msg_counter = 0;
> +    m_consumer_ptr = NULL;
> +    m_ordering_set = false;
> +    m_strict_fifo = true;
> +    m_size = 0;
> +    m_max_size = -1;
> +    m_last_arrival_time = 0;
> +    m_randomization = true;
> +    m_size_last_time_size_checked = 0;
> +    m_time_last_time_size_checked = 0;
> +    m_time_last_time_enqueue = 0;
> +    m_time_last_time_pop = 0;
> +    m_size_at_cycle_start = 0;
> +    m_msgs_this_cycle = 0;
> +    m_not_avail_count = 0;
> +    m_priority_rank = 0;
> +    m_name = name;
>  }
>
> -int MessageBuffer::getSize()
> +int
> +MessageBuffer::getSize()
>  {
> -  if(m_time_last_time_size_checked == g_eventQueue_ptr->getTime()){
> -    return m_size_last_time_size_checked;
> -  } else {
> -    m_time_last_time_size_checked = g_eventQueue_ptr->getTime();
> -    m_size_last_time_size_checked = m_size;
> -    return m_size;
> -  }
> +    if (m_time_last_time_size_checked == g_eventQueue_ptr->getTime())
> {
> +        return m_size_last_time_size_checked;
> +    } else {
> +        m_time_last_time_size_checked = g_eventQueue_ptr->getTime();
> +        m_size_last_time_size_checked = m_size;
> +        return m_size;
> +    }
>  }
>
> -bool MessageBuffer::areNSlotsAvailable(int n)
> +bool
> +MessageBuffer::areNSlotsAvailable(int n)
>  {
>
> -  // fast path when message buffers have infinite size
> -  if(m_max_size == -1) {
> -    return true;
> -  }
> +    // fast path when message buffers have infinite size
> +    if (m_max_size == -1) {
> +        return true;
> +    }
>
> -  // determine my correct size for the current cycle
> -  // pop operations shouldn't effect the network's visible size until
> next cycle,
> -  // but enqueue operations effect the visible size immediately
> -  int current_size = max(m_size_at_cycle_start, m_size);
> -  if (m_time_last_time_pop < g_eventQueue_ptr->getTime()) {  // no
> pops this cycle - m_size is correct
> -    current_size = m_size;
> -  } else {
> -    if (m_time_last_time_enqueue < g_eventQueue_ptr->getTime()) {  //
> no enqueues this cycle - m_size_at_cycle_start is correct
> -      current_size = m_size_at_cycle_start;
> -    } else {  // both pops and enqueues occured this cycle - add new
> enqueued msgs to m_size_at_cycle_start
> -      current_size = m_size_at_cycle_start+m_msgs_this_cycle;
> +    // determine my correct size for the current cycle
> +    // pop operations shouldn't effect the network's visible size
> +    // until next cycle, but enqueue operations effect the visible
> +    // size immediately
> +    int current_size = max(m_size_at_cycle_start, m_size);
> +    if (m_time_last_time_pop < g_eventQueue_ptr->getTime()) {
> +        // no pops this cycle - m_size is correct
> +        current_size = m_size;
> +    } else {
> +        if (m_time_last_time_enqueue < g_eventQueue_ptr->getTime()) {
> +            // no enqueues this cycle - m_size_at_cycle_start is
> correct
> +            current_size = m_size_at_cycle_start;
> +        } else {
> +            // both pops and enqueues occured this cycle - add new
> +            // enqueued msgs to m_size_at_cycle_start
> +            current_size = m_size_at_cycle_start+m_msgs_this_cycle;
> +        }
>      }
> -  }
>
> -  // now compare the new size with our max size
> -  if(current_size+n <= m_max_size){
> -    return true;
> -  } else {
> -    DEBUG_MSG(QUEUE_COMP,MedPrio,n);
> -    DEBUG_MSG(QUEUE_COMP,MedPrio,current_size);
> -    DEBUG_MSG(QUEUE_COMP,MedPrio,m_size);
> -    DEBUG_MSG(QUEUE_COMP,MedPrio,m_max_size);
> -    m_not_avail_count++;
> -    return false;
> -  }
> +    // now compare the new size with our max size
> +    if (current_size + n <= m_max_size) {
> +        return true;
> +    } else {
> +        DEBUG_MSG(QUEUE_COMP, MedPrio, n);
> +        DEBUG_MSG(QUEUE_COMP, MedPrio, current_size);
> +        DEBUG_MSG(QUEUE_COMP, MedPrio, m_size);
> +        DEBUG_MSG(QUEUE_COMP, MedPrio, m_max_size);
> +        m_not_avail_count++;
> +        return false;
> +    }
>  }
>
> -const MsgPtr MessageBuffer::getMsgPtrCopy() const
> +const MsgPtr
> +MessageBuffer::getMsgPtrCopy() const
>  {
> -  assert(isReady());
> +    assert(isReady());
>
> -  MsgPtr temp_msg;
> -  temp_msg = *(m_prio_heap.peekMin().m_msgptr.ref());
> -  assert(temp_msg.ref() != NULL);
> -  return temp_msg;
> +    MsgPtr temp_msg;
> +    temp_msg = *(m_prio_heap.peekMin().m_msgptr.ref());
> +    assert(temp_msg.ref() != NULL);
> +    return temp_msg;
>  }
>
> -const Message* MessageBuffer::peekAtHeadOfQueue() const
> +const Message*
> +MessageBuffer::peekAtHeadOfQueue() const
>  {
> -  const Message* msg_ptr;
> -  DEBUG_NEWLINE(QUEUE_COMP,MedPrio);
> +    const Message* msg_ptr;
> +    DEBUG_NEWLINE(QUEUE_COMP, MedPrio);
>
> -  DEBUG_MSG(QUEUE_COMP,MedPrio,"Peeking at head of queue " + m_name +
> " time: "
> -            + int_to_string(g_eventQueue_ptr->getTime()) + ".");
> -  assert(isReady());
> +    DEBUG_MSG(QUEUE_COMP, MedPrio,
> +              "Peeking at head of queue " + m_name + " time: "
> +              + int_to_string(g_eventQueue_ptr->getTime()) + ".");
> +    assert(isReady());
>
> -  msg_ptr = m_prio_heap.peekMin().m_msgptr.ref();
> -  assert(msg_ptr != NULL);
> +    msg_ptr = m_prio_heap.peekMin().m_msgptr.ref();
> +    assert(msg_ptr != NULL);
>
> -  DEBUG_EXPR(QUEUE_COMP,MedPrio,*msg_ptr);
> -  DEBUG_NEWLINE(QUEUE_COMP,MedPrio);
> -  return msg_ptr;
> +    DEBUG_EXPR(QUEUE_COMP, MedPrio, *msg_ptr);
> +    DEBUG_NEWLINE(QUEUE_COMP, MedPrio);
> +    return msg_ptr;
>  }
>
>  // FIXME - move me somewhere else
> -int random_time()
> +int
> +random_time()
>  {
> -  int time = 1;
> -  time += random() & 0x3;  // [0...3]
> -  if ((random() & 0x7) == 0) {  // 1 in 8 chance
> -    time += 100 + (random() % 0xf); // 100 + [1...15]
> -  }
> -  return time;
> +    int time = 1;
> +    time += random() & 0x3;  // [0...3]
> +    if ((random() & 0x7) == 0) {  // 1 in 8 chance
> +        time += 100 + (random() % 0xf); // 100 + [1...15]
> +    }
> +    return time;
>  }
>
> -void MessageBuffer::enqueue(const MsgPtr& message, Time delta)
> +void
> +MessageBuffer::enqueue(const MsgPtr& message, Time delta)
>  {
> -  DEBUG_NEWLINE(QUEUE_COMP,HighPrio);
> -  DEBUG_MSG(QUEUE_COMP,HighPrio,"enqueue " + m_name + " time: "
> -            + int_to_string(g_eventQueue_ptr->getTime()) + ".");
> -  DEBUG_EXPR(QUEUE_COMP,MedPrio,message);
> -  DEBUG_NEWLINE(QUEUE_COMP,HighPrio);
> +    DEBUG_NEWLINE(QUEUE_COMP, HighPrio);
> +    DEBUG_MSG(QUEUE_COMP, HighPrio, "enqueue " + m_name + " time: "
> +              + int_to_string(g_eventQueue_ptr->getTime()) + ".");
> +    DEBUG_EXPR(QUEUE_COMP, MedPrio, message);
> +    DEBUG_NEWLINE(QUEUE_COMP, HighPrio);
>
> -  m_msg_counter++;
> -  m_size++;
> +    m_msg_counter++;
> +    m_size++;
>
> -  // record current time incase we have a pop that also adjusts my
> size
> -  if (m_time_last_time_enqueue < g_eventQueue_ptr->getTime()) {
> -    m_msgs_this_cycle = 0;  // first msg this cycle
> -    m_time_last_time_enqueue = g_eventQueue_ptr->getTime();
> -  }
> -  m_msgs_this_cycle++;
> +    // record current time incase we have a pop that also adjusts my
> size
> +    if (m_time_last_time_enqueue < g_eventQueue_ptr->getTime()) {
> +        m_msgs_this_cycle = 0;  // first msg this cycle
> +        m_time_last_time_enqueue = g_eventQueue_ptr->getTime();
> +    }
> +    m_msgs_this_cycle++;
>
> -  //  ASSERT(m_max_size == -1 || m_size <= m_max_size + 1);
> -  // the plus one is a kluge because of a SLICC issue
> +    //  ASSERT(m_max_size == -1 || m_size <= m_max_size + 1);
> +    // the plus one is a kluge because of a SLICC issue
>
> -  if (!m_ordering_set) {
> -    //    WARN_EXPR(*this);
> -    WARN_EXPR(m_name);
> -    ERROR_MSG("Ordering property of this queue has not been set");
> -  }
> +    if (!m_ordering_set) {
> +        //    WARN_EXPR(*this);
> +        WARN_EXPR(m_name);
> +        ERROR_MSG("Ordering property of this queue has not been set");
> +    }
>
> -  // Calculate the arrival time of the message, that is, the first
> -  // cycle the message can be dequeued.
> -//  printf ("delta %i \n", delta);
> -  assert(delta>0);
> -  Time current_time = g_eventQueue_ptr->getTime();
> -  Time arrival_time = 0;
> -  if (!RubySystem::getRandomization() || (m_randomization == false)) {
> -    // No randomization
> -    arrival_time = current_time + delta;
> +    // Calculate the arrival time of the message, that is, the first
> +    // cycle the message can be dequeued.
> +    //printf ("delta %i \n", delta);
> +    assert(delta>0);
> +    Time current_time = g_eventQueue_ptr->getTime();
> +    Time arrival_time = 0;
> +    if (!RubySystem::getRandomization() || (m_randomization == false))
> {
> +        // No randomization
> +        arrival_time = current_time + delta;
> +    } else {
> +        // Randomization - ignore delta
> +        if (m_strict_fifo) {
> +            if (m_last_arrival_time < current_time) {
> +                m_last_arrival_time = current_time;
> +            }
> +            arrival_time = m_last_arrival_time + random_time();
> +        } else {
> +            arrival_time = current_time + random_time();
> +        }
> +    }
>
> -  } else {
> -    // Randomization - ignore delta
> +    // Check the arrival time
> +    assert(arrival_time > current_time);
>      if (m_strict_fifo) {
> -      if (m_last_arrival_time < current_time) {
> -        m_last_arrival_time = current_time;
> -      }
> -      arrival_time = m_last_arrival_time + random_time();
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev


_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to