Ruby: Remove some unused typedefs
authorNilay Vaish <nilay@cs.wisc.edu>
Fri, 4 Nov 2011 03:46:45 +0000 (22:46 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Fri, 4 Nov 2011 03:46:45 +0000 (22:46 -0500)
This patch removes some of the unused typedefs. It also moves
some of the typedefs from Global.hh to TypeDefines.hh. The patch
also eliminates the file NodeID.hh.

38 files changed:
src/cpu/testers/rubytest/Check.hh
src/mem/protocol/RubySlicc_Types.sm
src/mem/ruby/SConscript
src/mem/ruby/common/Address.hh
src/mem/ruby/common/DataBlock.hh
src/mem/ruby/common/Driver.hh
src/mem/ruby/common/Global.hh
src/mem/ruby/common/Histogram.hh
src/mem/ruby/common/NetDest.hh
src/mem/ruby/common/Set.hh
src/mem/ruby/common/TypeDefines.hh
src/mem/ruby/eventqueue/RubyEventQueue.hh
src/mem/ruby/network/Network.hh
src/mem/ruby/network/Topology.hh
src/mem/ruby/network/garnet/NetworkHeader.hh
src/mem/ruby/network/garnet/flexible-pipeline/InVcState.hh
src/mem/ruby/network/garnet/flexible-pipeline/OutVcState.hh
src/mem/ruby/network/simple/PerfectSwitch.cc
src/mem/ruby/network/simple/PerfectSwitch.hh
src/mem/ruby/network/simple/SimpleNetwork.hh
src/mem/ruby/network/simple/Throttle.cc
src/mem/ruby/network/simple/Throttle.hh
src/mem/ruby/profiler/AccessTraceForAddress.hh
src/mem/ruby/profiler/AddressProfiler.hh
src/mem/ruby/profiler/CacheProfiler.hh
src/mem/ruby/profiler/MemCntrlProfiler.hh
src/mem/ruby/profiler/Profiler.hh
src/mem/ruby/recorder/CacheRecorder.hh
src/mem/ruby/recorder/TraceRecord.hh
src/mem/ruby/recorder/Tracer.hh
src/mem/ruby/slicc_interface/Message.hh
src/mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh
src/mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh
src/mem/ruby/slicc_interface/RubySlicc_Util.hh
src/mem/ruby/system/MachineID.hh
src/mem/ruby/system/NodeID.hh [deleted file]
src/mem/slicc/symbols/StateMachine.py
src/mem/slicc/symbols/Type.py

index 6861a74d323b2a10d1480fff0ba23159d7d992fe..db1485548ac90d7aba27d0ae83727463646bb89e 100644 (file)
@@ -37,7 +37,6 @@
 #include "mem/protocol/TesterStatus.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class SubBlock;
 
index a2f8abfaa54545e21d19ecbcab882a4ff6118731..cc404394dfff633db0ac3c3e972dffec2021c251 100644 (file)
@@ -48,7 +48,7 @@ structure(InPort, external = "yes", primitive="yes") {
   bool isEmpty();
 }
 
-external_type(NodeID, default="0");
+external_type(NodeID, default="0", primitive="yes");
 external_type(MachineID);
 
 MessageBuffer getMandatoryQueue(int core_id);
index 64dd83bb07ba7792224d5b08b9c63fb905478659..06f6abd9fcb497bc167b3eacc0e238098b44a7f9 100644 (file)
@@ -109,7 +109,6 @@ MakeInclude('system/DirectoryMemory.hh')
 MakeInclude('system/MachineID.hh')
 MakeInclude('system/MemoryControl.hh')
 MakeInclude('system/WireBuffer.hh')
-MakeInclude('system/NodeID.hh')
 MakeInclude('system/PerfectCacheMemory.hh')
 MakeInclude('system/PersistentTable.hh')
 MakeInclude('system/Sequencer.hh')
index 4a9a3adb2305ae386d85fe376d00c4c3efc64549..7ab3d12515e76833180a7e1b1ef6805d1cf2e9ce 100644 (file)
@@ -33,8 +33,7 @@
 #include <iomanip>
 
 #include "base/hashmap.hh"
-#include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 
 const int ADDRESS_WIDTH = 64; // address width in bytes
 
index 1d6abcfeedb6300f16c63ff2ccd279efccff015a..7bd92710ddea5c2c2aca782f97edaf3871c569dc 100644 (file)
@@ -32,7 +32,7 @@
 #include <iomanip>
 #include <iostream>
 
-#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 
 class DataBlock
 {
index 8d687ef4fb43818d3ec687d0b1f58b8da9b7e0ab..477b90927940a8752a6e68d49b42ec43a03eca6c 100644 (file)
@@ -34,7 +34,6 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class Driver
 {
index 357825465f6933167416348ef5a60c9123515b69..cae7cb16b31cd2f8872b40fadb889674be92ce9d 100644 (file)
 #ifndef __MEM_RUBY_COMMON_GLOBAL_HH__
 #define __MEM_RUBY_COMMON_GLOBAL_HH__
 
-// external includes for all classes
-#include "mem/ruby/common/TypeDefines.hh"
-
-// simple type declarations
-typedef Time LogicalTime;
-typedef int64 Index;            // what the address bit ripper returns
-typedef int word;               // one word of a cache line
-typedef unsigned int uint;
-typedef int SwitchID;
-typedef int LinkID;
+#include "base/str.hh"
 
 class RubyEventQueue;
 extern RubyEventQueue* g_eventQueue_ptr;
index 81cfbd477174471cb5525e45f1899e7d3918bf20..bfc0e4293636940e96247d1841a0d6406d7c352a 100644 (file)
@@ -32,7 +32,7 @@
 #include <iostream>
 #include <vector>
 
-#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 
 class Histogram
 {
index 8006045d82b5df8fe51ec0c3b482bfde70d9f16d..5ad1b61001933b5c6adb85e6187873cc52e3b980 100644 (file)
@@ -42,7 +42,6 @@
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/common/Set.hh"
 #include "mem/ruby/system/MachineID.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class NetDest
 {
index b76c3409dc47b925bd9303435bb4aaea84784584..ea10b83f1f147d3d4d1fe1d58efb9375c181278b 100644 (file)
@@ -36,7 +36,6 @@
 #include <limits>
 
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "mem/ruby/system/System.hh"
 
 class Set
index 2e8d308e28b7f0b58ea29dc1261e9edac7f69b6a..233c9146ad99ac15989124c6ebaa34f02f6cdc46 100644 (file)
@@ -44,4 +44,9 @@ typedef long long integer_t;
 typedef int64 Time;
 typedef uint64 physical_address_t;
 
+typedef int64 Index;            // what the address bit ripper returns
+typedef int LinkID;
+typedef int NodeID;
+typedef int SwitchID;
+
 #endif
index 3e2bc3f899dba3e95f3ba26b7484b47bf64cbec4..20b44362af5fb45a516b99f58c62b4126d8e8026 100644 (file)
@@ -59,7 +59,7 @@
 #include <iostream>
 
 #include "config/no_vector_bounds_checks.hh"
-#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 #include "sim/eventq.hh"
 
 class Consumer;
index 309560921d8906097c02a63e8a70b6d6710385eb..15784914966a0338d19e27a28bedd603934631de 100644 (file)
@@ -47,7 +47,6 @@
 #include "mem/protocol/LinkDirection.hh"
 #include "mem/protocol/MessageSizeType.hh"
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "mem/ruby/system/System.hh"
 #include "params/RubyNetwork.hh"
 #include "sim/sim_object.hh"
index 7b74396869881bb28a6be4adddfa537c14777ec5..e8510f81021600b6dc8552600f16c73941ed07ee 100644 (file)
@@ -45,8 +45,7 @@
 #include <vector>
 
 #include "mem/protocol/LinkDirection.hh"
-#include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 #include "params/Topology.hh"
 #include "sim/sim_object.hh"
 
index 713c4943915fa891c6c7362fc575f32e6bb30cf0..eccb4b31cba6556faf001dfb299b1ae182f027b3 100644 (file)
@@ -31,9 +31,6 @@
 #ifndef __MEM_RUBY_NETWORK_GARNET_NETWORKHEADER_HH__
 #define __MEM_RUBY_NETWORK_GARNET_NETWORKHEADER_HH__
 
-#include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
-
 enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
 enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
 enum VNET_type {CTRL_VNET_, DATA_VNET_, NULL_VNET_, NUM_VNET_TYPE_};
index 829509f6436fa17f19a6d5ee2de8161618ac5fa4..e98bf3f7b368840cd8ebbe2fe2325260e2c67532 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__
 #define __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__
 
+#include "mem/ruby/common/TypeDefines.hh"
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 
 class InVcState
index 17fa9141e444d7bb00b406c0270dd6b04227fefd..03ea14076444483361afbe9bf4b0a766fb23cde1 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_OUT_VC_STATE_HH__
 #define __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_OUT_VC_STATE_HH__
 
+#include "mem/ruby/common/TypeDefines.hh"
 #include "mem/ruby/network/garnet/NetworkHeader.hh"
 
 class OutVcState
index 06c4ace9108825c544929e0b89b1ec8c6af6c41d..f8b08d55174106d7d7c81f25a06e15fa1f528ece 100644 (file)
@@ -71,8 +71,7 @@ PerfectSwitch::addInPort(const vector<MessageBuffer*>& 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]",
-            NodeIDToString(m_switch_id), NodeIDToString(port),
-            NodeIDToString(j));
+            to_string(m_switch_id), to_string(port), to_string(j));
         m_in[port][j]->setDescription(desc);
         m_in[port][j]->setIncomingLink(port);
         m_in[port][j]->setVnet(j);
index 15abec02084c88c71b1cf7be23fa5080102b43af..d761c398d57c86be753cc7af884b7a1e54c031ea 100644 (file)
@@ -42,7 +42,6 @@
 
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class MessageBuffer;
 class NetDest;
index fb5481b46312ce53d1c9bb7fbc0c2e84be06c5e1..54e1ee36e649347c493acf560f35dd49d1c16fc0 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/network/Network.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "params/SimpleNetwork.hh"
 #include "sim/sim_object.hh"
 
index 822989204776650a052e3abd3cfbe5a2d10e0859..b248c6c6c41aabc24d3e1180cdde6f145a189796 100644 (file)
@@ -113,8 +113,8 @@ Throttle::addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr)
 
     // Set consumer and description
     m_in[m_vnets]->setConsumer(this);
-    string desc = "[Queue to Throttle " + NodeIDToString(m_sID) + " " +
-        NodeIDToString(m_node) + "]";
+    string desc = "[Queue to Throttle " + to_string(m_sID) + " " +
+        to_string(m_node) + "]";
     m_in[m_vnets]->setDescription(desc);
     m_vnets++;
 }
index 09eac79a88a775ada0244266e57985d54f5deee7..28fe046b4edb24a3c0569fbc845c876becfe52fd 100644 (file)
@@ -45,7 +45,6 @@
 #include "mem/ruby/common/Consumer.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/network/Network.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "mem/ruby/system/System.hh"
 
 class MessageBuffer;
index 228ebcadec499628d3bbbb45e09483d2d014c41c..289b83a3ae63df3d593a74d50000c7d377f6ebe2 100644 (file)
@@ -36,7 +36,6 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/common/Set.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class Histogram;
 
index e525a792fd5793df8a1e7b72bb915d96860cb75f..5bce34bbb63681a68126206a0da5bfedc0f31320 100644 (file)
@@ -38,7 +38,6 @@
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/common/Histogram.hh"
 #include "mem/ruby/profiler/AccessTraceForAddress.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class Set;
 
index 33cb45e852fa2515203985c9f55110ad9572f4dc..c53db7ea809fdb61ddcaebdd009e570428abdbff 100644 (file)
@@ -39,7 +39,6 @@
 #include "mem/protocol/RubyRequestType.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/common/Histogram.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class CacheProfiler
 {
index e6d64a2b565f1320e62ae659344f9f5f690d3b22..a594e0d9661d963f81d9996f7372d138e3556308 100644 (file)
@@ -33,7 +33,7 @@
 #include <string>
 #include <vector>
 
-#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 
 class MemCntrlProfiler
 {
index 9efaf4be10e2e20755511cc727f46a6e77365a6c..258fc6f989bea7d4288a3dadf37208528b3eaa12 100644 (file)
@@ -64,7 +64,6 @@
 #include "mem/ruby/common/Set.hh"
 #include "mem/ruby/system/MachineID.hh"
 #include "mem/ruby/system/MemoryControl.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "params/RubyProfiler.hh"
 #include "sim/sim_object.hh"
 
index 97a20af2878e72f061898399bcd97a28c67af4fd..9f96f4fa09411b0dd77a6b2a8f95933e6eb8fcc9 100644 (file)
@@ -41,7 +41,6 @@
 #include "mem/protocol/RubyRequestType.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/recorder/TraceRecord.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class Address;
 class TraceRecord;
index 9ec2bdb9993212fa3678c548639e2958c01f4784..42f2135648a99f7acd17d5830e34d1875cb2ae38 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "mem/ruby/system/Sequencer.hh"
 
 class CacheMsg;
index e050b38126a163ca944bf889cd64b8b32804170c..cad47b28cf5dc86f1e78c5c01ae22796f3b4769f 100644 (file)
@@ -39,7 +39,6 @@
 
 #include "mem/protocol/RubyRequestType.hh"
 #include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "params/RubyTracer.hh"
 #include "sim/sim_object.hh"
 #include "gzstream.hh"
index 7fcfabe9ca0c81e7a75d9b867c4f2d7d31335d78..c57857adb3427ed9721291f51b8e3249cb33c68e 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "base/refcnt.hh"
 #include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 #include "mem/ruby/eventqueue/RubyEventQueue.hh"
 
 class Message;
index 14b084c5d40236fe0c713b20538a7b1c67dee1cf..cb9830446303eba0c727223d6dfe2f472312f8d7 100644 (file)
@@ -35,7 +35,6 @@
 #include "mem/ruby/common/NetDest.hh"
 #include "mem/ruby/system/DirectoryMemory.hh"
 #include "mem/ruby/system/MachineID.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 // used to determine the home directory
 // returns a value between 0 and total_directories_within_the_system
index b2e612bd41dcfe028a9d7b9a0845633edef55f1d..bed42018bd5db4ca5252ba36c4a3e8a09fdb5d18 100644 (file)
@@ -39,7 +39,6 @@
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/common/Global.hh"
 #include "mem/ruby/profiler/Profiler.hh"
-#include "mem/ruby/system/NodeID.hh"
 
 class Set;
 
index 9b284dab44049e609ec558e378ded688a032181e..d535ba7cd1ac2c0fcca28d08ec647fe1ff2c2b18 100644 (file)
@@ -45,7 +45,6 @@
 #include "mem/ruby/network/Network.hh"
 #include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh"
 #include "mem/ruby/system/MachineID.hh"
-#include "mem/ruby/system/NodeID.hh"
 #include "mem/ruby/system/System.hh"
 
 class Set;
index 567d1f004e63f1079e15a911a1390d9f6e6ec928..18beac5d8851ce05fa23966f562950d0d142e4cf 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "base/cprintf.hh"
 #include "mem/protocol/MachineType.hh"
-#include "mem/ruby/common/Global.hh"
 
 struct MachineID
 {
diff --git a/src/mem/ruby/system/NodeID.hh b/src/mem/ruby/system/NodeID.hh
deleted file mode 100644 (file)
index ed3486a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1999-2008 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.
- */
-
-#ifndef __MEM_RUBY_SYSTEM_NODEID_HH__
-#define __MEM_RUBY_SYSTEM_NODEID_HH__
-
-#include <string>
-
-#include "base/str.hh"
-#include "mem/ruby/common/Global.hh"
-
-typedef int NodeID;
-
-inline std::string
-NodeIDToString(NodeID node)
-{
-    return to_string(node);
-}
-
-#endif // __MEM_RUBY_SYSTEM_NODEID_HH__
index fbd090d49b247d2e04cef5b9bbab204b3cfe8ba6..4d3618093429af9b4fac7e684f133d48fc0fd544 100644 (file)
@@ -1355,7 +1355,7 @@ ${ident}_ProfileDumper::dumpStats(std::ostream& out) const
 
 #include "mem/protocol/${ident}_Event.hh"
 #include "mem/protocol/${ident}_State.hh"
-#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/TypeDefines.hh"
 
 class ${ident}_Profiler
 {
index 36be8c25af33203269fbac9256616f834c23fc62..ad00f2ac1803c23da5b1dda218b7fc63fb980b3e 100644 (file)
@@ -439,7 +439,6 @@ ${{self.c_ident}}::print(ostream& out) const
 #include <iostream>
 #include <string>
 
-#include "mem/ruby/common/Global.hh"
 ''')
         if self.isStateDecl:
             code('#include "mem/protocol/AccessPermission.hh"')
@@ -448,7 +447,6 @@ ${{self.c_ident}}::print(ostream& out) const
             code('#include "base/misc.hh"')
             code('#include "mem/protocol/GenericMachineType.hh"')
             code('#include "mem/ruby/common/Address.hh"')
-            code('#include "mem/ruby/system/NodeID.hh"')
             code('struct MachineID;')
 
         code('''