summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base/stl_helpers.hh97
-rw-r--r--src/cpu/rubytest/CheckTable.cc2
-rw-r--r--src/cpu/rubytest/CheckTable.hh4
-rw-r--r--src/cpu/rubytest/RubyTester.cc2
-rw-r--r--src/cpu/rubytest/RubyTester.hh3
-rw-r--r--src/mem/gems_common/Map.hh33
-rw-r--r--src/mem/gems_common/PrioHeap.hh10
-rw-r--r--src/mem/gems_common/Vector.hh337
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.hh2
-rw-r--r--src/mem/ruby/common/DataBlock.hh1
-rw-r--r--src/mem/ruby/common/Histogram.cc2
-rw-r--r--src/mem/ruby/common/Histogram.hh4
-rw-r--r--src/mem/ruby/common/NetDest.cc12
-rw-r--r--src/mem/ruby/common/NetDest.hh8
-rw-r--r--src/mem/ruby/common/SubBlock.cc5
-rw-r--r--src/mem/ruby/common/SubBlock.hh6
-rw-r--r--src/mem/ruby/eventqueue/RubyEventQueue.hh1
-rw-r--r--src/mem/ruby/filters/BlockBloomFilter.cc2
-rw-r--r--src/mem/ruby/filters/BlockBloomFilter.hh4
-rw-r--r--src/mem/ruby/filters/BulkBloomFilter.cc4
-rw-r--r--src/mem/ruby/filters/BulkBloomFilter.hh6
-rw-r--r--src/mem/ruby/filters/H3BloomFilter.cc2
-rw-r--r--src/mem/ruby/filters/H3BloomFilter.hh4
-rw-r--r--src/mem/ruby/filters/LSB_CountingBloomFilter.cc2
-rw-r--r--src/mem/ruby/filters/LSB_CountingBloomFilter.hh4
-rw-r--r--src/mem/ruby/filters/MultiBitSelBloomFilter.cc2
-rw-r--r--src/mem/ruby/filters/MultiBitSelBloomFilter.hh4
-rw-r--r--src/mem/ruby/filters/MultiGrainBloomFilter.cc4
-rw-r--r--src/mem/ruby/filters/MultiGrainBloomFilter.hh6
-rw-r--r--src/mem/ruby/filters/NonCountingBloomFilter.cc2
-rw-r--r--src/mem/ruby/filters/NonCountingBloomFilter.hh4
-rw-r--r--src/mem/ruby/network/Network.cc2
-rw-r--r--src/mem/ruby/network/Network.hh3
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc48
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh18
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc6
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc24
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh17
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc6
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh5
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc6
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh3
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc10
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh10
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.hh4
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc12
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh13
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc7
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh5
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc20
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh13
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc40
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh16
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc22
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh14
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc4
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh5
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/Router.cc50
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/Router.hh23
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc26
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.hh14
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.cc36
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.hh20
-rw-r--r--src/mem/ruby/network/simple/Switch.cc35
-rw-r--r--src/mem/ruby/network/simple/Switch.hh12
-rw-r--r--src/mem/ruby/network/simple/Throttle.cc14
-rw-r--r--src/mem/ruby/network/simple/Throttle.hh16
-rw-r--r--src/mem/ruby/network/simple/Topology.cc36
-rw-r--r--src/mem/ruby/network/simple/Topology.hh21
-rw-r--r--src/mem/ruby/profiler/AddressProfiler.cc15
-rw-r--r--src/mem/ruby/profiler/CacheProfiler.cc15
-rw-r--r--src/mem/ruby/profiler/CacheProfiler.hh5
-rw-r--r--src/mem/ruby/profiler/MemCntrlProfiler.cc2
-rw-r--r--src/mem/ruby/profiler/MemCntrlProfiler.hh6
-rw-r--r--src/mem/ruby/profiler/Profiler.cc30
-rw-r--r--src/mem/ruby/profiler/Profiler.hh17
-rw-r--r--src/mem/ruby/system/CacheMemory.cc10
-rw-r--r--src/mem/ruby/system/CacheMemory.hh5
-rw-r--r--src/mem/ruby/system/MemoryVector.hh6
-rw-r--r--src/mem/ruby/system/Sequencer.cc6
-rw-r--r--src/mem/ruby/system/System.cc2
-rw-r--r--src/mem/ruby/system/System.hh1
-rw-r--r--src/mem/ruby/system/TimerTable.cc2
-rw-r--r--src/mem/ruby/tester/DeterministicDriver.cc18
-rw-r--r--src/mem/ruby/tester/DeterministicDriver.hh19
-rw-r--r--src/mem/ruby/tester/RaceyDriver.cc2
-rw-r--r--src/mem/ruby/tester/RaceyDriver.hh6
-rw-r--r--src/mem/slicc/symbols/StateMachine.py2
90 files changed, 604 insertions, 788 deletions
diff --git a/src/base/stl_helpers.hh b/src/base/stl_helpers.hh
new file mode 100644
index 000000000..740bd1b48
--- /dev/null
+++ b/src/base/stl_helpers.hh
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2010 The Hewlett-Packard Development Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Nathan Binkert
+ */
+
+#ifndef __BASE_STL_HELPERS_HH__
+#define __BASE_STL_HELPERS_HH__
+
+#include <algorithm>
+#include <iostream>
+
+namespace m5 {
+namespace stl_helpers {
+
+template <typename T>
+void
+deletePointer(T &ptr)
+{
+ delete ptr;
+ ptr = NULL;
+}
+
+template <class T>
+class ContainerPrint
+{
+ private:
+ std::ostream &out;
+ bool first;
+
+ public:
+ ContainerPrint(std::ostream &out)
+ : out(out), first(true)
+ {}
+
+ void
+ operator()(const T &elem)
+ {
+ out << elem;
+ // First one doesn't get a space before it. The rest do.
+ if (first)
+ first = false;
+ else
+ out << " ";
+ }
+};
+
+// Treat all objects in an stl container as pointers to heap objects,
+// calling delete on each one and zeroing the pointers along the way
+template <typename T, template <typename T, typename A> class C, typename A>
+void
+deletePointers(C<T,A> &container)
+{
+ std::for_each(container.begin(), container.end(), deletePointer<T>);
+}
+
+// Write out all elements in an stl container as a space separated
+// list enclosed in square brackets
+template <typename T, template <typename T, typename A> class C, typename A>
+std::ostream &
+operator<<(std::ostream& out, const C<T,A> &vec)
+{
+ out << "[ ";
+ std::for_each(vec.begin(), vec.end(), ContainerPrint<T>(out));
+ out << " ]";
+ out << std::flush;
+ return out;
+}
+
+/* namespace stl_helpers */ }
+/* namespace m5 */ }
+
+#endif // __BASE_STL_HELPERS_HH__
diff --git a/src/cpu/rubytest/CheckTable.cc b/src/cpu/rubytest/CheckTable.cc
index 3b94de315..7588007c9 100644
--- a/src/cpu/rubytest/CheckTable.cc
+++ b/src/cpu/rubytest/CheckTable.cc
@@ -102,7 +102,7 @@ CheckTable::addCheck(const Address& address)
// Insert it once per byte
m_lookup_map_ptr->add(Address(address.getAddress() + i), check_ptr);
}
- m_check_vector.insertAtBottom(check_ptr);
+ m_check_vector.push_back(check_ptr);
}
Check*
diff --git a/src/cpu/rubytest/CheckTable.hh b/src/cpu/rubytest/CheckTable.hh
index a22fa7f73..117fb1276 100644
--- a/src/cpu/rubytest/CheckTable.hh
+++ b/src/cpu/rubytest/CheckTable.hh
@@ -31,8 +31,8 @@
#define __CPU_RUBYTEST_CHECKTABLE_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
class Address;
@@ -63,7 +63,7 @@ class CheckTable
CheckTable(const CheckTable& obj);
CheckTable& operator=(const CheckTable& obj);
- Vector<Check*> m_check_vector;
+ std::vector<Check*> m_check_vector;
Map<Address, Check*>* m_lookup_map_ptr;
int m_num_cpu_sequencers;
diff --git a/src/cpu/rubytest/RubyTester.cc b/src/cpu/rubytest/RubyTester.cc
index 3ad977b42..036e511bc 100644
--- a/src/cpu/rubytest/RubyTester.cc
+++ b/src/cpu/rubytest/RubyTester.cc
@@ -59,7 +59,7 @@ RubyTester::init()
{
assert(ports.size() > 0);
- m_last_progress_vector.setSize(ports.size());
+ m_last_progress_vector.resize(ports.size());
for (int i = 0; i < m_last_progress_vector.size(); i++) {
m_last_progress_vector[i] = 0;
}
diff --git a/src/cpu/rubytest/RubyTester.hh b/src/cpu/rubytest/RubyTester.hh
index 634e61f88..2726a50d6 100644
--- a/src/cpu/rubytest/RubyTester.hh
+++ b/src/cpu/rubytest/RubyTester.hh
@@ -31,6 +31,7 @@
#define __CPU_RUBYTEST_RUBYTESTER_HH__
#include <iostream>
+#include <vector>
#include <string>
#include "cpu/rubytest/CheckTable.hh"
@@ -126,7 +127,7 @@ class RubyTester : public MemObject
RubyTester& operator=(const RubyTester& obj);
CheckTable* m_checkTable_ptr;
- Vector<Time> m_last_progress_vector;
+ std::vector<Time> m_last_progress_vector;
uint64 m_checks_completed;
std::vector<CpuPort*> ports;
diff --git a/src/mem/gems_common/Map.hh b/src/mem/gems_common/Map.hh
index 7b3c26279..0a1f0f4e1 100644
--- a/src/mem/gems_common/Map.hh
+++ b/src/mem/gems_common/Map.hh
@@ -34,10 +34,11 @@
#ifndef MAP_H
#define MAP_H
+#include <cassert>
#include <iostream>
+#include <vector>
#include "base/hashmap.hh"
-#include "mem/gems_common/Vector.hh"
template <class KEY_TYPE, class VALUE_TYPE>
class Map
@@ -55,8 +56,8 @@ public:
bool exist(const KEY_TYPE& key) const;
int size() const { return m_map.size(); }
void erase(const KEY_TYPE& key) { assert(exist(key)); m_map.erase(key); }
- Vector<KEY_TYPE> keys() const;
- Vector<VALUE_TYPE> values() const;
+ std::vector<KEY_TYPE> keys() const;
+ std::vector<VALUE_TYPE> values() const;
void deleteKeys();
void deleteValues();
VALUE_TYPE& lookup(const KEY_TYPE& key) const;
@@ -108,27 +109,29 @@ VALUE_TYPE& Map<KEY_TYPE, VALUE_TYPE>::lookup(const KEY_TYPE& key) const
}
template <class KEY_TYPE, class VALUE_TYPE>
-Vector<KEY_TYPE> Map<KEY_TYPE, VALUE_TYPE>::keys() const
+std::vector<KEY_TYPE> Map<KEY_TYPE, VALUE_TYPE>::keys() const
{
- Vector<KEY_TYPE> keys;
- const_iterator iter;
- for (iter = m_map.begin(); iter != m_map.end(); iter++) {
- keys.insertAtBottom((*iter).first);
+ std::vector<KEY_TYPE> keys(m_map.size());
+ const_iterator iter = m_map.begin();
+ for (int i = 0; i < m_map.size(); ++i) {
+ keys[i] = iter->first;
+ ++iter;
}
+ assert(iter == m_map.end());
return keys;
}
template <class KEY_TYPE, class VALUE_TYPE>
-Vector<VALUE_TYPE> Map<KEY_TYPE, VALUE_TYPE>::values() const
+std::vector<VALUE_TYPE> Map<KEY_TYPE, VALUE_TYPE>::values() const
{
- Vector<VALUE_TYPE> values;
- const_iterator iter;
- std::pair<KEY_TYPE, VALUE_TYPE> p;
+ std::vector<VALUE_TYPE> values(m_map.size());
+ const_iterator iter = m_map.begin();
- for (iter = m_map.begin(); iter != m_map.end(); iter++) {
- p = *iter;
- values.insertAtBottom(p.second);
+ for (int i = 0; i < m_map.size(); ++i) {
+ values[i] = iter->second;
+ ++iter;
}
+ assert(iter == m_map.end());
return values;
}
diff --git a/src/mem/gems_common/PrioHeap.hh b/src/mem/gems_common/PrioHeap.hh
index d6183cf40..266d35e6a 100644
--- a/src/mem/gems_common/PrioHeap.hh
+++ b/src/mem/gems_common/PrioHeap.hh
@@ -29,9 +29,9 @@
#ifndef PRIOHEAP_H
#define PRIOHEAP_H
+#include <cassert>
#include <iostream>
-
-#include "mem/gems_common/Vector.hh"
+#include <vector>
typedef unsigned int HeapIndex;
@@ -63,7 +63,7 @@ private:
PrioHeap<TYPE>& operator=(const PrioHeap& obj);
// Data Members (m_ prefix)
- Vector<TYPE> m_heap;
+ std::vector<TYPE> m_heap;
HeapIndex m_current_size;
};
@@ -109,7 +109,7 @@ void PrioHeap<TYPE>::insert(const TYPE& key)
int i;
// grow the vector size
m_current_size++;
- m_heap.setSize(m_current_size+1);
+ m_heap.resize(m_current_size+1);
if(m_current_size == 1){ // HACK: need to initialize index 0 to avoid purify UMCs
m_heap[0] = key;
@@ -214,7 +214,7 @@ void PrioHeap<TYPE>::heapify()
template <class TYPE>
void PrioHeap<TYPE>::print(std::ostream& out) const
{
- Vector<TYPE> copyHeap(m_heap);
+ std::vector<TYPE> copyHeap(m_heap);
// sort copyHeap (inefficient, but will not be done often)
diff --git a/src/mem/gems_common/Vector.hh b/src/mem/gems_common/Vector.hh
deleted file mode 100644
index ddba7a2fc..000000000
--- a/src/mem/gems_common/Vector.hh
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Description: The Vector class is a generic container which acts
- * much like an array. The Vector class handles dynamic sizing and
- * resizing as well as performing bounds checking on each access. An
- * "insertAtBottom" operation is supported to allow adding elements to
- * the Vector much like you would add new elements to a linked list or
- * queue.
- */
-
-#ifndef VECTOR_H
-#define VECTOR_H
-
-#include <algorithm>
-#include <cassert>
-#include <iostream>
-#include <vector>
-
-template <class TYPE>
-class Vector
-{
-public:
- Vector();
- explicit Vector(int initial_size); // Construct with an initial max size
- ~Vector();
- const TYPE& ref(int index) const; // Get an element of the vector
- TYPE& ref(int index); // Get an element of the vector
- void clear(); // remove all elements of the vector
- void sortVector(); // sort all elements using < operator
- int size() const { return m_size; }
- void setSize(int new_size); // Increase size, reallocates memory as needed
- void expand(int num) { setSize(m_size+num); } // Increase size by num
- void increaseSize(int new_size, const TYPE& reset); // and adds num of slots at the bottom set to reset value
- void insertAtTop(const TYPE& element); // Increase size by one and set last element
- // FIXME - WARNING: insertAtTop is currently O(n) and needs to be fixed
- void insertAtBottom(const TYPE& element); // Increase size by one and set last element
- TYPE sum() const; // Uses the += operator to sum all the elements of the vector
- void deletePointers(); // Walks the Vector calling delete on all
- // elements and sets them to NULL, can only
- // be used when the TYPE is a pointer type.
- void removeFromTop(int num); // removes elements from top
- void print(std::ostream& out) const;
-
-
- // Array Reference operator overloading
- const TYPE& operator[](int index) const { return ref(index); }
- TYPE& operator[](int index) { return ref(index); }
-
- // Public copy constructor and assignment operator
- Vector(const Vector& vec);
- Vector<TYPE>& operator=(const Vector& vec);
-private:
-
- void grow(int new_max_size); // Expands vector to new_max_size
-
- // Data members
- TYPE* m_vec; // Array to hold the elements
- int m_size; // Number of elements in use
- int m_max_size; // Size of allocated array
-};
-
-template <class TYPE>
-std::ostream& operator<<(std::ostream& out, const Vector<TYPE>& vec);
-
-// *********************
-
-template <class TYPE>
-Vector<TYPE>::Vector()
-{
- m_size = 0;
- m_max_size = 0;
- m_vec = NULL;
-}
-
-template <class TYPE>
-Vector<TYPE>::Vector(int initial_size)
-{
- m_size = 0;
- m_max_size = initial_size;
- m_vec = NULL;
- grow(initial_size);
-}
-
-template <class TYPE>
-Vector<TYPE>::~Vector()
-{
- delete [] m_vec;
-}
-
-template <class TYPE>
-const TYPE& Vector<TYPE>::ref(int index) const
-{
-#ifndef NO_VECTOR_BOUNDS_CHECKS
- assert(m_size != 0);
- assert(index < m_size);
- assert(index >= 0);
-#endif
- return m_vec[index];
-}
-
-template <class TYPE>
-TYPE& Vector<TYPE>::ref(int index)
-{
-#ifndef NO_VECTOR_BOUNDS_CHECKS
- assert(m_size != 0);
- assert(index < m_size);
- assert(index >= 0);
-#endif
- return m_vec[index];
-}
-
-
-template <class TYPE>
-void Vector<TYPE>::setSize(int new_size)
-{
- // FIXME - this should also decrease or shrink the size of the array at some point.
- if (new_size > m_max_size) {
- grow(std::max((m_max_size+1)*2, new_size));
- }
- m_size = new_size;
-#ifndef NO_VECTOR_BOUNDS_CHECKS
- assert(m_size <= m_max_size);
- assert(m_size >= 0);
-#endif
-}
-
-template <class TYPE>
-inline
-void Vector<TYPE>::increaseSize(int new_size, const TYPE& reset)
-{
- assert(new_size >= m_size);
- if (new_size >= m_max_size) {
- grow(std::max((m_max_size+1)*2, new_size));
- }
- int old_size = m_size;
- m_size = new_size;
- for (int j = old_size; j < m_size; j++) {
- ref(j) = reset;
- }
-
-#ifndef NO_VECTOR_BOUNDS_CHECKS
- assert(m_size <= m_max_size);
- assert(m_size >= 0);
-#endif
-}
-
-template <class TYPE>
-inline
-void Vector<TYPE>::clear()
-{
- m_size = 0;
- m_max_size = 0;
- delete [] m_vec;
- m_vec = NULL;
-}
-
-template <class TYPE>
-inline
-void Vector<TYPE>::sortVector()
-{
- std::sort(&m_vec[0], &m_vec[m_size]);
-}
-
-template <class TYPE>
-inline
-void Vector<TYPE>::insertAtTop(const TYPE& element)
-{
- setSize(m_size+1);
- for (int i = m_size-1; i >= 1; i--) {
- ref(i) = ref(i-1);
- }
- ref(0) = element;
-}
-
-template <class TYPE>
-inline
-void Vector<TYPE>::removeFromTop(int num)
-{
- if (num > m_size) {
- num = m_size;
- }
- for (int i = 0; i < m_size - num; i++) {
- m_vec[i] = m_vec[i+num];
- }
- m_size = m_size - num;
-
-}
-
-template <class TYPE>
-void Vector<TYPE>::insertAtBottom(const TYPE& element)
-{
- setSize(m_size+1);
- ref(m_size-1) = element;
-}
-
-template <class TYPE>
-TYPE Vector<TYPE>::sum() const
-{
- assert(m_size > 0);
- TYPE sum = ref(0);
- for(int i=1; i<m_size; i++) {
- sum += ref(i);
- }
- return sum;
-}
-
-template <class TYPE>
-void Vector<TYPE>::deletePointers()
-{
- assert(m_size >= 0);
- for(int i=0; i<m_size; i++) {
- // FIXME this function should be non-member function, otherwise this
- // prevent template instantiation for non-pointer types
- //
- // Also, there is warning of Switch.cc which use void* here
- delete ref(i);
- ref(i) = NULL;
- }
-}
-
-template <class TYPE>
-void Vector<TYPE>::print(std::ostream& out) const
-{
- out << "[ ";
- for(int i=0; i<m_size; i++) {
- if (i != 0) {
- out << " ";
- }
- out << ref(i);
- }
- out << " ]";
- out << std::flush;
-}
-
-// Copy constructor
-template <class TYPE>
-Vector<TYPE>::Vector(const Vector& vec)
-{
- // Setup the new memory
- m_size = vec.m_size;
- m_max_size = vec.m_max_size;
- if (m_max_size != 0) {
- m_vec = new TYPE[m_max_size];
- assert(m_vec != NULL);
- } else {
- m_vec = NULL;
- }
-
- // Copy the elements of the array
- for(int i=0; i<m_size; i++) {
- m_vec[i] = vec.m_vec[i]; // Element copy
- }
-}
-
-template <class TYPE>
-Vector<TYPE>& Vector<TYPE>::operator=(const Vector& vec)
-{
- if (this == &vec) {
- // assert(0);
- } else {
- // Free the old memory
- delete [] m_vec;
-
- // Setup the new memory
- m_size = vec.m_size;
- m_max_size = vec.m_max_size;
-
- if (m_max_size != 0) {
- m_vec = new TYPE[m_max_size];
- assert(m_vec != NULL);
- } else {
- m_vec = NULL;
- }
-
- // Copy the elements of the array
- for(int i=0; i<m_size; i++) {
- m_vec[i] = vec.m_vec[i]; // Element copy
- }
- }
- return *this;
-}
-
-template <class TYPE>
-void Vector<TYPE>::grow(int new_max_size)
-{
- TYPE* temp_vec;
- m_max_size = new_max_size;
- if (new_max_size != 0) {
- temp_vec = new TYPE[new_max_size];
- assert(temp_vec != NULL);
- } else {
- temp_vec = NULL;
- }
-
- // Copy the elements of the array
- for(int i=0; i<m_size; i++) {
- temp_vec[i] = m_vec[i]; // Element copy
- }
- delete [] m_vec;
- m_vec = temp_vec;
-}
-
-template <class TYPE>
-std::ostream& operator<<(std::ostream& out, const Vector<TYPE>& vec)
-{
- vec.print(out);
- return out;
-}
-
-#endif //VECTOR_H
diff --git a/src/mem/ruby/buffers/MessageBuffer.hh b/src/mem/ruby/buffers/MessageBuffer.hh
index 1da6c15ae..12799c871 100644
--- a/src/mem/ruby/buffers/MessageBuffer.hh
+++ b/src/mem/ruby/buffers/MessageBuffer.hh
@@ -121,7 +121,7 @@ class MessageBuffer
m_strict_fifo = order;
m_ordering_set = true;
}
- void setSize(int size) { m_max_size = size; }
+ void resize(int size) { m_max_size = size; }
int getSize();
void setRandomization(bool random_flag) { m_randomization = random_flag; }
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh
index edf774166..007040930 100644
--- a/src/mem/ruby/common/DataBlock.hh
+++ b/src/mem/ruby/common/DataBlock.hh
@@ -32,7 +32,6 @@
#include <iomanip>
#include <iostream>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/System.hh"
diff --git a/src/mem/ruby/common/Histogram.cc b/src/mem/ruby/common/Histogram.cc
index c57b55997..dcb723f1b 100644
--- a/src/mem/ruby/common/Histogram.cc
+++ b/src/mem/ruby/common/Histogram.cc
@@ -58,7 +58,7 @@ Histogram::clear(int bins)
m_bins = bins;
m_largest_bin = 0;
m_max = 0;
- m_data.setSize(m_bins);
+ m_data.resize(m_bins);
for (int i = 0; i < m_bins; i++) {
m_data[i] = 0;
}
diff --git a/src/mem/ruby/common/Histogram.hh b/src/mem/ruby/common/Histogram.hh
index e5cd211d6..81cfbd477 100644
--- a/src/mem/ruby/common/Histogram.hh
+++ b/src/mem/ruby/common/Histogram.hh
@@ -30,9 +30,9 @@
#define __MEM_RUBY_COMMON_HISTOGRAM_HH__
#include <iostream>
+#include <vector>
#include "mem/ruby/common/Global.hh"
-#include "mem/gems_common/Vector.hh"
class Histogram
{
@@ -56,7 +56,7 @@ class Histogram
void print(std::ostream& out) const;
private:
- Vector<int64> m_data;
+ std::vector<int64> m_data;
int64 m_max; // the maximum value seen so far
int64 m_count; // the number of elements added
int m_binsize; // the size of each bucket
diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc
index 509d0d223..dbe02b0ca 100644
--- a/src/mem/ruby/common/NetDest.cc
+++ b/src/mem/ruby/common/NetDest.cc
@@ -31,7 +31,7 @@
NetDest::NetDest()
{
- setSize();
+ resize();
}
void
@@ -107,16 +107,16 @@ NetDest::broadcast(MachineType machineType)
}
//For Princeton Network
-Vector<NodeID>
+std::vector<NodeID>
NetDest::getAllDest()
{
- Vector<NodeID> dest;
+ std::vector<NodeID> dest;
dest.clear();
for (int i = 0; i < m_bits.size(); i++) {
for (int j = 0; j < m_bits[i].getSize(); j++) {
if (m_bits[i].isElement(j)) {
int id = MachineType_base_number((MachineType)i) + j;
- dest.insertAtBottom((NodeID)id);
+ dest.push_back((NodeID)id);
}
}
}
@@ -249,9 +249,9 @@ NetDest::isElement(MachineID element) const
}
void
-NetDest::setSize()
+NetDest::resize()
{
- m_bits.setSize(MachineType_base_level(MachineType_NUM));
+ m_bits.resize(MachineType_base_level(MachineType_NUM));
assert(m_bits.size() == MachineType_NUM);
for (int i = 0; i < m_bits.size(); i++) {
diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh
index a8d0009d7..3fe87f69b 100644
--- a/src/mem/ruby/common/NetDest.hh
+++ b/src/mem/ruby/common/NetDest.hh
@@ -35,8 +35,8 @@
#define __MEM_RUBY_COMMON_NETDEST_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/protocol/MachineType.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Set.hh"
@@ -89,12 +89,12 @@ class NetDest
bool isEmpty() const;
// For Princeton Network
- Vector<NodeID> getAllDest();
+ std::vector<NodeID> getAllDest();
MachineID smallestElement() const;
MachineID smallestElement(MachineType machine) const;
- void setSize();
+ void resize();
int getSize() const { return m_bits.size(); }
// get element for a index
@@ -119,7 +119,7 @@ class NetDest
return index;
}
- Vector <Set> m_bits; // a Vector of bit vectors - i.e. Sets
+ std::vector<Set> m_bits; // a vector of bit vectors - i.e. Sets
};
inline std::ostream&
diff --git a/src/mem/ruby/common/SubBlock.cc b/src/mem/ruby/common/SubBlock.cc
index 5a42a415d..48485bf8b 100644
--- a/src/mem/ruby/common/SubBlock.cc
+++ b/src/mem/ruby/common/SubBlock.cc
@@ -26,12 +26,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/common/SubBlock.hh"
+using m5::stl_helpers::operator<<;
+
SubBlock::SubBlock(const Address& addr, int size)
{
m_address = addr;
- setSize(size);
+ resize(size);
for (int i = 0; i < size; i++) {
setByte(i, 0);
}
diff --git a/src/mem/ruby/common/SubBlock.hh b/src/mem/ruby/common/SubBlock.hh
index 571d45b57..3ebc99630 100644
--- a/src/mem/ruby/common/SubBlock.hh
+++ b/src/mem/ruby/common/SubBlock.hh
@@ -30,8 +30,8 @@
#define __MEM_RUBY_COMMON_SUBBLOCK_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/DataBlock.hh"
#include "mem/ruby/common/Global.hh"
@@ -47,7 +47,7 @@ class SubBlock
void setAddress(const Address& addr) { m_address = addr; }
int getSize() const { return m_data.size(); }
- void setSize(int size) { m_data.setSize(size); }
+ void resize(int size) { m_data.resize(size); }
uint8 getByte(int offset) const { return m_data[offset]; }
void setByte(int offset, uint8 data) { m_data[offset] = data; }
@@ -68,7 +68,7 @@ class SubBlock
// Data Members (m_ prefix)
Address m_address;
- Vector<uint8_t> m_data;
+ std::vector<uint8_t> m_data;
};
inline std::ostream&
diff --git a/src/mem/ruby/eventqueue/RubyEventQueue.hh b/src/mem/ruby/eventqueue/RubyEventQueue.hh
index d2ebc42c2..4a0fb9ceb 100644
--- a/src/mem/ruby/eventqueue/RubyEventQueue.hh
+++ b/src/mem/ruby/eventqueue/RubyEventQueue.hh
@@ -60,7 +60,6 @@
#include "config/no_vector_bounds_checks.hh"
#include "mem/ruby/common/Global.hh"
-#include "mem/gems_common/Vector.hh"
#include "sim/eventq.hh"
class Consumer;
diff --git a/src/mem/ruby/filters/BlockBloomFilter.cc b/src/mem/ruby/filters/BlockBloomFilter.cc
index 875a0d015..04e548fea 100644
--- a/src/mem/ruby/filters/BlockBloomFilter.cc
+++ b/src/mem/ruby/filters/BlockBloomFilter.cc
@@ -48,7 +48,7 @@ BlockBloomFilter::BlockBloomFilter(string str)
m_filter_size = atoi(head.c_str());
m_filter_size_bits = floorLog2(m_filter_size);
- m_filter.setSize(m_filter_size);
+ m_filter.resize(m_filter_size);
clear();
}
diff --git a/src/mem/ruby/filters/BlockBloomFilter.hh b/src/mem/ruby/filters/BlockBloomFilter.hh
index be31b025f..ade599f42 100644
--- a/src/mem/ruby/filters/BlockBloomFilter.hh
+++ b/src/mem/ruby/filters/BlockBloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -62,7 +62,7 @@ class BlockBloomFilter : public AbstractBloomFilter
private:
int get_index(const Address& addr);
- Vector<int> m_filter;
+ std::vector<int> m_filter;
int m_filter_size;
int m_filter_size_bits;
diff --git a/src/mem/ruby/filters/BulkBloomFilter.cc b/src/mem/ruby/filters/BulkBloomFilter.cc
index a03cba37b..887c024dd 100644
--- a/src/mem/ruby/filters/BulkBloomFilter.cc
+++ b/src/mem/ruby/filters/BulkBloomFilter.cc
@@ -49,8 +49,8 @@ BulkBloomFilter::BulkBloomFilter(string str)
// split the filter bits in half, c0 and c1
m_sector_bits = m_filter_size_bits - 1;
- m_temp_filter.setSize(m_filter_size);
- m_filter.setSize(m_filter_size);
+ m_temp_filter.resize(m_filter_size);
+ m_filter.resize(m_filter_size);
clear();
// clear temp filter
diff --git a/src/mem/ruby/filters/BulkBloomFilter.hh b/src/mem/ruby/filters/BulkBloomFilter.hh
index 5a3117a60..50b24732f 100644
--- a/src/mem/ruby/filters/BulkBloomFilter.hh
+++ b/src/mem/ruby/filters/BulkBloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -63,8 +63,8 @@ class BulkBloomFilter : public AbstractBloomFilter
int get_index(const Address& addr);
Address permute(const Address & addr);
- Vector<int> m_filter;
- Vector<int> m_temp_filter;
+ std::vector<int> m_filter;
+ std::vector<int> m_temp_filter;
int m_filter_size;
int m_filter_size_bits;
diff --git a/src/mem/ruby/filters/H3BloomFilter.cc b/src/mem/ruby/filters/H3BloomFilter.cc
index d0a4f400d..683dbc1fc 100644
--- a/src/mem/ruby/filters/H3BloomFilter.cc
+++ b/src/mem/ruby/filters/H3BloomFilter.cc
@@ -401,7 +401,7 @@ H3BloomFilter::H3BloomFilter(string str)
m_par_filter_size = m_filter_size / m_num_hashes;
m_par_filter_size_bits = floorLog2(m_par_filter_size);
- m_filter.setSize(m_filter_size);
+ m_filter.resize(m_filter_size);
clear();
}
diff --git a/src/mem/ruby/filters/H3BloomFilter.hh b/src/mem/ruby/filters/H3BloomFilter.hh
index babd86657..b040af42f 100644
--- a/src/mem/ruby/filters/H3BloomFilter.hh
+++ b/src/mem/ruby/filters/H3BloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -72,7 +72,7 @@ class H3BloomFilter : public AbstractBloomFilter
int hash_H3(uint64 value, int index);
- Vector<int> m_filter;
+ std::vector<int> m_filter;
int m_filter_size;
int m_num_hashes;
int m_filter_size_bits;
diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc
index 029ce1501..5cd4a6be1 100644
--- a/src/mem/ruby/filters/LSB_CountingBloomFilter.cc
+++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.cc
@@ -49,7 +49,7 @@ LSB_CountingBloomFilter::LSB_CountingBloomFilter(string str)
m_count = atoi(tail.c_str());
m_count_bits = floorLog2(m_count);
- m_filter.setSize(m_filter_size);
+ m_filter.resize(m_filter_size);
clear();
}
diff --git a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh
index 1ce65edcf..252f61682 100644
--- a/src/mem/ruby/filters/LSB_CountingBloomFilter.hh
+++ b/src/mem/ruby/filters/LSB_CountingBloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -62,7 +62,7 @@ class LSB_CountingBloomFilter : public AbstractBloomFilter
private:
int get_index(const Address& addr);
- Vector<int> m_filter;
+ std::vector<int> m_filter;
int m_filter_size;
int m_filter_size_bits;
diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc
index 466e3fccb..e57bc3d30 100644
--- a/src/mem/ruby/filters/MultiBitSelBloomFilter.cc
+++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.cc
@@ -61,7 +61,7 @@ MultiBitSelBloomFilter::MultiBitSelBloomFilter(string str)
m_par_filter_size = m_filter_size / m_num_hashes;
m_par_filter_size_bits = floorLog2(m_par_filter_size);
- m_filter.setSize(m_filter_size);
+ m_filter.resize(m_filter_size);
clear();
}
diff --git a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh
index f53b2595a..5263309a4 100644
--- a/src/mem/ruby/filters/MultiBitSelBloomFilter.hh
+++ b/src/mem/ruby/filters/MultiBitSelBloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -73,7 +73,7 @@ class MultiBitSelBloomFilter : public AbstractBloomFilter
int hash_bitsel(uint64 value, int index, int jump, int maxBits,
int numBits);
- Vector<int> m_filter;
+ std::vector<int> m_filter;
int m_filter_size;
int m_num_hashes;
int m_filter_size_bits;
diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.cc b/src/mem/ruby/filters/MultiGrainBloomFilter.cc
index 7b3976473..d05ca925d 100644
--- a/src/mem/ruby/filters/MultiGrainBloomFilter.cc
+++ b/src/mem/ruby/filters/MultiGrainBloomFilter.cc
@@ -52,8 +52,8 @@ MultiGrainBloomFilter::MultiGrainBloomFilter(string str)
m_page_filter_size = atoi(tail.c_str());
m_page_filter_size_bits = floorLog2(m_page_filter_size);
- m_filter.setSize(m_filter_size);
- m_page_filter.setSize(m_page_filter_size);
+ m_filter.resize(m_filter_size);
+ m_page_filter.resize(m_page_filter_size);
clear();
}
diff --git a/src/mem/ruby/filters/MultiGrainBloomFilter.hh b/src/mem/ruby/filters/MultiGrainBloomFilter.hh
index 8be226c02..dfe9c3e98 100644
--- a/src/mem/ruby/filters/MultiGrainBloomFilter.hh
+++ b/src/mem/ruby/filters/MultiGrainBloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -64,11 +64,11 @@ class MultiGrainBloomFilter : public AbstractBloomFilter
int get_page_index(const Address & addr);
// The block filter
- Vector<int> m_filter;
+ std::vector<int> m_filter;
int m_filter_size;
int m_filter_size_bits;
// The page number filter
- Vector<int> m_page_filter;
+ std::vector<int> m_page_filter;
int m_page_filter_size;
int m_page_filter_size_bits;
diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.cc b/src/mem/ruby/filters/NonCountingBloomFilter.cc
index 909aaf76b..14a16de20 100644
--- a/src/mem/ruby/filters/NonCountingBloomFilter.cc
+++ b/src/mem/ruby/filters/NonCountingBloomFilter.cc
@@ -48,7 +48,7 @@ NonCountingBloomFilter::NonCountingBloomFilter(string str)
m_offset = atoi(tail.c_str());
m_filter_size_bits = floorLog2(m_filter_size);
- m_filter.setSize(m_filter_size);
+ m_filter.resize(m_filter_size);
clear();
}
diff --git a/src/mem/ruby/filters/NonCountingBloomFilter.hh b/src/mem/ruby/filters/NonCountingBloomFilter.hh
index 414de4bc8..57274ef87 100644
--- a/src/mem/ruby/filters/NonCountingBloomFilter.hh
+++ b/src/mem/ruby/filters/NonCountingBloomFilter.hh
@@ -31,8 +31,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/filters/AbstractBloomFilter.hh"
@@ -69,7 +69,7 @@ class NonCountingBloomFilter : public AbstractBloomFilter
private:
int get_index(const Address& addr);
- Vector<int> m_filter;
+ std::vector<int> m_filter;
int m_filter_size;
int m_offset;
int m_filter_size_bits;
diff --git a/src/mem/ruby/network/Network.cc b/src/mem/ruby/network/Network.cc
index 89b9168b6..f2e056f75 100644
--- a/src/mem/ruby/network/Network.cc
+++ b/src/mem/ruby/network/Network.cc
@@ -90,7 +90,7 @@ Network::MessageSizeType_to_int(MessageSizeType size_type)
return 0;
}
-const Vector<Throttle*>*
+const std::vector<Throttle*>*
Network::getThrottles(NodeID id) const
{
return NULL;
diff --git a/src/mem/ruby/network/Network.hh b/src/mem/ruby/network/Network.hh
index fb56904db..51be0105c 100644
--- a/src/mem/ruby/network/Network.hh
+++ b/src/mem/ruby/network/Network.hh
@@ -42,6 +42,7 @@
#include <iostream>
#include <string>
+#include <vector>
#include "mem/protocol/MessageSizeType.hh"
#include "mem/ruby/common/Global.hh"
@@ -76,7 +77,7 @@ class Network : public SimObject
int netNumber) = 0;
virtual MessageBuffer* getFromNetQueue(NodeID id, bool ordered,
int netNumber) = 0;
- virtual const Vector<Throttle*>* getThrottles(NodeID id) const;
+ virtual const std::vector<Throttle*>* getThrottles(NodeID id) const;
virtual int getNumNodes() {return 1;}
virtual void makeOutLink(SwitchID src, NodeID dest,
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
index 8bdea4894..124a38e93 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
@@ -28,6 +28,7 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
#include "mem/protocol/MachineType.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh"
@@ -39,6 +40,7 @@
#include "mem/ruby/common/NetDest.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
GarnetNetwork_d::GarnetNetwork_d(const Params *p)
: BaseGarnetNetwork(p)
@@ -52,10 +54,10 @@ GarnetNetwork_d::GarnetNetwork_d(const Params *p)
m_router_ptr_vector.clear();
// Allocate to and from queues
- m_toNetQueues.setSize(m_nodes); // Queues that are getting messages from protocol
- m_fromNetQueues.setSize(m_nodes); // Queues that are feeding the protocol
- m_in_use.setSize(m_virtual_networks);
- m_ordered.setSize(m_virtual_networks);
+ m_toNetQueues.resize(m_nodes); // Queues that are getting messages from protocol
+ m_fromNetQueues.resize(m_nodes); // Queues that are feeding the protocol
+ m_in_use.resize(m_virtual_networks);
+ m_ordered.resize(m_virtual_networks);
for (int i = 0; i < m_virtual_networks; i++)
{
m_in_use[i] = false;
@@ -65,8 +67,8 @@ GarnetNetwork_d::GarnetNetwork_d(const Params *p)
for (int node = 0; node < m_nodes; node++)
{
//Setting how many vitual message buffers will there be per Network Queue
- m_toNetQueues[node].setSize(m_virtual_networks);
- m_fromNetQueues[node].setSize(m_virtual_networks);
+ m_toNetQueues[node].resize(m_virtual_networks);
+ m_fromNetQueues[node].resize(m_virtual_networks);
for (int j = 0; j < m_virtual_networks; j++)
{
@@ -88,13 +90,13 @@ void GarnetNetwork_d::init()
int number_of_routers = m_topology_ptr->numSwitches();
for (int i=0; i<number_of_routers; i++) {
- m_router_ptr_vector.insertAtBottom(new Router_d(i, this));
+ m_router_ptr_vector.push_back(new Router_d(i, this));
}
for (int i=0; i < m_nodes; i++) {
NetworkInterface_d *ni = new NetworkInterface_d(i, m_virtual_networks, this);
ni->addNode(m_toNetQueues[i], m_fromNetQueues[i]);
- m_ni_ptr_vector.insertAtBottom(ni);
+ m_ni_ptr_vector.push_back(ni);
}
m_topology_ptr->createLinks(this, false); // false because this isn't a reconfiguration
for(int i = 0; i < m_router_ptr_vector.size(); i++)
@@ -107,13 +109,13 @@ GarnetNetwork_d::~GarnetNetwork_d()
{
for (int i = 0; i < m_nodes; i++)
{
- m_toNetQueues[i].deletePointers();
- m_fromNetQueues[i].deletePointers();
+ deletePointers(m_toNetQueues[i]);
+ deletePointers(m_fromNetQueues[i]);
}
- m_router_ptr_vector.deletePointers();
- m_ni_ptr_vector.deletePointers();
- m_link_ptr_vector.deletePointers();
- m_creditlink_ptr_vector.deletePointers();
+ deletePointers(m_router_ptr_vector);
+ deletePointers(m_ni_ptr_vector);
+ deletePointers(m_link_ptr_vector);
+ deletePointers(m_creditlink_ptr_vector);
delete m_topology_ptr;
}
@@ -143,8 +145,8 @@ void GarnetNetwork_d::makeInLink(NodeID src, SwitchID dest, const NetDest& routi
{
NetworkLink_d *net_link = new NetworkLink_d(m_link_ptr_vector.size(), link_latency, this);
CreditLink_d *credit_link = new CreditLink_d(m_creditlink_ptr_vector.size(), link_latency, this);
- m_link_ptr_vector.insertAtBottom(net_link);
- m_creditlink_ptr_vector.insertAtBottom(credit_link);
+ m_link_ptr_vector.push_back(net_link);
+ m_creditlink_ptr_vector.push_back(credit_link);
m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
m_ni_ptr_vector[src]->addOutPort(net_link, credit_link);
@@ -172,8 +174,8 @@ void GarnetNetwork_d::makeOutLink(SwitchID src, NodeID dest, const NetDest& rout
{
NetworkLink_d *net_link = new NetworkLink_d(m_link_ptr_vector.size(), link_latency, this);
CreditLink_d *credit_link = new CreditLink_d(m_creditlink_ptr_vector.size(), link_latency, this);
- m_link_ptr_vector.insertAtBottom(net_link);
- m_creditlink_ptr_vector.insertAtBottom(credit_link);
+ m_link_ptr_vector.push_back(net_link);
+ m_creditlink_ptr_vector.push_back(credit_link);
m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry, link_weight, credit_link);
m_ni_ptr_vector[dest]->addInPort(net_link, credit_link);
@@ -195,8 +197,8 @@ void GarnetNetwork_d::makeInternalLink(SwitchID src, SwitchID dest, const NetDes
{
NetworkLink_d *net_link = new NetworkLink_d(m_link_ptr_vector.size(), link_latency, this);
CreditLink_d *credit_link = new CreditLink_d(m_creditlink_ptr_vector.size(), link_latency, this);
- m_link_ptr_vector.insertAtBottom(net_link);
- m_creditlink_ptr_vector.insertAtBottom(credit_link);
+ m_link_ptr_vector.push_back(net_link);
+ m_creditlink_ptr_vector.push_back(credit_link);
m_router_ptr_vector[dest]->addInPort(net_link, credit_link);
m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry, link_weight, credit_link);
@@ -244,8 +246,8 @@ Time GarnetNetwork_d::getRubyStartTime()
void GarnetNetwork_d::printStats(ostream& out) const
{ double average_link_utilization = 0;
- Vector<double > average_vc_load;
- average_vc_load.setSize(m_virtual_networks*m_vcs_per_class);
+ vector<double> average_vc_load;
+ average_vc_load.resize(m_virtual_networks*m_vcs_per_class);
for(int i = 0; i < m_virtual_networks*m_vcs_per_class; i++)
{
@@ -260,7 +262,7 @@ void GarnetNetwork_d::printStats(ostream& out) const
{
average_link_utilization += (double(m_link_ptr_vector[i]->getLinkUtilization())) / (double(g_eventQueue_ptr->getTime()-m_ruby_start));
- Vector<int > vc_load = m_link_ptr_vector[i]->getVcLoad();
+ vector<int> vc_load = m_link_ptr_vector[i]->getVcLoad();
for(int j = 0; j < vc_load.size(); j++)
{
assert(vc_load.size() == m_vcs_per_class*m_virtual_networks);
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
index 7cb87b21a..7f1b293f4 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
@@ -32,9 +32,9 @@
#define GARNETNETWORK_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
#include "mem/ruby/network/Network.hh"
#include "params/GarnetNetwork_d.hh"
@@ -112,16 +112,16 @@ private:
int m_flits_recieved, m_flits_injected;
double m_network_latency, m_queueing_latency;
- Vector<bool> m_in_use;
- Vector<bool> m_ordered;
+ std::vector<bool> m_in_use;
+ std::vector<bool> m_ordered;
- Vector<Vector<MessageBuffer*> > m_toNetQueues;
- Vector<Vector<MessageBuffer*> > m_fromNetQueues;
+ std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
+ std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
- Vector<Router_d *> m_router_ptr_vector; // All Routers in Network
- Vector<NetworkLink_d *> m_link_ptr_vector; // All links in the network
- Vector<CreditLink_d *> m_creditlink_ptr_vector; // All links in the network
- Vector<NetworkInterface_d *> m_ni_ptr_vector; // All NI's in Network
+ std::vector<Router_d *> m_router_ptr_vector; // All Routers in Network
+ std::vector<NetworkLink_d *> m_link_ptr_vector; // All links in the network
+ std::vector<CreditLink_d *> m_creditlink_ptr_vector; // All links in the network
+ std::vector<NetworkInterface_d *> m_ni_ptr_vector; // All NI's in Network
// Topology* m_topology_ptr;
Time m_ruby_start;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc
index ea8f7789b..d41c3d4ee 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.cc
@@ -28,10 +28,12 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
InputUnit_d::InputUnit_d(int id, Router_d *router)
{
@@ -44,7 +46,7 @@ InputUnit_d::InputUnit_d(int id, Router_d *router)
creditQueue = new flitBuffer_d();
// Instantiating the virtual channels
- m_vcs.setSize(m_num_vcs);
+ m_vcs.resize(m_num_vcs);
for(int i=0; i < m_num_vcs; i++)
{
m_vcs[i] = new VirtualChannel_d(i);
@@ -54,7 +56,7 @@ InputUnit_d::InputUnit_d(int id, Router_d *router)
InputUnit_d::~InputUnit_d()
{
delete creditQueue;
- m_vcs.deletePointers();
+ deletePointers(m_vcs);
}
void InputUnit_d::wakeup()
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
index 05358bc8b..4f02729ed 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
@@ -32,11 +32,11 @@
#define INPUT_UNIT_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
#include "mem/ruby/common/Consumer.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/CreditLink_d.hh"
@@ -163,7 +163,7 @@ private:
flitBuffer_d *creditQueue;
// Virtual channels
- Vector<VirtualChannel_d *> m_vcs; // [vc]
+ std::vector<VirtualChannel_d *> m_vcs; // [vc]
};
#endif
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
index 2a2536d53..3cda065ad 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
@@ -30,11 +30,15 @@
#include <cmath>
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+using namespace std;
+using m5::stl_helpers::deletePointers;
+
NetworkInterface_d::NetworkInterface_d(int id, int virtual_networks, GarnetNetwork_d *network_ptr)
{
m_id = id;
@@ -44,10 +48,10 @@ NetworkInterface_d::NetworkInterface_d(int id, int virtual_networks, GarnetNetwo
m_num_vcs = m_vc_per_vnet*m_virtual_networks;
m_vc_round_robin = 0;
- m_ni_buffers.setSize(m_num_vcs);
- m_ni_enqueue_time.setSize(m_num_vcs);
- inNode_ptr.setSize(m_virtual_networks);
- outNode_ptr.setSize(m_virtual_networks);
+ m_ni_buffers.resize(m_num_vcs);
+ m_ni_enqueue_time.resize(m_num_vcs);
+ inNode_ptr.resize(m_virtual_networks);
+ outNode_ptr.resize(m_virtual_networks);
creditQueue = new flitBuffer_d();
for(int i =0; i < m_num_vcs; i++)
@@ -55,7 +59,7 @@ NetworkInterface_d::NetworkInterface_d(int id, int virtual_networks, GarnetNetwo
m_ni_buffers[i] = new flitBuffer_d(); // instantiating the NI flit buffers
m_ni_enqueue_time[i] = INFINITE_;
}
- m_vc_allocator.setSize(m_virtual_networks); // 1 allocator per virtual net
+ m_vc_allocator.resize(m_virtual_networks); // 1 allocator per virtual net
for(int i = 0; i < m_virtual_networks; i++)
{
m_vc_allocator[i] = 0;
@@ -63,15 +67,15 @@ NetworkInterface_d::NetworkInterface_d(int id, int virtual_networks, GarnetNetwo
for(int i = 0; i < m_num_vcs; i++)
{
- m_out_vc_state.insertAtBottom(new OutVcState_d(i, m_net_ptr));
+ m_out_vc_state.push_back(new OutVcState_d(i, m_net_ptr));
m_out_vc_state[i]->setState(IDLE_, g_eventQueue_ptr->getTime());
}
}
NetworkInterface_d::~NetworkInterface_d()
{
- m_out_vc_state.deletePointers();
- m_ni_buffers.deletePointers();
+ deletePointers(m_out_vc_state);
+ deletePointers(m_ni_buffers);
delete creditQueue;
delete outSrcQueue;
}
@@ -94,7 +98,7 @@ void NetworkInterface_d::addOutPort(NetworkLink_d *out_link, CreditLink_d *credi
out_link->setSourceQueue(outSrcQueue);
}
-void NetworkInterface_d::addNode(Vector<MessageBuffer*>& in, Vector<MessageBuffer*>& out)
+void NetworkInterface_d::addNode(vector<MessageBuffer*>& in, vector<MessageBuffer*>& out)
{
ASSERT(in.size() == m_virtual_networks);
inNode_ptr = in;
@@ -110,7 +114,7 @@ bool NetworkInterface_d::flitisizeMessage(MsgPtr msg_ptr, int vnet)
NetworkMessage *net_msg_ptr =
safe_cast<NetworkMessage *>(msg_ptr.get());
NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
- Vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
+ vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh
index 88d882969..0da162f82 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.hh
@@ -32,10 +32,10 @@
#define NET_INTERFACE_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/slicc_interface/Message.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh"
@@ -56,7 +56,8 @@ public:
void addOutPort(NetworkLink_d *out_link, CreditLink_d *credit_link);
void wakeup();
- void addNode(Vector<MessageBuffer *> &inNode, Vector<MessageBuffer *> &outNode);
+ void addNode(std::vector<MessageBuffer *> &inNode,
+ std::vector<MessageBuffer *> &outNode);
void printConfig(std::ostream& out) const;
void print(std::ostream& out) const;
int get_vnet(int vc);
@@ -66,8 +67,8 @@ private:
GarnetNetwork_d *m_net_ptr;
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
NodeID m_id;
- Vector<OutVcState_d *> m_out_vc_state;
- Vector<int > m_vc_allocator;
+ std::vector<OutVcState_d *> m_out_vc_state;
+ std::vector<int > m_vc_allocator;
int m_vc_round_robin; // For round robin scheduling
flitBuffer_d *outSrcQueue; // For modelling link contention
flitBuffer_d *creditQueue;
@@ -78,11 +79,11 @@ private:
CreditLink_d *m_ni_credit_link;
// Input Flit Buffers
- Vector<flitBuffer_d *> m_ni_buffers; // The flit buffers which will serve the Consumer
- Vector<Time > m_ni_enqueue_time;
+ std::vector<flitBuffer_d *> m_ni_buffers; // The flit buffers which will serve the Consumer
+ std::vector<Time > m_ni_enqueue_time;
- Vector<MessageBuffer *> inNode_ptr; // The Message buffers that takes messages from the protocol
- Vector<MessageBuffer *> outNode_ptr; // The Message buffers that provides messages to the protocol
+ std::vector<MessageBuffer *> inNode_ptr; // The Message buffers that takes messages from the protocol
+ std::vector<MessageBuffer *> outNode_ptr; // The Message buffers that provides messages to the protocol
bool flitisizeMessage(MsgPtr msg_ptr, int vnet);
int calculateVC(int vnet);
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
index 92b2d44f8..b45a7be06 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.cc
@@ -40,7 +40,7 @@ NetworkLink_d::NetworkLink_d(int id)
linkBuffer = new flitBuffer_d();
m_link_utilized = 0;
- m_vc_load.setSize(NetworkConfig::getVCsPerClass()*RubySystem::getNetwork()->getNumberOfVirtualNetworks());
+ m_vc_load.resize(NetworkConfig::getVCsPerClass()*RubySystem::getNetwork()->getNumberOfVirtualNetworks());
for(int i = 0; i < NetworkConfig::getVCsPerClass()*RubySystem::getNetwork()->getNumberOfVirtualNetworks(); i++)
m_vc_load[i] = 0;
@@ -53,7 +53,7 @@ NetworkLink_d::NetworkLink_d(int id, int link_latency, GarnetNetwork_d *net_ptr)
m_latency = link_latency;
linkBuffer = new flitBuffer_d();
m_link_utilized = 0;
- m_vc_load.setSize(m_net_ptr->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks());
+ m_vc_load.resize(m_net_ptr->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks());
for(int i = 0; i < m_net_ptr->getVCsPerClass()*net_ptr->getNumberOfVirtualNetworks(); i++)
m_vc_load[i] = 0;
@@ -87,7 +87,7 @@ void NetworkLink_d::wakeup()
}
}
-Vector<int> NetworkLink_d::getVcLoad()
+std::vector<int> NetworkLink_d::getVcLoad()
{
return m_vc_load;
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
index c5f9f14d1..29699562d 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
@@ -32,6 +32,7 @@
#define NETWORK_LINK_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -51,7 +52,7 @@ public:
void setSourceQueue(flitBuffer_d *srcQueue);
void print(std::ostream& out) const{}
int getLinkUtilization();
- Vector<int> getVcLoad();
+ std::vector<int> getVcLoad();
int get_id(){return m_id;}
void wakeup();
@@ -80,7 +81,7 @@ protected:
Consumer *link_consumer;
flitBuffer_d *link_srcQueue;
int m_link_utilized;
- Vector<int > m_vc_load;
+ std::vector<int> m_vc_load;
int m_flit_width;
};
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
index 99475cf69..6e0508e75 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.cc
@@ -28,10 +28,12 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
OutputUnit_d::OutputUnit_d(int id, Router_d *router)
{
@@ -42,14 +44,14 @@ OutputUnit_d::OutputUnit_d(int id, Router_d *router)
for(int i = 0; i < m_num_vcs; i++)
{
- m_outvc_state.insertAtBottom(new OutVcState_d(i, m_router->get_net_ptr()));
+ m_outvc_state.push_back(new OutVcState_d(i, m_router->get_net_ptr()));
}
}
OutputUnit_d::~OutputUnit_d()
{
delete m_out_buffer;
- m_outvc_state.deletePointers();
+ deletePointers(m_outvc_state);
}
void OutputUnit_d::decrement_credit(int out_vc)
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
index 93cfd9d12..3daf8a76c 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
@@ -32,6 +32,7 @@
#define OUTPUT_UNIT_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -85,7 +86,7 @@ private:
CreditLink_d *m_credit_link;
flitBuffer_d *m_out_buffer; // This is for the network link to consume
- Vector<OutVcState_d *> m_outvc_state; // vc state of downstream router
+ std::vector<OutVcState_d *> m_outvc_state; // vc state of downstream router
};
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
index 428ba3260..e7b766dd7 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
@@ -28,6 +28,7 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh"
@@ -40,6 +41,7 @@
#include "mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
Router_d::Router_d(int id, GarnetNetwork_d *network_ptr)
{
@@ -69,8 +71,8 @@ Router_d::Router_d(int id, GarnetNetwork_d *network_ptr)
Router_d::~Router_d()
{
- m_input_unit.deletePointers();
- m_output_unit.deletePointers();
+ deletePointers(m_input_unit);
+ deletePointers(m_output_unit);
delete m_routing_unit;
delete m_vc_alloc;
delete m_sw_alloc;
@@ -94,7 +96,7 @@ void Router_d::addInPort(NetworkLink_d *in_link, CreditLink_d *credit_link)
in_link->setLinkConsumer(input_unit);
credit_link->setSourceQueue(input_unit->getCreditQueue());
- m_input_unit.insertAtBottom(input_unit);
+ m_input_unit.push_back(input_unit);
}
void Router_d::addOutPort(NetworkLink_d *out_link, const NetDest& routing_table_entry, int link_weight, CreditLink_d *credit_link)
@@ -107,7 +109,7 @@ void Router_d::addOutPort(NetworkLink_d *out_link, const NetDest& routing_table_
credit_link->setLinkConsumer(output_unit);
out_link->setSourceQueue(output_unit->getOutQueue());
- m_output_unit.insertAtBottom(output_unit);
+ m_output_unit.push_back(output_unit);
m_routing_unit->addRoute(routing_table_entry);
m_routing_unit->addWeight(link_weight);
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
index 91f79882c..f1b1e26aa 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
@@ -32,9 +32,9 @@
#define ROUTER_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
#include "mem/ruby/common/NetDest.hh"
#include "mem/ruby/network/orion/power_router_init.hh"
@@ -66,8 +66,8 @@ public:
int get_id() { return m_id; }
GarnetNetwork_d* get_net_ptr() { return m_network_ptr; }
- Vector<InputUnit_d *>& get_inputUnit_ref() { return m_input_unit; }
- Vector<OutputUnit_d *>& get_outputUnit_ref() { return m_output_unit; }
+ std::vector<InputUnit_d *>& get_inputUnit_ref() { return m_input_unit; }
+ std::vector<OutputUnit_d *>& get_outputUnit_ref() { return m_output_unit; }
void update_sw_winner(int inport, flit_d *t_flit);
void update_incredit(int in_port, int in_vc, int credit);
@@ -88,8 +88,8 @@ private:
double buf_read_count, buf_write_count, crossbar_count, vc_local_arbit_count, vc_global_arbit_count, sw_local_arbit_count, sw_global_arbit_count;
- Vector<InputUnit_d *> m_input_unit;
- Vector<OutputUnit_d *> m_output_unit;
+ std::vector<InputUnit_d *> m_input_unit;
+ std::vector<OutputUnit_d *> m_output_unit;
RoutingUnit_d *m_routing_unit;
VCallocator_d *m_vc_alloc;
SWallocator_d *m_sw_alloc;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
index fabda735a..a152c35d7 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.cc
@@ -42,12 +42,12 @@ RoutingUnit_d::RoutingUnit_d(Router_d *router)
void RoutingUnit_d::addRoute(const NetDest& routing_table_entry)
{
- m_routing_table.insertAtBottom(routing_table_entry);
+ m_routing_table.push_back(routing_table_entry);
}
void RoutingUnit_d::addWeight(int link_weight)
{
- m_weight_table.insertAtBottom(link_weight);
+ m_weight_table.push_back(link_weight);
}
void RoutingUnit_d::RC_stage(flit_d *t_flit, InputUnit_d *in_unit, int invc)
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.hh
index 9688623a7..409eb70f9 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/RoutingUnit_d.hh
@@ -49,8 +49,8 @@ public:
private:
Router_d *m_router;
- Vector<NetDest > m_routing_table;
- Vector<int > m_weight_table;
+ std::vector<NetDest > m_routing_table;
+ std::vector<int > m_weight_table;
};
#endif
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
index 4d607619f..c72a66189 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
@@ -51,10 +51,10 @@ void SWallocator_d::init()
m_num_inports = m_router->get_num_inports();
m_num_outports = m_router->get_num_outports();
- m_round_robin_outport.setSize(m_num_outports);
- m_round_robin_inport.setSize(m_num_inports);
- m_port_req.setSize(m_num_outports);
- m_vc_winners.setSize(m_num_outports);
+ m_round_robin_outport.resize(m_num_outports);
+ m_round_robin_inport.resize(m_num_inports);
+ m_port_req.resize(m_num_outports);
+ m_vc_winners.resize(m_num_outports);
for(int i = 0; i < m_num_inports; i++)
{
@@ -63,8 +63,8 @@ void SWallocator_d::init()
for(int i = 0; i < m_num_outports; i++)
{
- m_port_req[i].setSize(m_num_inports);
- m_vc_winners[i].setSize(m_num_inports);
+ m_port_req[i].resize(m_num_inports);
+ m_vc_winners[i].resize(m_num_inports);
m_round_robin_outport[i] = 0;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh
index 95a7dad1c..db175e445 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh
@@ -32,6 +32,7 @@
#define SW_ALLOCATOR_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -68,12 +69,12 @@ private:
double m_local_arbiter_activity, m_global_arbiter_activity;
Router_d *m_router;
- Vector<int > m_round_robin_outport;
- Vector<int > m_round_robin_inport;
- Vector<Vector<bool > > m_port_req;
- Vector<Vector<int > > m_vc_winners; // a list for each outport
- Vector<InputUnit_d *> m_input_unit;
- Vector<OutputUnit_d *> m_output_unit;
+ std::vector<int> m_round_robin_outport;
+ std::vector<int> m_round_robin_inport;
+ std::vector<std::vector<bool> > m_port_req;
+ std::vector<std::vector<int> > m_vc_winners; // a list for each outport
+ std::vector<InputUnit_d *> m_input_unit;
+ std::vector<OutputUnit_d *> m_output_unit;
};
#endif
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
index 9b999341d..22ec2c1f4 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
@@ -28,10 +28,13 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh"
+using m5::stl_helpers::deletePointers;
+
Switch_d::Switch_d(Router_d *router)
{
m_router = router;
@@ -41,7 +44,7 @@ Switch_d::Switch_d(Router_d *router)
Switch_d::~Switch_d()
{
- m_switch_buffer.deletePointers();
+ deletePointers(m_switch_buffer);
}
void Switch_d::init()
@@ -49,7 +52,7 @@ void Switch_d::init()
m_output_unit = m_router->get_outputUnit_ref();
m_num_inports = m_router->get_num_inports();
- m_switch_buffer.setSize(m_num_inports);
+ m_switch_buffer.resize(m_num_inports);
for(int i = 0; i < m_num_inports; i++)
{
m_switch_buffer[i] = new flitBuffer_d();
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh
index 09973b82d..83817b353 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh
@@ -32,6 +32,7 @@
#define SWITCH_D_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -63,8 +64,8 @@ private:
int m_num_inports;
double m_crossbar_activity;
Router_d *m_router;
- Vector<flitBuffer_d *> m_switch_buffer;
- Vector<OutputUnit_d *> m_output_unit;
+ std::vector<flitBuffer_d *> m_switch_buffer;
+ std::vector<OutputUnit_d *> m_output_unit;
};
#endif
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
index e08c70769..af1c608eb 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
@@ -50,14 +50,14 @@ void VCallocator_d::init()
m_num_inports = m_router->get_num_inports();
m_num_outports = m_router->get_num_outports();
- m_round_robin_invc.setSize(m_num_inports);
- m_round_robin_outvc.setSize(m_num_outports);
- m_outvc_req.setSize(m_num_outports);
- m_outvc_is_req.setSize(m_num_outports);
+ m_round_robin_invc.resize(m_num_inports);
+ m_round_robin_outvc.resize(m_num_outports);
+ m_outvc_req.resize(m_num_outports);
+ m_outvc_is_req.resize(m_num_outports);
for(int i = 0; i < m_num_inports; i++)
{
- m_round_robin_invc[i].setSize(m_num_vcs);
+ m_round_robin_invc[i].resize(m_num_vcs);
for(int j = 0; j < m_num_vcs; j++)
{
@@ -67,9 +67,9 @@ void VCallocator_d::init()
for(int i = 0; i < m_num_outports; i++)
{
- m_round_robin_outvc[i].setSize(m_num_vcs);
- m_outvc_req[i].setSize(m_num_vcs);
- m_outvc_is_req[i].setSize(m_num_vcs);
+ m_round_robin_outvc[i].resize(m_num_vcs);
+ m_outvc_req[i].resize(m_num_vcs);
+ m_outvc_is_req[i].resize(m_num_vcs);
for(int j = 0; j < m_num_vcs; j++)
{
@@ -77,11 +77,11 @@ void VCallocator_d::init()
m_round_robin_outvc[i][j].second = 0;
m_outvc_is_req[i][j] = false;
- m_outvc_req[i][j].setSize(m_num_inports);
+ m_outvc_req[i][j].resize(m_num_inports);
for(int k = 0; k < m_num_inports; k++)
{
- m_outvc_req[i][j][k].setSize(m_num_vcs);
+ m_outvc_req[i][j][k].resize(m_num_vcs);
for(int l = 0; l < m_num_vcs; l++)
{
m_outvc_req[i][j][k][l] = false;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh
index c6d06d1ae..942a3c6b0 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.hh
@@ -32,6 +32,7 @@
#define VC_ALLOCATOR_D_H
#include <iostream>
+#include <vector>
#include <utility>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
@@ -71,13 +72,13 @@ private:
double m_local_arbiter_activity, m_global_arbiter_activity;
Router_d *m_router;
- Vector<Vector <int > > m_round_robin_invc; // First stage of arbitration where all vcs select an output vc to content for
- Vector<Vector <std::pair<int, int> > > m_round_robin_outvc; // Arbiter for every output vc
- Vector<Vector<Vector<Vector<bool > > > > m_outvc_req; // [outport][outvc][inpotr][invc]. set true in the first phase of allocation
- Vector<Vector<bool > > m_outvc_is_req;
+ std::vector<std::vector<int > > m_round_robin_invc; // First stage of arbitration where all vcs select an output vc to content for
+ std::vector<std::vector<std::pair<int, int> > > m_round_robin_outvc; // Arbiter for every output vc
+ std::vector<std::vector<std::vector<std::vector<bool> > > > m_outvc_req; // [outport][outvc][inpotr][invc]. set true in the first phase of allocation
+ std::vector<std::vector<bool> > m_outvc_is_req;
- Vector<InputUnit_d *> m_input_unit ;
- Vector<OutputUnit_d *> m_output_unit ;
+ std::vector<InputUnit_d *> m_input_unit ;
+ std::vector<OutputUnit_d *> m_output_unit ;
};
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
index e063e6a0e..232898c52 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc
@@ -28,6 +28,7 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
#include "mem/protocol/MachineType.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh"
@@ -40,6 +41,7 @@
#include "mem/ruby/common/NetDest.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
GarnetNetwork::GarnetNetwork(const Params *p)
: BaseGarnetNetwork(p)
@@ -47,10 +49,10 @@ GarnetNetwork::GarnetNetwork(const Params *p)
m_ruby_start = 0;
// Allocate to and from queues
- m_toNetQueues.setSize(m_nodes); // Queues that are getting messages from protocol
- m_fromNetQueues.setSize(m_nodes); // Queues that are feeding the protocol
- m_in_use.setSize(m_virtual_networks);
- m_ordered.setSize(m_virtual_networks);
+ m_toNetQueues.resize(m_nodes); // Queues that are getting messages from protocol
+ m_fromNetQueues.resize(m_nodes); // Queues that are feeding the protocol
+ m_in_use.resize(m_virtual_networks);
+ m_ordered.resize(m_virtual_networks);
for (int i = 0; i < m_virtual_networks; i++)
{
m_in_use[i] = false;
@@ -60,8 +62,8 @@ GarnetNetwork::GarnetNetwork(const Params *p)
for (int node = 0; node < m_nodes; node++)
{
//Setting how many vitual message buffers will there be per Network Queue
- m_toNetQueues[node].setSize(m_virtual_networks);
- m_fromNetQueues[node].setSize(m_virtual_networks);
+ m_toNetQueues[node].resize(m_virtual_networks);
+ m_fromNetQueues[node].resize(m_virtual_networks);
for (int j = 0; j < m_virtual_networks; j++)
{
@@ -80,13 +82,13 @@ void GarnetNetwork::init()
int number_of_routers = m_topology_ptr->numSwitches();
for (int i=0; i<number_of_routers; i++) {
- m_router_ptr_vector.insertAtBottom(new Router(i, this));
+ m_router_ptr_vector.push_back(new Router(i, this));
}
for (int i=0; i < m_nodes; i++) {
NetworkInterface *ni = new NetworkInterface(i, m_virtual_networks, this);
ni->addNode(m_toNetQueues[i], m_fromNetQueues[i]);
- m_ni_ptr_vector.insertAtBottom(ni);
+ m_ni_ptr_vector.push_back(ni);
}
m_topology_ptr->createLinks(this, false); // false because this isn't a reconfiguration
}
@@ -95,12 +97,12 @@ GarnetNetwork::~GarnetNetwork()
{
for (int i = 0; i < m_nodes; i++)
{
- m_toNetQueues[i].deletePointers();
- m_fromNetQueues[i].deletePointers();
+ deletePointers(m_toNetQueues[i]);
+ deletePointers(m_fromNetQueues[i]);
}
- m_router_ptr_vector.deletePointers();
- m_ni_ptr_vector.deletePointers();
- m_link_ptr_vector.deletePointers();
+ deletePointers(m_router_ptr_vector);
+ deletePointers(m_ni_ptr_vector);
+ deletePointers(m_link_ptr_vector);
delete m_topology_ptr;
}
@@ -123,7 +125,7 @@ void GarnetNetwork::makeInLink(NodeID src, SwitchID dest, const NetDest& routing
if(!isReconfiguration)
{
NetworkLink *net_link = new NetworkLink(m_link_ptr_vector.size(), link_latency, this);
- m_link_ptr_vector.insertAtBottom(net_link);
+ m_link_ptr_vector.push_back(net_link);
m_router_ptr_vector[dest]->addInPort(net_link);
m_ni_ptr_vector[src]->addOutPort(net_link);
}
@@ -143,7 +145,7 @@ void GarnetNetwork::makeOutLink(SwitchID src, NodeID dest, const NetDest& routin
if(!isReconfiguration)
{
NetworkLink *net_link = new NetworkLink(m_link_ptr_vector.size(), link_latency, this);
- m_link_ptr_vector.insertAtBottom(net_link);
+ m_link_ptr_vector.push_back(net_link);
m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry, link_weight);
m_ni_ptr_vector[dest]->addInPort(net_link);
}
@@ -159,7 +161,7 @@ void GarnetNetwork::makeInternalLink(SwitchID src, SwitchID dest, const NetDest&
if(!isReconfiguration)
{
NetworkLink *net_link = new NetworkLink(m_link_ptr_vector.size(), link_latency, this);
- m_link_ptr_vector.insertAtBottom(net_link);
+ m_link_ptr_vector.push_back(net_link);
m_router_ptr_vector[dest]->addInPort(net_link);
m_router_ptr_vector[src]->addOutPort(net_link, routing_table_entry, link_weight);
}
@@ -208,8 +210,8 @@ Time GarnetNetwork::getRubyStartTime()
void GarnetNetwork::printStats(ostream& out) const
{ double average_link_utilization = 0;
- Vector<double > average_vc_load;
- average_vc_load.setSize(m_virtual_networks*m_vcs_per_class);
+ std::vector<double> average_vc_load;
+ average_vc_load.resize(m_virtual_networks*m_vcs_per_class);
for(int i = 0; i < m_virtual_networks*m_vcs_per_class; i++)
{
@@ -223,7 +225,7 @@ void GarnetNetwork::printStats(ostream& out) const
for(int i = 0; i < m_link_ptr_vector.size(); i++)
{
average_link_utilization += m_link_ptr_vector[i]->getLinkUtilization();
- Vector<int > vc_load = m_link_ptr_vector[i]->getVcLoad();
+ std::vector<int> vc_load = m_link_ptr_vector[i]->getVcLoad();
for(int j = 0; j < vc_load.size(); j++)
{
assert(vc_load.size() == m_vcs_per_class*m_virtual_networks);
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
index c116a324b..62857223e 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh
@@ -32,10 +32,10 @@
#define GARNET_NETWORK_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/network/Network.hh"
#include "params/GarnetNetwork.hh"
@@ -89,15 +89,15 @@ private:
// int m_virtual_networks;
// int m_nodes;
- Vector<bool> m_in_use;
- Vector<bool> m_ordered;
+ std::vector<bool> m_in_use;
+ std::vector<bool> m_ordered;
- Vector<Vector<MessageBuffer*> > m_toNetQueues;
- Vector<Vector<MessageBuffer*> > m_fromNetQueues;
+ std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
+ std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
- Vector<Router *> m_router_ptr_vector; // All Routers in Network
- Vector<NetworkLink *> m_link_ptr_vector; // All links in the network
- Vector<NetworkInterface *> m_ni_ptr_vector; // All NI's in Network
+ std::vector<Router *> m_router_ptr_vector; // All Routers in Network
+ std::vector<NetworkLink *> m_link_ptr_vector; // All links in the network
+ std::vector<NetworkInterface *> m_ni_ptr_vector; // All NI's in Network
// Topology* m_topology_ptr;
Time m_ruby_start;
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
index c81f5e4b2..b233ca0f5 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
@@ -30,11 +30,15 @@
#include <cmath>
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh"
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
+using namespace std;
+using m5::stl_helpers::deletePointers;
+
NetworkInterface::NetworkInterface(int id, int virtual_networks, GarnetNetwork *network_ptr)
{
m_id = id;
@@ -44,14 +48,14 @@ NetworkInterface::NetworkInterface(int id, int virtual_networks, GarnetNetwork *
m_num_vcs = m_vc_per_vnet*m_virtual_networks;
m_vc_round_robin = 0;
- m_ni_buffers.setSize(m_num_vcs);
- inNode_ptr.setSize(m_virtual_networks);
- outNode_ptr.setSize(m_virtual_networks);
+ m_ni_buffers.resize(m_num_vcs);
+ inNode_ptr.resize(m_virtual_networks);
+ outNode_ptr.resize(m_virtual_networks);
for(int i =0; i < m_num_vcs; i++)
m_ni_buffers[i] = new flitBuffer(); // instantiating the NI flit buffers
- m_vc_allocator.setSize(m_virtual_networks);
+ m_vc_allocator.resize(m_virtual_networks);
for(int i = 0; i < m_virtual_networks; i++)
{
m_vc_allocator[i] = 0;
@@ -59,15 +63,15 @@ NetworkInterface::NetworkInterface(int id, int virtual_networks, GarnetNetwork *
for(int i = 0; i < m_num_vcs; i++)
{
- m_out_vc_state.insertAtBottom(new OutVcState(i));
+ m_out_vc_state.push_back(new OutVcState(i));
m_out_vc_state[i]->setState(IDLE_, g_eventQueue_ptr->getTime());
}
}
NetworkInterface::~NetworkInterface()
{
- m_out_vc_state.deletePointers();
- m_ni_buffers.deletePointers();
+ deletePointers(m_out_vc_state);
+ deletePointers(m_ni_buffers);
delete outSrcQueue;
}
@@ -85,7 +89,7 @@ void NetworkInterface::addOutPort(NetworkLink *out_link)
out_link->setSource(this);
}
-void NetworkInterface::addNode(Vector<MessageBuffer*>& in, Vector<MessageBuffer*>& out)
+void NetworkInterface::addNode(vector<MessageBuffer*>& in, vector<MessageBuffer*>& out)
{
ASSERT(in.size() == m_virtual_networks);
inNode_ptr = in;
@@ -106,7 +110,7 @@ bool NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
NetworkMessage *net_msg_ptr =
safe_cast<NetworkMessage*>(msg_ptr.get());
NetDest net_msg_dest = net_msg_ptr->getInternalDestination();
- Vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
+ vector<NodeID> dest_nodes = net_msg_dest.getAllDest(); // gets all the destinations associated with this message.
int num_flits = (int) ceil((double) m_net_ptr->MessageSizeType_to_int(net_msg_ptr->getMessageSize())/m_net_ptr->getFlitSize() ); // Number of flits is dependent on the link bandwidth available. This is expressed in terms of bytes/cycle or the flit size
for(int ctr = 0; ctr < dest_nodes.size(); ctr++) // loop because we will be converting all multicast messages into unicast messages
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh
index bc2701125..01608498d 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.hh
@@ -32,10 +32,10 @@
#define NET_INTERFACE_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
#include "mem/ruby/slicc_interface/Message.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh"
@@ -55,7 +55,7 @@ public:
void addOutPort(NetworkLink *out_link);
void wakeup();
- void addNode(Vector<MessageBuffer *> &inNode, Vector<MessageBuffer *> &outNode);
+ void addNode(std::vector<MessageBuffer *> &inNode, std::vector<MessageBuffer *> &outNode);
void grant_vc(int out_port, int vc, Time grant_time);
void release_vc(int out_port, int vc, Time release_time);
bool isBufferNotFull(int vc, int inport)
@@ -73,8 +73,8 @@ private:
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
NodeID m_id;
- Vector<OutVcState *> m_out_vc_state;
- Vector<int > m_vc_allocator;
+ std::vector<OutVcState *> m_out_vc_state;
+ std::vector<int> m_vc_allocator;
int m_vc_round_robin; // For round robin scheduling
flitBuffer *outSrcQueue; // For modelling link contention
@@ -82,10 +82,10 @@ private:
NetworkLink *outNetLink;
// Input Flit Buffers
- Vector<flitBuffer *> m_ni_buffers; // The flit buffers which will serve the Consumer
+ std::vector<flitBuffer *> m_ni_buffers; // The flit buffers which will serve the Consumer
- Vector<MessageBuffer *> inNode_ptr; // The Message buffers that takes messages from the protocol
- Vector<MessageBuffer *> outNode_ptr; // The Message buffers that provides messages to the protocol
+ std::vector<MessageBuffer *> inNode_ptr; // The Message buffers that takes messages from the protocol
+ std::vector<MessageBuffer *> outNode_ptr; // The Message buffers that provides messages to the protocol
bool flitisizeMessage(MsgPtr msg_ptr, int vnet);
int calculateVC(int vnet);
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc
index 6e106137a..2947ce8ec 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.cc
@@ -42,7 +42,7 @@ NetworkLink::NetworkLink(int id, int latency, GarnetNetwork *net_ptr)
m_latency = latency;
int num_net = net_ptr->getNumberOfVirtualNetworks();
int num_vc = m_net_ptr->getVCsPerClass();
- m_vc_load.setSize(num_net*num_vc);
+ m_vc_load.resize(num_net * num_vc);
for(int i = 0; i < num_net*num_vc; i++)
m_vc_load[i] = 0;
@@ -91,7 +91,7 @@ void NetworkLink::release_vc_link(int vc, Time release_time)
link_source->release_vc(m_out_port, vc, release_time);
}
-Vector<int> NetworkLink::getVcLoad()
+std::vector<int> NetworkLink::getVcLoad()
{
return m_vc_load;
}
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
index 3f648ae14..c23d55b48 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
@@ -32,6 +32,7 @@
#define NETWORK_LINK_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
@@ -67,13 +68,13 @@ public:
bool isBufferNotFull_link(int vc);
void setSource(FlexibleConsumer *source);
double getLinkUtilization();
- Vector<int> getVcLoad();
+ std::vector<int> getVcLoad();
protected:
int m_id, m_latency;
int m_in_port, m_out_port;
int m_link_utilized;
- Vector<int > m_vc_load;
+ std::vector<int> m_vc_load;
GarnetNetwork *m_net_ptr;
flitBuffer *linkBuffer;
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
index 4cdb9dad8..95b92d49d 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
@@ -28,6 +28,7 @@
* Authors: Niket Agarwal
*/
+#include "base/stl_helpers.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/Router.hh"
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/InVcState.hh"
@@ -35,6 +36,7 @@
#include "mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
Router::Router(int id, GarnetNetwork *network_ptr)
{
@@ -52,14 +54,14 @@ Router::~Router()
{
for (int i = 0; i < m_in_link.size(); i++)
{
- m_in_vc_state[i].deletePointers();
+ deletePointers(m_in_vc_state[i]);
}
for (int i = 0; i < m_out_link.size(); i++)
{
- m_out_vc_state[i].deletePointers();
- m_router_buffers[i].deletePointers();
+ deletePointers(m_out_vc_state[i]);
+ deletePointers(m_router_buffers[i]);
}
- m_out_src_queue.deletePointers();
+ deletePointers(m_out_src_queue);
delete m_vc_arbiter;
}
@@ -67,19 +69,19 @@ Router::~Router()
void Router::addInPort(NetworkLink *in_link)
{
int port = m_in_link.size();
- Vector<InVcState *> in_vc_vector;
+ vector<InVcState *> in_vc_vector;
for(int i = 0; i < m_num_vcs; i++)
{
- in_vc_vector.insertAtBottom(new InVcState(i));
+ in_vc_vector.push_back(new InVcState(i));
in_vc_vector[i]->setState(IDLE_, g_eventQueue_ptr->getTime());
}
- m_in_vc_state.insertAtBottom(in_vc_vector);
- m_in_link.insertAtBottom(in_link);
+ m_in_vc_state.push_back(in_vc_vector);
+ m_in_link.push_back(in_link);
in_link->setLinkConsumer(this);
in_link->setInPort(port);
int start = 0;
- m_round_robin_invc.insertAtBottom(start);
+ m_round_robin_invc.push_back(start);
}
@@ -88,30 +90,30 @@ void Router::addOutPort(NetworkLink *out_link, const NetDest& routing_table_entr
int port = m_out_link.size();
out_link->setOutPort(port);
int start = 0;
- m_vc_round_robin.insertAtBottom(start);
+ m_vc_round_robin.push_back(start);
- m_out_src_queue.insertAtBottom(new flitBuffer());
+ m_out_src_queue.push_back(new flitBuffer());
- m_out_link.insertAtBottom(out_link);
- m_routing_table.insertAtBottom(routing_table_entry);
+ m_out_link.push_back(out_link);
+ m_routing_table.push_back(routing_table_entry);
out_link->setSourceQueue(m_out_src_queue[port]);
out_link->setSource(this);
- Vector<flitBuffer *> intermediateQueues;
+ vector<flitBuffer *> intermediateQueues;
for(int i = 0; i < m_num_vcs; i++)
{
- intermediateQueues.insertAtBottom(new flitBuffer(m_net_ptr->getBufferSize()));
+ intermediateQueues.push_back(new flitBuffer(m_net_ptr->getBufferSize()));
}
- m_router_buffers.insertAtBottom(intermediateQueues);
+ m_router_buffers.push_back(intermediateQueues);
- Vector<OutVcState *> out_vc_vector;
+ vector<OutVcState *> out_vc_vector;
for(int i = 0; i < m_num_vcs; i++)
{
- out_vc_vector.insertAtBottom(new OutVcState(i));
+ out_vc_vector.push_back(new OutVcState(i));
out_vc_vector[i]->setState(IDLE_, g_eventQueue_ptr->getTime());
}
- m_out_vc_state.insertAtBottom(out_vc_vector);
- m_link_weights.insertAtBottom(link_weight);
+ m_out_vc_state.push_back(out_vc_vector);
+ m_link_weights.push_back(link_weight);
}
bool Router::isBufferNotFull(int vc, int inport)
@@ -164,7 +166,7 @@ void Router::vc_arbitrate()
if(in_vc_state->isInState(VC_AB_, g_eventQueue_ptr->getTime()))
{
int outport = in_vc_state->get_outport();
- Vector<int > valid_vcs = get_valid_vcs(invc);
+ vector<int> valid_vcs = get_valid_vcs(invc);
for(int valid_vc_iter = 0; valid_vc_iter < valid_vcs.size(); valid_vc_iter++)
{
if(m_out_vc_state[outport][valid_vcs[valid_vc_iter]]->isInState(IDLE_, g_eventQueue_ptr->getTime()))
@@ -180,9 +182,9 @@ void Router::vc_arbitrate()
}
}
-Vector<int > Router::get_valid_vcs(int invc)
+vector<int> Router::get_valid_vcs(int invc)
{
- Vector<int > vc_list;
+ vector<int> vc_list;
for(int vnet = 0; vnet < m_virtual_networks; vnet++)
{
@@ -197,7 +199,7 @@ Vector<int > Router::get_valid_vcs(int invc)
for(int offset = 0; offset < vc_per_vnet; offset++)
{
- vc_list.insertAtBottom(base+offset);
+ vc_list.push_back(base+offset);
}
break;
}
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
index 5d2610fae..b6ebb601f 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
@@ -32,6 +32,7 @@
#define ROUTER_H
#include <iostream>
+#include <vector>
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
@@ -68,23 +69,23 @@ private:
int m_id;
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;
GarnetNetwork *m_net_ptr;
- Vector<int > m_vc_round_robin; // For scheduling of out source queues
+ std::vector<int> m_vc_round_robin; // For scheduling of out source queues
int m_round_robin_inport, m_round_robin_start; // for vc arbitration
- Vector<int > m_round_robin_invc; // For every outport. for vc arbitration
+ std::vector<int> m_round_robin_invc; // For every outport. for vc arbitration
- Vector<Vector<flitBuffer *> > m_router_buffers; // These are essentially output buffers
- Vector<flitBuffer *> m_out_src_queue; // These are source queues for the output link
- Vector<NetworkLink *> m_in_link;
- Vector<NetworkLink *> m_out_link;
- Vector<Vector<InVcState * > > m_in_vc_state;
- Vector<Vector<OutVcState * > > m_out_vc_state;
- Vector<NetDest> m_routing_table;
- Vector<int > m_link_weights;
+ std::vector<std::vector<flitBuffer *> > m_router_buffers; // These are essentially output buffers
+ std::vector<flitBuffer *> m_out_src_queue; // These are source queues for the output link
+ std::vector<NetworkLink *> m_in_link;
+ std::vector<NetworkLink *> m_out_link;
+ std::vector<std::vector<InVcState *> > m_in_vc_state;
+ std::vector<std::vector<OutVcState *> > m_out_vc_state;
+ std::vector<NetDest> m_routing_table;
+ std::vector<int> m_link_weights;
VCarbiter *m_vc_arbiter;
/*********** Private methods *************/
int getRoute(NetDest destination);
- Vector<int > get_valid_vcs(int invc);
+ std::vector<int> get_valid_vcs(int invc);
void routeCompute(flit *m_flit, int inport);
void checkReschedule();
void check_arbiter_reschedule();
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index 8e6114ba9..5a1ee32ec 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -26,6 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <algorithm>
+
#include "mem/protocol/Protocol.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/network/simple/PerfectSwitch.hh"
@@ -55,11 +57,11 @@ PerfectSwitch::PerfectSwitch(SwitchID sid, SimpleNetwork* network_ptr)
}
void
-PerfectSwitch::addInPort(const Vector<MessageBuffer*>& in)
+PerfectSwitch::addInPort(const vector<MessageBuffer*>& in)
{
assert(in.size() == m_virtual_networks);
NodeID port = m_in.size();
- m_in.insertAtBottom(in);
+ m_in.push_back(in);
for (int j = 0; j < m_virtual_networks; j++) {
m_in[port][j]->setConsumer(this);
string desc = csprintf("[Queue from port %s %s %s to PerfectSwitch]",
@@ -70,7 +72,7 @@ PerfectSwitch::addInPort(const Vector<MessageBuffer*>& in)
}
void
-PerfectSwitch::addOutPort(const Vector<MessageBuffer*>& out,
+PerfectSwitch::addOutPort(const vector<MessageBuffer*>& out,
const NetDest& routing_table_entry)
{
assert(out.size() == m_virtual_networks);
@@ -79,11 +81,11 @@ PerfectSwitch::addOutPort(const Vector<MessageBuffer*>& out,
LinkOrder l;
l.m_value = 0;
l.m_link = m_out.size();
- m_link_order.insertAtBottom(l);
+ m_link_order.push_back(l);
// Add to routing table
- m_out.insertAtBottom(out);
- m_routing_table.insertAtBottom(routing_table_entry);
+ m_out.push_back(out);
+ m_routing_table.push_back(routing_table_entry);
}
void
@@ -111,7 +113,7 @@ PerfectSwitch::clearBuffers()
void
PerfectSwitch::reconfigureOutPort(const NetDest& routing_table_entry)
{
- m_routing_table.insertAtBottom(routing_table_entry);
+ m_routing_table.push_back(routing_table_entry);
}
PerfectSwitch::~PerfectSwitch()
@@ -161,8 +163,8 @@ PerfectSwitch::wakeup()
}
// temporary vectors to store the routing results
- Vector<LinkID> output_links;
- Vector<NetDest> output_link_destinations;
+ vector<LinkID> output_links;
+ vector<NetDest> output_link_destinations;
// Is there a message waiting?
while (m_in[incoming][vnet]->isReady()) {
@@ -206,7 +208,7 @@ PerfectSwitch::wakeup()
}
// Look at the most empty link first
- m_link_order.sortVector();
+ sort(m_link_order.begin(), m_link_order.end());
}
}
@@ -220,14 +222,14 @@ PerfectSwitch::wakeup()
continue;
// Remember what link we're using
- output_links.insertAtBottom(link);
+ output_links.push_back(link);
// Need to remember which destinations need this
// message in another vector. This Set is the
// intersection of the routing_table entry and the
// current destination set. The intersection must
// not be empty, since we are inside "if"
- output_link_destinations.insertAtBottom(msg_dsts.AND(dst));
+ output_link_destinations.push_back(msg_dsts.AND(dst));
// Next, we update the msg_destination not to
// include those nodes that were already handled
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.hh b/src/mem/ruby/network/simple/PerfectSwitch.hh
index 68bf0df9c..a7e577df0 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.hh
+++ b/src/mem/ruby/network/simple/PerfectSwitch.hh
@@ -37,8 +37,8 @@
#define __MEM_RUBY_NETWORK_SIMPLE_PERFECTSWITCH_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
@@ -59,8 +59,8 @@ class PerfectSwitch : public Consumer
PerfectSwitch(SwitchID sid, SimpleNetwork* network_ptr);
~PerfectSwitch();
- void addInPort(const Vector<MessageBuffer*>& in);
- void addOutPort(const Vector<MessageBuffer*>& out,
+ void addInPort(const std::vector<MessageBuffer*>& in);
+ void addOutPort(const std::vector<MessageBuffer*>& out,
const NetDest& routing_table_entry);
void clearRoutingTables();
void clearBuffers();
@@ -84,10 +84,10 @@ class PerfectSwitch : public Consumer
SwitchID m_switch_id;
// vector of queues from the components
- Vector<Vector<MessageBuffer*> > m_in;
- Vector<Vector<MessageBuffer*> > m_out;
- Vector<NetDest> m_routing_table;
- Vector<LinkOrder> m_link_order;
+ std::vector<std::vector<MessageBuffer*> > m_in;
+ std::vector<std::vector<MessageBuffer*> > m_out;
+ std::vector<NetDest> m_routing_table;
+ std::vector<LinkOrder> m_link_order;
int m_virtual_networks;
int m_round_robin_start;
int m_wakeups_wo_switch;
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc
index 47404ad01..cb32ed9e1 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.cc
+++ b/src/mem/ruby/network/simple/SimpleNetwork.cc
@@ -26,6 +26,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "base/stl_helpers.hh"
#include "mem/gems_common/Map.hh"
#include "mem/protocol/MachineType.hh"
#include "mem/protocol/Protocol.hh"
@@ -39,6 +40,7 @@
#include "mem/ruby/system/System.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
#if 0
// ***BIG HACK*** - This is actually code that _should_ be in Network.cc
@@ -59,21 +61,21 @@ SimpleNetwork::SimpleNetwork(const Params *p)
// SimpleNetwork child constructor. Therefore, the member variables
// used below should already be initialized.
- m_endpoint_switches.setSize(m_nodes);
+ m_endpoint_switches.resize(m_nodes);
- m_in_use.setSize(m_virtual_networks);
- m_ordered.setSize(m_virtual_networks);
+ m_in_use.resize(m_virtual_networks);
+ m_ordered.resize(m_virtual_networks);
for (int i = 0; i < m_virtual_networks; i++) {
m_in_use[i] = false;
m_ordered[i] = false;
}
// Allocate to and from queues
- m_toNetQueues.setSize(m_nodes);
- m_fromNetQueues.setSize(m_nodes);
+ m_toNetQueues.resize(m_nodes);
+ m_fromNetQueues.resize(m_nodes);
for (int node = 0; node < m_nodes; node++) {
- m_toNetQueues[node].setSize(m_virtual_networks);
- m_fromNetQueues[node].setSize(m_virtual_networks);
+ m_toNetQueues[node].resize(m_virtual_networks);
+ m_fromNetQueues[node].resize(m_virtual_networks);
for (int j = 0; j < m_virtual_networks; j++) {
m_toNetQueues[node][j] =
new MessageBuffer(csprintf("toNet node %d j %d", node, j));
@@ -93,7 +95,7 @@ SimpleNetwork::init()
assert(m_topology_ptr != NULL);
int number_of_switches = m_topology_ptr->numSwitches();
for (int i = 0; i < number_of_switches; i++) {
- m_switch_ptr_vector.insertAtBottom(new Switch(i, this));
+ m_switch_ptr_vector.push_back(new Switch(i, this));
}
// false because this isn't a reconfiguration
@@ -118,11 +120,11 @@ SimpleNetwork::reset()
SimpleNetwork::~SimpleNetwork()
{
for (int i = 0; i < m_nodes; i++) {
- m_toNetQueues[i].deletePointers();
- m_fromNetQueues[i].deletePointers();
+ deletePointers(m_toNetQueues[i]);
+ deletePointers(m_fromNetQueues[i]);
}
- m_switch_ptr_vector.deletePointers();
- m_buffers_to_free.deletePointers();
+ deletePointers(m_switch_ptr_vector);
+ deletePointers(m_buffers_to_free);
// delete m_topology_ptr;
}
@@ -173,17 +175,17 @@ SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest,
}
// Create a set of new MessageBuffers
- Vector<MessageBuffer*> queues;
+ std::vector<MessageBuffer*> queues;
for (int i = 0; i < m_virtual_networks; i++) {
// allocate a buffer
MessageBuffer* buffer_ptr = new MessageBuffer;
buffer_ptr->setOrdering(true);
if (m_buffer_size > 0) {
- buffer_ptr->setSize(m_buffer_size);
+ buffer_ptr->resize(m_buffer_size);
}
- queues.insertAtBottom(buffer_ptr);
+ queues.push_back(buffer_ptr);
// remember to deallocate it
- m_buffers_to_free.insertAtBottom(buffer_ptr);
+ m_buffers_to_free.push_back(buffer_ptr);
}
// Connect it to the two switches
m_switch_ptr_vector[dest]->addInPort(queues);
@@ -217,7 +219,7 @@ SimpleNetwork::getFromNetQueue(NodeID id, bool ordered, int network_num)
return m_fromNetQueues[id][network_num];
}
-const Vector<Throttle*>*
+const std::vector<Throttle*>*
SimpleNetwork::getThrottles(NodeID id) const
{
assert(id >= 0);
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh
index f9cb22a6a..6767f725b 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.hh
+++ b/src/mem/ruby/network/simple/SimpleNetwork.hh
@@ -64,8 +64,8 @@
#define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/network/Network.hh"
#include "mem/ruby/system/NodeID.hh"
@@ -96,7 +96,7 @@ class SimpleNetwork : public Network
// returns the queue requested for the given component
MessageBuffer* getToNetQueue(NodeID id, bool ordered, int network_num);
MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
- virtual const Vector<Throttle*>* getThrottles(NodeID id) const;
+ virtual const std::vector<Throttle*>* getThrottles(NodeID id) const;
bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
@@ -130,14 +130,14 @@ class SimpleNetwork : public Network
SimpleNetwork& operator=(const SimpleNetwork& obj);
// vector of queues from the components
- Vector<Vector<MessageBuffer*> > m_toNetQueues;
- Vector<Vector<MessageBuffer*> > m_fromNetQueues;
-
- Vector<bool> m_in_use;
- Vector<bool> m_ordered;
- Vector<Switch*> m_switch_ptr_vector;
- Vector<MessageBuffer*> m_buffers_to_free;
- Vector<Switch*> m_endpoint_switches;
+ std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
+ std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
+
+ std::vector<bool> m_in_use;
+ std::vector<bool> m_ordered;
+ std::vector<Switch*> m_switch_ptr_vector;
+ std::vector<MessageBuffer*> m_buffers_to_free;
+ std::vector<Switch*> m_endpoint_switches;
};
inline std::ostream&
diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc
index e88a24505..3439bf44b 100644
--- a/src/mem/ruby/network/simple/Switch.cc
+++ b/src/mem/ruby/network/simple/Switch.cc
@@ -26,6 +26,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <numeric>
+
+#include "base/stl_helpers.hh"
#include "mem/protocol/MessageSizeType.hh"
#include "mem/protocol/Protocol.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
@@ -35,12 +38,13 @@
#include "mem/ruby/network/simple/Throttle.hh"
using namespace std;
+using m5::stl_helpers::deletePointers;
+using m5::stl_helpers::operator<<;
Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr)
{
m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr);
m_switch_id = sid;
- m_throttles.setSize(0);
}
Switch::~Switch()
@@ -48,20 +52,20 @@ Switch::~Switch()
delete m_perfect_switch_ptr;
// Delete throttles (one per output port)
- m_throttles.deletePointers();
+ deletePointers(m_throttles);
// Delete MessageBuffers
- m_buffers_to_free.deletePointers();
+ deletePointers(m_buffers_to_free);
}
void
-Switch::addInPort(const Vector<MessageBuffer*>& in)
+Switch::addInPort(const vector<MessageBuffer*>& in)
{
m_perfect_switch_ptr->addInPort(in);
}
void
-Switch::addOutPort(const Vector<MessageBuffer*>& out,
+Switch::addOutPort(const vector<MessageBuffer*>& out,
const NetDest& routing_table_entry, int link_latency, int bw_multiplier)
{
Throttle* throttle_ptr = NULL;
@@ -69,20 +73,20 @@ Switch::addOutPort(const Vector<MessageBuffer*>& out,
// Create a throttle
throttle_ptr = new Throttle(m_switch_id, m_throttles.size(), link_latency,
bw_multiplier);
- m_throttles.insertAtBottom(throttle_ptr);
+ m_throttles.push_back(throttle_ptr);
// Create one buffer per vnet (these are intermediaryQueues)
- Vector<MessageBuffer*> intermediateBuffers;
+ vector<MessageBuffer*> intermediateBuffers;
for (int i = 0; i < out.size(); i++) {
MessageBuffer* buffer_ptr = new MessageBuffer;
// Make these queues ordered
buffer_ptr->setOrdering(true);
Network* net_ptr = RubySystem::getNetwork();
if (net_ptr->getBufferSize() > 0) {
- buffer_ptr->setSize(net_ptr->getBufferSize());
+ buffer_ptr->resize(net_ptr->getBufferSize());
}
- intermediateBuffers.insertAtBottom(buffer_ptr);
- m_buffers_to_free.insertAtBottom(buffer_ptr);
+ intermediateBuffers.push_back(buffer_ptr);
+ m_buffers_to_free.push_back(buffer_ptr);
}
// Hook the queues to the PerfectSwitch
@@ -122,7 +126,7 @@ Switch::getThrottle(LinkID link_number) const
return m_throttles[link_number];
}
-const Vector<Throttle*>*
+const vector<Throttle*>*
Switch::getThrottles() const
{
return &m_throttles;
@@ -172,18 +176,21 @@ Switch::printStats(std::ostream& out) const
if (!throttle_ptr)
continue;
- const Vector<Vector<int> >& message_counts =
+ const vector<vector<int> >& message_counts =
throttle_ptr->getCounters();
for (int int_type = 0; int_type < MessageSizeType_NUM; int_type++) {
MessageSizeType type = MessageSizeType(int_type);
- int sum = message_counts[type].sum();
+ const vector<int> &mct = message_counts[type];
+ int sum = accumulate(mct.begin(), mct.end(), 0);
if (sum == 0)
continue;
out << " outgoing_messages_switch_" << m_switch_id
<< "_link_" << link << "_" << type << ": " << sum << " "
<< sum * RubySystem::getNetwork()->MessageSizeType_to_int(type)
- << " " << message_counts[type] << " base_latency: "
+ << " ";
+ out << mct;
+ out << " base_latency: "
<< throttle_ptr->getLatency() << endl;
}
}
diff --git a/src/mem/ruby/network/simple/Switch.hh b/src/mem/ruby/network/simple/Switch.hh
index 598450df3..6e80c8642 100644
--- a/src/mem/ruby/network/simple/Switch.hh
+++ b/src/mem/ruby/network/simple/Switch.hh
@@ -40,8 +40,8 @@
#define __MEM_RUBY_NETWORK_SIMPLE_SWITCH_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
class MessageBuffer;
@@ -57,12 +57,12 @@ class Switch
Switch(SwitchID sid, SimpleNetwork* network_ptr);
~Switch();
- void addInPort(const Vector<MessageBuffer*>& in);
- void addOutPort(const Vector<MessageBuffer*>& out,
+ void addInPort(const std::vector<MessageBuffer*>& in);
+ void addOutPort(const std::vector<MessageBuffer*>& out,
const NetDest& routing_table_entry, int link_latency,
int bw_multiplier);
const Throttle* getThrottle(LinkID link_number) const;
- const Vector<Throttle*>* getThrottles() const;
+ const std::vector<Throttle*>* getThrottles() const;
void clearRoutingTables();
void clearBuffers();
void reconfigureOutPort(const NetDest& routing_table_entry);
@@ -80,8 +80,8 @@ class Switch
PerfectSwitch* m_perfect_switch_ptr;
Network* m_network_ptr;
- Vector<Throttle*> m_throttles;
- Vector<MessageBuffer*> m_buffers_to_free;
+ std::vector<Throttle*> m_throttles;
+ std::vector<MessageBuffer*> m_buffers_to_free;
SwitchID m_switch_id;
};
diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc
index 5d74afb24..a77d40dee 100644
--- a/src/mem/ruby/network/simple/Throttle.cc
+++ b/src/mem/ruby/network/simple/Throttle.cc
@@ -85,17 +85,17 @@ Throttle::clear()
}
void
-Throttle::addLinks(const Vector<MessageBuffer*>& in_vec,
- const Vector<MessageBuffer*>& out_vec)
+Throttle::addLinks(const std::vector<MessageBuffer*>& in_vec,
+ const std::vector<MessageBuffer*>& out_vec)
{
assert(in_vec.size() == out_vec.size());
for (int i=0; i<in_vec.size(); i++) {
addVirtualNetwork(in_vec[i], out_vec[i]);
}
- m_message_counters.setSize(MessageSizeType_NUM);
+ m_message_counters.resize(MessageSizeType_NUM);
for (int i = 0; i < MessageSizeType_NUM; i++) {
- m_message_counters[i].setSize(in_vec.size());
+ m_message_counters[i].resize(in_vec.size());
for (int j = 0; j<m_message_counters[i].size(); j++) {
m_message_counters[i][j] = 0;
}
@@ -105,9 +105,9 @@ Throttle::addLinks(const Vector<MessageBuffer*>& in_vec,
void
Throttle::addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr)
{
- m_units_remaining.insertAtBottom(0);
- m_in.insertAtBottom(in_ptr);
- m_out.insertAtBottom(out_ptr);
+ m_units_remaining.push_back(0);
+ m_in.push_back(in_ptr);
+ m_out.push_back(out_ptr);
// Set consumer and description
m_in[m_vnets]->setConsumer(this);
diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh
index 74cd7b356..c80f24d77 100644
--- a/src/mem/ruby/network/simple/Throttle.hh
+++ b/src/mem/ruby/network/simple/Throttle.hh
@@ -39,8 +39,8 @@
#define __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
#include <iostream>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/network/Network.hh"
@@ -57,8 +57,8 @@ class Throttle : public Consumer
Throttle(NodeID node, int link_latency, int link_bandwidth_multiplier);
~Throttle() {}
- void addLinks(const Vector<MessageBuffer*>& in_vec,
- const Vector<MessageBuffer*>& out_vec);
+ void addLinks(const std::vector<MessageBuffer*>& in_vec,
+ const std::vector<MessageBuffer*>& out_vec);
void wakeup();
void printStats(std::ostream& out) const;
@@ -74,7 +74,7 @@ class Throttle : public Consumer
}
int getLatency() const { return m_link_latency; }
- const Vector<Vector<int> >&
+ const std::vector<std::vector<int> >&
getCounters() const
{
return m_message_counters;
@@ -93,11 +93,11 @@ class Throttle : public Consumer
Throttle(const Throttle& obj);
Throttle& operator=(const Throttle& obj);
- Vector<MessageBuffer*> m_in;
- Vector<MessageBuffer*> m_out;
- Vector<Vector<int> > m_message_counters;
+ std::vector<MessageBuffer*> m_in;
+ std::vector<MessageBuffer*> m_out;
+ std::vector<std::vector<int> > m_message_counters;
int m_vnets;
- Vector<int> m_units_remaining;
+ std::vector<int> m_units_remaining;
int m_sID;
NodeID m_node;
int m_link_bandwidth_multiplier;
diff --git a/src/mem/ruby/network/simple/Topology.cc b/src/mem/ruby/network/simple/Topology.cc
index 18618580a..bd167bd40 100644
--- a/src/mem/ruby/network/simple/Topology.cc
+++ b/src/mem/ruby/network/simple/Topology.cc
@@ -63,8 +63,8 @@ Topology::Topology(const Params *p)
m_print_config = p->print_config;
m_number_of_switches = p->num_int_nodes;
// initialize component latencies record
- m_component_latencies.setSize(0);
- m_component_inter_switches.setSize(0);
+ m_component_latencies.resize(0);
+ m_component_inter_switches.resize(0);
// Total nodes/controllers in network
// Must make sure this is called after the State Machine constructors
@@ -85,7 +85,7 @@ Topology::Topology(const Params *p)
AbstractController *c = p->ext_node;
// Store the controller pointers for later
- m_controller_vector.insertAtBottom(c);
+ m_controller_vector.push_back(c);
int ext_idx1 =
MachineType_base_number(c->getMachineType()) + c->getVersion();
@@ -133,24 +133,24 @@ Topology::createLinks(Network *net, bool isReconfiguration)
Matrix topology_latency;
Matrix topology_bw_multis;
int num_switches = max_switch_id+1;
- topology_weights.setSize(num_switches);
- topology_latency.setSize(num_switches);
- topology_bw_multis.setSize(num_switches);
+ topology_weights.resize(num_switches);
+ topology_latency.resize(num_switches);
+ topology_bw_multis.resize(num_switches);
// FIXME setting the size of a member variable here is a HACK!
- m_component_latencies.setSize(num_switches);
+ m_component_latencies.resize(num_switches);
// FIXME setting the size of a member variable here is a HACK!
- m_component_inter_switches.setSize(num_switches);
+ m_component_inter_switches.resize(num_switches);
for (int i = 0; i < topology_weights.size(); i++) {
- topology_weights[i].setSize(num_switches);
- topology_latency[i].setSize(num_switches);
- topology_bw_multis[i].setSize(num_switches);
- m_component_latencies[i].setSize(num_switches);
+ topology_weights[i].resize(num_switches);
+ topology_latency[i].resize(num_switches);
+ topology_bw_multis[i].resize(num_switches);
+ m_component_latencies[i].resize(num_switches);
// FIXME setting the size of a member variable here is a HACK!
- m_component_inter_switches[i].setSize(num_switches);
+ m_component_inter_switches[i].resize(num_switches);
for (int j = 0; j < topology_weights[i].size(); j++) {
topology_weights[i][j] = INFINITE_LATENCY;
@@ -226,11 +226,11 @@ Topology::addLink(SwitchID src, SwitchID dest, int link_latency,
{
ASSERT(src <= m_number_of_switches+m_nodes+m_nodes);
ASSERT(dest <= m_number_of_switches+m_nodes+m_nodes);
- m_links_src_vector.insertAtBottom(src);
- m_links_dest_vector.insertAtBottom(dest);
- m_links_latency_vector.insertAtBottom(link_latency);
- m_links_weight_vector.insertAtBottom(link_weight);
- m_bw_multiplier_vector.insertAtBottom(bw_multiplier);
+ m_links_src_vector.push_back(src);
+ m_links_dest_vector.push_back(dest);
+ m_links_latency_vector.push_back(link_latency);
+ m_links_weight_vector.push_back(link_weight);
+ m_bw_multiplier_vector.push_back(bw_multiplier);
}
void
diff --git a/src/mem/ruby/network/simple/Topology.hh b/src/mem/ruby/network/simple/Topology.hh
index 9bcc66c81..c92848d8f 100644
--- a/src/mem/ruby/network/simple/Topology.hh
+++ b/src/mem/ruby/network/simple/Topology.hh
@@ -42,8 +42,8 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
#include "params/ExtLink.hh"
@@ -55,7 +55,7 @@
class Network;
class NetDest;
-typedef Vector<Vector<int> > Matrix;
+typedef std::vector<std::vector<int> > Matrix;
class Link : public SimObject
{
@@ -111,8 +111,9 @@ class Topology : public SimObject
const NetDest& routing_table_entry, int link_latency, int weight,
int bw_multiplier, bool isReconfiguration);
- //void makeSwitchesPerChip(Vector<Vector< SwitchID> > &nodePairs,
- // Vector<int> &latencies, Vector<int> &bw_multis, int numberOfChips);
+ //void makeSwitchesPerChip(std::vector<std::vector<SwitchID > > &nodePairs,
+ // std::vector<int> &latencies, std::vector<int> &bw_multis,
+ // int numberOfChips);
std::string getDesignStr();
// Private copy constructor and assignment operator
@@ -124,13 +125,13 @@ class Topology : public SimObject
NodeID m_nodes;
int m_number_of_switches;
- Vector<AbstractController*> m_controller_vector;
+ std::vector<AbstractController*> m_controller_vector;
- Vector<SwitchID> m_links_src_vector;
- Vector<SwitchID> m_links_dest_vector;
- Vector<int> m_links_latency_vector;
- Vector<int> m_links_weight_vector;
- Vector<int> m_bw_multiplier_vector;
+ std::vector<SwitchID> m_links_src_vector;
+ std::vector<SwitchID> m_links_dest_vector;
+ std::vector<int> m_links_latency_vector;
+ std::vector<int> m_links_weight_vector;
+ std::vector<int> m_bw_multiplier_vector;
Matrix m_component_latencies;
Matrix m_component_inter_switches;
diff --git a/src/mem/ruby/profiler/AddressProfiler.cc b/src/mem/ruby/profiler/AddressProfiler.cc
index d11e74b01..2c099a914 100644
--- a/src/mem/ruby/profiler/AddressProfiler.cc
+++ b/src/mem/ruby/profiler/AddressProfiler.cc
@@ -26,6 +26,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <vector>
+
+#include "base/stl_helpers.hh"
#include "mem/gems_common/Map.hh"
#include "mem/gems_common/PrioHeap.hh"
#include "mem/protocol/CacheMsg.hh"
@@ -37,6 +40,8 @@
using namespace std;
typedef AddressProfiler::AddressMap AddressMap;
+using m5::stl_helpers::operator<<;
+
// Helper functions
AccessTraceForAddress&
lookupTraceForAddress(const Address& addr, AddressMap* record_map)
@@ -55,7 +60,7 @@ printSorted(ostream& out, int num_of_sequencers, const AddressMap* record_map,
uint64 misses = 0;
PrioHeap<AccessTraceForAddress*> heap;
- Vector<Address> keys = record_map->keys();
+ std::vector<Address> keys = record_map->keys();
for (int i = 0; i < keys.size(); i++) {
AccessTraceForAddress* record = &(record_map->lookup(keys[i]));
misses += record->getTotal();
@@ -77,10 +82,10 @@ printSorted(ostream& out, int num_of_sequencers, const AddressMap* record_map,
Histogram all_records_log(-1);
// Allows us to track how many lines where touched by n processors
- Vector<int64> m_touched_vec;
- Vector<int64> m_touched_weighted_vec;
- m_touched_vec.setSize(num_of_sequencers+1);
- m_touched_weighted_vec.setSize(num_of_sequencers+1);
+ std::vector<int64> m_touched_vec;
+ std::vector<int64> m_touched_weighted_vec;
+ m_touched_vec.resize(num_of_sequencers+1);
+ m_touched_weighted_vec.resize(num_of_sequencers+1);
for (int i = 0; i < m_touched_vec.size(); i++) {
m_touched_vec[i] = 0;
m_touched_weighted_vec[i] = 0;
diff --git a/src/mem/ruby/profiler/CacheProfiler.cc b/src/mem/ruby/profiler/CacheProfiler.cc
index f359314c1..7dc925322 100644
--- a/src/mem/ruby/profiler/CacheProfiler.cc
+++ b/src/mem/ruby/profiler/CacheProfiler.cc
@@ -27,7 +27,6 @@
*/
#include "mem/gems_common/PrioHeap.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/profiler/AccessTraceForAddress.hh"
#include "mem/ruby/profiler/CacheProfiler.hh"
#include "mem/ruby/profiler/Profiler.hh"
@@ -36,17 +35,15 @@
using namespace std;
CacheProfiler::CacheProfiler(const string& description)
+ : m_requestTypeVec(int(CacheRequestType_NUM))
{
m_description = description;
- m_requestTypeVec_ptr = new Vector<int>;
- m_requestTypeVec_ptr->setSize(int(CacheRequestType_NUM));
clearStats();
}
CacheProfiler::~CacheProfiler()
{
- delete m_requestTypeVec_ptr;
}
void
@@ -65,18 +62,18 @@ CacheProfiler::printStats(ostream& out) const
int requests = 0;
for (int i = 0; i < int(CacheRequestType_NUM); i++) {
- requests += m_requestTypeVec_ptr->ref(i);
+ requests += m_requestTypeVec[i];
}
assert(m_misses == requests);
if (requests > 0) {
for (int i = 0; i < int(CacheRequestType_NUM); i++) {
- if (m_requestTypeVec_ptr->ref(i) > 0) {
+ if (m_requestTypeVec[i] > 0) {
out << description << "_request_type_"
<< CacheRequestType_to_string(CacheRequestType(i))
<< ": "
- << 100.0 * (double)m_requestTypeVec_ptr->ref(i) /
+ << 100.0 * (double)m_requestTypeVec[i] /
(double)requests
<< "%" << endl;
}
@@ -103,7 +100,7 @@ void
CacheProfiler::clearStats()
{
for (int i = 0; i < int(CacheRequestType_NUM); i++) {
- m_requestTypeVec_ptr->ref(i) = 0;
+ m_requestTypeVec[i] = 0;
}
m_requestSize.clear();
m_misses = 0;
@@ -123,7 +120,7 @@ CacheProfiler::addStatSample(CacheRequestType requestType,
{
m_misses++;
- m_requestTypeVec_ptr->ref(requestType)++;
+ m_requestTypeVec[requestType]++;
m_accessModeTypeHistogram[type]++;
m_requestSize.add(msgSize);
diff --git a/src/mem/ruby/profiler/CacheProfiler.hh b/src/mem/ruby/profiler/CacheProfiler.hh
index 7dcdf57f0..fad60711b 100644
--- a/src/mem/ruby/profiler/CacheProfiler.hh
+++ b/src/mem/ruby/profiler/CacheProfiler.hh
@@ -31,6 +31,7 @@
#include <iostream>
#include <string>
+#include <vector>
#include "mem/protocol/AccessModeType.hh"
#include "mem/protocol/CacheRequestType.hh"
@@ -39,8 +40,6 @@
#include "mem/ruby/common/Histogram.hh"
#include "mem/ruby/system/NodeID.hh"
-template <class TYPE> class Vector;
-
class CacheProfiler
{
public:
@@ -69,7 +68,7 @@ class CacheProfiler
int64 m_hw_prefetches;
int64 m_accessModeTypeHistogram[AccessModeType_NUM];
- Vector <int>* m_requestTypeVec_ptr;
+ std::vector<int> m_requestTypeVec;
};
inline std::ostream&
diff --git a/src/mem/ruby/profiler/MemCntrlProfiler.cc b/src/mem/ruby/profiler/MemCntrlProfiler.cc
index e25719666..632842a2e 100644
--- a/src/mem/ruby/profiler/MemCntrlProfiler.cc
+++ b/src/mem/ruby/profiler/MemCntrlProfiler.cc
@@ -39,7 +39,7 @@ MemCntrlProfiler::MemCntrlProfiler(const string& description,
m_dimms_per_channel = dimms_per_channel;
int totalBanks = banks_per_rank * ranks_per_dimm * dimms_per_channel;
- m_memBankCount.setSize(totalBanks);
+ m_memBankCount.resize(totalBanks);
clearStats();
}
diff --git a/src/mem/ruby/profiler/MemCntrlProfiler.hh b/src/mem/ruby/profiler/MemCntrlProfiler.hh
index 85c39e0ad..e6d64a2b5 100644
--- a/src/mem/ruby/profiler/MemCntrlProfiler.hh
+++ b/src/mem/ruby/profiler/MemCntrlProfiler.hh
@@ -31,12 +31,10 @@
#include <iostream>
#include <string>
+#include <vector>
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
-template <class TYPE> class Vector;
-
class MemCntrlProfiler
{
public:
@@ -86,7 +84,7 @@ private:
uint64 m_memArbWait;
uint64 m_memRandBusy;
uint64 m_memNotOld;
- Vector<uint64> m_memBankCount;
+ std::vector<uint64> m_memBankCount;
int m_banks_per_rank;
int m_ranks_per_dimm;
int m_dimms_per_channel;
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index aa23388ee..bbc3c5846 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -46,6 +46,9 @@
#include <sys/resource.h>
#include <sys/times.h>
+#include <algorithm>
+
+#include "base/stl_helpers.hh"
#include "base/str.hh"
#include "mem/gems_common/Map.hh"
#include "mem/gems_common/PrioHeap.hh"
@@ -60,6 +63,7 @@
#include "mem/ruby/system/System.hh"
using namespace std;
+using m5::stl_helpers::operator<<;
extern ostream* debug_cout_ptr;
@@ -111,8 +115,7 @@ Profiler::wakeup()
{
// FIXME - avoid the repeated code
- Vector<integer_t> perProcCycleCount;
- perProcCycleCount.setSize(m_num_of_sequencers);
+ vector<integer_t> perProcCycleCount(m_num_of_sequencers);
for (int i = 0; i < m_num_of_sequencers; i++) {
perProcCycleCount[i] =
@@ -235,8 +238,7 @@ Profiler::printStats(ostream& out, bool short_stats)
out << endl;
}
- Vector<integer_t> perProcCycleCount;
- perProcCycleCount.setSize(m_num_of_sequencers);
+ vector<integer_t> perProcCycleCount(m_num_of_sequencers);
for (int i = 0; i < m_num_of_sequencers; i++) {
perProcCycleCount[i] =
@@ -353,8 +355,8 @@ Profiler::printStats(ostream& out, bool short_stats)
out << "--------------------------------" << endl;
out << endl;
- Vector<string> requestProfileKeys = m_requestProfileMap_ptr->keys();
- requestProfileKeys.sortVector();
+ vector<string> requestProfileKeys = m_requestProfileMap_ptr->keys();
+ sort(requestProfileKeys.begin(), requestProfileKeys.end());
for (int i = 0; i < requestProfileKeys.size(); i++) {
int temp_int =
@@ -423,7 +425,7 @@ Profiler::clearStats()
{
m_ruby_start = g_eventQueue_ptr->getTime();
- m_cycles_executed_at_start.setSize(m_num_of_sequencers);
+ m_cycles_executed_at_start.resize(m_num_of_sequencers);
for (int i = 0; i < m_num_of_sequencers; i++) {
if (g_system_ptr == NULL) {
m_cycles_executed_at_start[i] = 0;
@@ -432,10 +434,10 @@ Profiler::clearStats()
}
}
- m_busyControllerCount.setSize(MachineType_NUM); // all machines
+ m_busyControllerCount.resize(MachineType_NUM); // all machines
for (int i = 0; i < MachineType_NUM; i++) {
int size = MachineType_base_count((MachineType)i);
- m_busyControllerCount[i].setSize(size);
+ m_busyControllerCount[i].resize(size);
for (int j = 0; j < size; j++) {
m_busyControllerCount[i][j] = 0;
}
@@ -445,26 +447,26 @@ Profiler::clearStats()
m_delayedCyclesHistogram.clear();
m_delayedCyclesNonPFHistogram.clear();
int size = RubySystem::getNetwork()->getNumberOfVirtualNetworks();
- m_delayedCyclesVCHistograms.setSize(size);
+ m_delayedCyclesVCHistograms.resize(size);
for (int i = 0; i < size; i++) {
m_delayedCyclesVCHistograms[i].clear();
}
- m_missLatencyHistograms.setSize(RubyRequestType_NUM);
+ m_missLatencyHistograms.resize(RubyRequestType_NUM);
for (int i = 0; i < m_missLatencyHistograms.size(); i++) {
m_missLatencyHistograms[i].clear(200);
}
- m_machLatencyHistograms.setSize(GenericMachineType_NUM+1);
+ m_machLatencyHistograms.resize(GenericMachineType_NUM+1);
for (int i = 0; i < m_machLatencyHistograms.size(); i++) {
m_machLatencyHistograms[i].clear(200);
}
m_allMissLatencyHistogram.clear(200);
- m_SWPrefetchLatencyHistograms.setSize(CacheRequestType_NUM);
+ m_SWPrefetchLatencyHistograms.resize(CacheRequestType_NUM);
for (int i = 0; i < m_SWPrefetchLatencyHistograms.size(); i++) {
m_SWPrefetchLatencyHistograms[i].clear(200);
}
- m_SWPrefetchMachLatencyHistograms.setSize(GenericMachineType_NUM+1);
+ m_SWPrefetchMachLatencyHistograms.resize(GenericMachineType_NUM+1);
for (int i = 0; i < m_SWPrefetchMachLatencyHistograms.size(); i++) {
m_SWPrefetchMachLatencyHistograms[i].clear(200);
}
diff --git a/src/mem/ruby/profiler/Profiler.hh b/src/mem/ruby/profiler/Profiler.hh
index bb2187488..5d8650dec 100644
--- a/src/mem/ruby/profiler/Profiler.hh
+++ b/src/mem/ruby/profiler/Profiler.hh
@@ -47,6 +47,7 @@
#include <iostream>
#include <string>
+#include <vector>
#include "mem/protocol/AccessModeType.hh"
#include "mem/protocol/AccessType.hh"
@@ -166,8 +167,8 @@ class Profiler : public SimObject, public Consumer
AddressProfiler* m_address_profiler_ptr;
AddressProfiler* m_inst_profiler_ptr;
- Vector<int64> m_instructions_executed_at_start;
- Vector<int64> m_cycles_executed_at_start;
+ std::vector<int64> m_instructions_executed_at_start;
+ std::vector<int64> m_cycles_executed_at_start;
std::ostream* m_periodic_output_file_ptr;
integer_t m_stats_period;
@@ -175,7 +176,7 @@ class Profiler : public SimObject, public Consumer
Time m_ruby_start;
time_t m_real_time_start_time;
- Vector <Vector<integer_t> > m_busyControllerCount;
+ std::vector<std::vector<integer_t> > m_busyControllerCount;
integer_t m_busyBankCount;
Histogram m_multicast_retry_histogram;
@@ -191,18 +192,18 @@ class Profiler : public SimObject, public Consumer
Histogram m_prefetchWaitHistogram;
- Vector<Histogram> m_missLatencyHistograms;
- Vector<Histogram> m_machLatencyHistograms;
+ std::vector<Histogram> m_missLatencyHistograms;
+ std::vector<Histogram> m_machLatencyHistograms;
Histogram m_allMissLatencyHistogram;
Histogram m_allSWPrefetchLatencyHistogram;
Histogram m_SWPrefetchL2MissLatencyHistogram;
- Vector<Histogram> m_SWPrefetchLatencyHistograms;
- Vector<Histogram> m_SWPrefetchMachLatencyHistograms;
+ std::vector<Histogram> m_SWPrefetchLatencyHistograms;
+ std::vector<Histogram> m_SWPrefetchMachLatencyHistograms;
Histogram m_delayedCyclesHistogram;
Histogram m_delayedCyclesNonPFHistogram;
- Vector<Histogram> m_delayedCyclesVCHistograms;
+ std::vector<Histogram> m_delayedCyclesVCHistograms;
Histogram m_outstanding_requests;
Histogram m_outstanding_persistent_requests;
diff --git a/src/mem/ruby/system/CacheMemory.cc b/src/mem/ruby/system/CacheMemory.cc
index 62aa1e25d..c9de85961 100644
--- a/src/mem/ruby/system/CacheMemory.cc
+++ b/src/mem/ruby/system/CacheMemory.cc
@@ -73,11 +73,11 @@ CacheMemory::init()
else
assert(false);
- m_cache.setSize(m_cache_num_sets);
- m_locked.setSize(m_cache_num_sets);
+ m_cache.resize(m_cache_num_sets);
+ m_locked.resize(m_cache_num_sets);
for (int i = 0; i < m_cache_num_sets; i++) {
- m_cache[i].setSize(m_cache_assoc);
- m_locked[i].setSize(m_cache_assoc);
+ m_cache[i].resize(m_cache_assoc);
+ m_locked[i].resize(m_cache_assoc);
for (int j = 0; j < m_cache_assoc; j++) {
m_cache[i][j] = NULL;
m_locked[i][j] = -1;
@@ -266,7 +266,7 @@ CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry)
// Find the first open slot
Index cacheSet = addressToCacheSet(address);
- Vector<AbstractCacheEntry*> &set = m_cache[cacheSet];
+ std::vector<AbstractCacheEntry*> &set = m_cache[cacheSet];
for (int i = 0; i < m_cache_assoc; i++) {
if (!set[i] || set[i]->m_Permission == AccessPermission_NotPresent) {
set[i] = entry; // Init entry
diff --git a/src/mem/ruby/system/CacheMemory.hh b/src/mem/ruby/system/CacheMemory.hh
index 21756a606..f004b8310 100644
--- a/src/mem/ruby/system/CacheMemory.hh
+++ b/src/mem/ruby/system/CacheMemory.hh
@@ -34,7 +34,6 @@
#include <vector>
#include "base/hashmap.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/protocol/AccessPermission.hh"
#include "mem/protocol/CacheMsg.hh"
#include "mem/protocol/CacheRequestType.hh"
@@ -153,8 +152,8 @@ class CacheMemory : public SimObject
// The first index is the # of cache lines.
// The second index is the the amount associativity.
m5::hash_map<Address, int> m_tag_index;
- Vector<Vector<AbstractCacheEntry*> > m_cache;
- Vector<Vector<int> > m_locked;
+ std::vector<std::vector<AbstractCacheEntry*> > m_cache;
+ std::vector<std::vector<int> > m_locked;
AbstractReplacementPolicy *m_replacementPolicy_ptr;
diff --git a/src/mem/ruby/system/MemoryVector.hh b/src/mem/ruby/system/MemoryVector.hh
index 15cea168d..6719b9fb6 100644
--- a/src/mem/ruby/system/MemoryVector.hh
+++ b/src/mem/ruby/system/MemoryVector.hh
@@ -44,7 +44,7 @@ class MemoryVector
~MemoryVector();
friend class DirectoryMemory;
- void setSize(uint32 size); // destructive
+ void resize(uint32 size); // destructive
void write(const Address & paddr, uint8* data, int len);
uint8* read(const Address & paddr, uint8* data, int len);
@@ -71,7 +71,7 @@ inline
MemoryVector::MemoryVector(uint32 size)
: m_page_offset_mask(4095)
{
- setSize(size);
+ resize(size);
}
inline
@@ -86,7 +86,7 @@ MemoryVector::~MemoryVector()
}
inline void
-MemoryVector::setSize(uint32 size)
+MemoryVector::resize(uint32 size)
{
if (m_pages != NULL){
for (int i = 0; i < m_num_pages; i++) {
diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
index 641c8fcb9..9ba150f11 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -92,7 +92,7 @@ Sequencer::wakeup()
// Check across all outstanding requests
int total_outstanding = 0;
- Vector<Address> keys = m_readRequestTable.keys();
+ std::vector<Address> keys = m_readRequestTable.keys();
for (int i = 0; i < keys.size(); i++) {
SequencerRequest* request = m_readRequestTable.lookup(keys[i]);
if (current_time - request->issue_time >= m_deadlock_threshold) {
@@ -160,7 +160,7 @@ Sequencer::printProgress(ostream& out) const
out << "---------------" << endl;
out << "outstanding requests" << endl;
- Vector<Address> rkeys = m_readRequestTable.keys();
+ std::vector<Address> rkeys = m_readRequestTable.keys();
int read_size = rkeys.size();
out << "proc " << m_version << " Read Requests = " << read_size << endl;
@@ -174,7 +174,7 @@ Sequencer::printProgress(ostream& out) const
total_demand++;
}
- Vector<Address> wkeys = m_writeRequestTable.keys();
+ std::vector<Address> wkeys = m_writeRequestTable.keys();
int write_size = wkeys.size();
out << "proc " << m_version << " Write Requests = " << write_size << endl;
diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc
index d28d74a89..801b2a3e9 100644
--- a/src/mem/ruby/system/System.cc
+++ b/src/mem/ruby/system/System.cc
@@ -85,7 +85,7 @@ RubySystem::RubySystem(const Params *p)
m_mem_vec_ptr = NULL;
} else {
m_mem_vec_ptr = new MemoryVector;
- m_mem_vec_ptr->setSize(m_memory_size_bytes);
+ m_mem_vec_ptr->resize(m_memory_size_bytes);
}
//
diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh
index f501c5a83..77b056faf 100644
--- a/src/mem/ruby/system/System.hh
+++ b/src/mem/ruby/system/System.hh
@@ -36,7 +36,6 @@
#define __MEM_RUBY_SYSTEM_SYSTEM_HH__
#include "base/callback.hh"
-#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
#include "mem/ruby/system/RubyPort.hh"
diff --git a/src/mem/ruby/system/TimerTable.cc b/src/mem/ruby/system/TimerTable.cc
index c623677f3..1b5545c96 100644
--- a/src/mem/ruby/system/TimerTable.cc
+++ b/src/mem/ruby/system/TimerTable.cc
@@ -108,7 +108,7 @@ TimerTable::updateNext() const
return;
}
- Vector<Address> addresses = m_map.keys();
+ std::vector<Address> addresses = m_map.keys();
m_next_address = addresses[0];
m_next_time = m_map.lookup(m_next_address);
diff --git a/src/mem/ruby/tester/DeterministicDriver.cc b/src/mem/ruby/tester/DeterministicDriver.cc
index e09f633b5..8dce1c702 100644
--- a/src/mem/ruby/tester/DeterministicDriver.cc
+++ b/src/mem/ruby/tester/DeterministicDriver.cc
@@ -39,6 +39,8 @@
//#include "DMAGenerator.hh"
#include "mem/ruby/tester/DetermGETXGenerator.hh"
+using namespace std;
+
#define DATA_BLOCK_BYTES 64
DeterministicDriver::DeterministicDriver(string generator_type, int num_completions, int num_procs, Time g_think_time, Time g_wait_time, int g_tester_length)
@@ -56,22 +58,22 @@ DeterministicDriver::DeterministicDriver(string generator_type, int num_completi
m_wait_time = g_wait_time;
m_tester_length = g_tester_length;
- m_last_progress_vector.setSize(num_procs);
+ m_last_progress_vector.resize(num_procs);
for (int i=0; i<m_last_progress_vector.size(); i++) {
m_last_progress_vector[i] = 0;
}
- m_load_vector.setSize(10);
+ m_load_vector.resize(10);
for (int i=0; i<m_load_vector.size(); i++) {
m_load_vector[i] = -1; // No processor last held it
}
- m_store_vector.setSize(10);
+ m_store_vector.resize(10);
for (int i=0; i<m_store_vector.size(); i++) {
m_store_vector[i] = -1; // No processor last held it
}
- m_generator_vector.setSize(num_procs);
+ m_generator_vector.resize(num_procs);
int generator = string_to_SpecifiedGeneratorType(generator_type);
@@ -156,7 +158,7 @@ bool DeterministicDriver::isLoadReady(NodeID node, Address addr)
}
// searches for any address in the addr_vector
-bool DeterministicDriver::isAddrReady(NodeID node, Vector<NodeID> addr_vector)
+bool DeterministicDriver::isAddrReady(NodeID node, vector<NodeID> addr_vector)
{
for (int i=0; i<addr_vector.size(); i++) {
if (((addr_vector[i]+1)%m_num_procs == node) &&
@@ -170,7 +172,7 @@ bool DeterministicDriver::isAddrReady(NodeID node, Vector<NodeID> addr_vector)
}
// test for a particular addr
-bool DeterministicDriver::isAddrReady(NodeID node, Vector<NodeID> addr_vector, Address addr)
+bool DeterministicDriver::isAddrReady(NodeID node, vector<NodeID> addr_vector, Address addr)
{
int addr_number = addr.getAddress()/DATA_BLOCK_BYTES;
@@ -197,7 +199,7 @@ void DeterministicDriver::storeCompleted(NodeID node, Address addr)
setNextAddr(node, addr, m_store_vector);
}
-void DeterministicDriver::setNextAddr(NodeID node, Address addr, Vector<NodeID>& addr_vector)
+void DeterministicDriver::setNextAddr(NodeID node, Address addr, vector<NodeID>& addr_vector)
{
// mark the addr vector that this proc was the last to use the particular address
int addr_number = addr.getAddress()/DATA_BLOCK_BYTES;
@@ -214,7 +216,7 @@ Address DeterministicDriver::getNextStoreAddr(NodeID node)
return getNextAddr(node, m_store_vector);
}
-Address DeterministicDriver::getNextAddr(NodeID node, Vector<NodeID> addr_vector)
+Address DeterministicDriver::getNextAddr(NodeID node, vector<NodeID> addr_vector)
{
// This method deterministically picks the next addr the node should acquirer
diff --git a/src/mem/ruby/tester/DeterministicDriver.hh b/src/mem/ruby/tester/DeterministicDriver.hh
index 7c77666be..ddc7bc99b 100644
--- a/src/mem/ruby/tester/DeterministicDriver.hh
+++ b/src/mem/ruby/tester/DeterministicDriver.hh
@@ -36,7 +36,10 @@
#ifndef DETERMINISTICDRIVER_H
#define DETERMINISTICDRIVER_H
+
#include <map>
+#include <vector>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/tester/Tester_Globals.hh"
#include "mem/ruby/common/Histogram.hh" // includes global, but doesn't use anything, so it should be fine
@@ -96,18 +99,18 @@ public:
private:
// Private Methods
- Address getNextAddr(NodeID node, Vector<NodeID> addr_vector);
- bool isAddrReady(NodeID node, Vector<NodeID> addr_vector);
- bool isAddrReady(NodeID node, Vector<NodeID> addr_vector, Address addr);
- void setNextAddr(NodeID node, Address addr, Vector<NodeID>& addr_vector);
+ Address getNextAddr(NodeID node, std::vector<NodeID> addr_vector);
+ bool isAddrReady(NodeID node, std::vector<NodeID> addr_vector);
+ bool isAddrReady(NodeID node, std::vector<NodeID> addr_vector, Address addr);
+ void setNextAddr(NodeID node, Address addr, std::vector<NodeID>& addr_vector);
// Data Members (m_ prefix)
- Vector<Time> m_last_progress_vector;
- Vector<SpecifiedGenerator*> m_generator_vector;
+ std::vector<Time> m_last_progress_vector;
+ std::vector<SpecifiedGenerator*> m_generator_vector;
//DMAGenerator* m_dma_generator;
- Vector<NodeID> m_load_vector; // Processor last to load the addr
- Vector<NodeID> m_store_vector; // Processor last to store the addr
+ std::vector<NodeID> m_load_vector; // Processor last to load the addr
+ std::vector<NodeID> m_store_vector; // Processor last to store the addr
int last_proc;
int m_done_counter;
diff --git a/src/mem/ruby/tester/RaceyDriver.cc b/src/mem/ruby/tester/RaceyDriver.cc
index 57445d252..a9f716334 100644
--- a/src/mem/ruby/tester/RaceyDriver.cc
+++ b/src/mem/ruby/tester/RaceyDriver.cc
@@ -50,7 +50,7 @@ RaceyDriver::RaceyDriver(int num_procs, int tester_length)
assert(m_num_procs >= 2);
// init all racey pseudo threads
- m_racey_pseudo_threads.setSize(m_num_procs);
+ m_racey_pseudo_threads.resize(m_num_procs);
for (int i=0; i<m_racey_pseudo_threads.size(); i++) {
m_racey_pseudo_threads[i] = new RaceyPseudoThread(i, *this);
}
diff --git a/src/mem/ruby/tester/RaceyDriver.hh b/src/mem/ruby/tester/RaceyDriver.hh
index e9b4e3425..9a4702ba8 100644
--- a/src/mem/ruby/tester/RaceyDriver.hh
+++ b/src/mem/ruby/tester/RaceyDriver.hh
@@ -37,11 +37,13 @@
#ifndef RACEYDRIVER_H
#define RACEYDRIVER_H
+#include <map>
+#include <vector>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/tester/Tester_Globals.hh"
#include "mem/ruby/common/Driver.hh"
#include "mem/ruby/tester/RaceyPseudoThread.hh"
-#include <map>
#include "mem/ruby/libruby.hh"
#define g_DEADLOCK_THRESHOLD 5000
@@ -100,7 +102,7 @@ private:
RaceyDriver& operator=(const RaceyDriver& obj);
// Data Members (m_ prefix)
- Vector<RaceyPseudoThread*> m_racey_pseudo_threads;
+ std::vector<RaceyPseudoThread*> m_racey_pseudo_threads;
int m_done_counter;
bool m_wakeup_thread0;
Time m_finish_time;
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index ff9bccf63..4a1ba69fc 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -521,7 +521,7 @@ $vid = m_net_ptr->get${network}NetQueue(m_version + base, $ordered, $vnet);
if vtype.isBuffer:
code('''
if (m_buffer_size > 0) {
- $vid->setSize(m_buffer_size);
+ $vid->resize(m_buffer_size);
}
''')