Ruby: Remove some unused typedefs

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.
This commit is contained in:
Nilay Vaish 2011-11-03 22:46:45 -05:00
parent d735abe5da
commit a547cf34b9
38 changed files with 20 additions and 94 deletions

View file

@ -37,7 +37,6 @@
#include "mem/protocol/TesterStatus.hh" #include "mem/protocol/TesterStatus.hh"
#include "mem/ruby/common/Address.hh" #include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
class SubBlock; class SubBlock;

View file

@ -48,7 +48,7 @@ structure(InPort, external = "yes", primitive="yes") {
bool isEmpty(); bool isEmpty();
} }
external_type(NodeID, default="0"); external_type(NodeID, default="0", primitive="yes");
external_type(MachineID); external_type(MachineID);
MessageBuffer getMandatoryQueue(int core_id); MessageBuffer getMandatoryQueue(int core_id);

View file

@ -109,7 +109,6 @@ MakeInclude('system/DirectoryMemory.hh')
MakeInclude('system/MachineID.hh') MakeInclude('system/MachineID.hh')
MakeInclude('system/MemoryControl.hh') MakeInclude('system/MemoryControl.hh')
MakeInclude('system/WireBuffer.hh') MakeInclude('system/WireBuffer.hh')
MakeInclude('system/NodeID.hh')
MakeInclude('system/PerfectCacheMemory.hh') MakeInclude('system/PerfectCacheMemory.hh')
MakeInclude('system/PersistentTable.hh') MakeInclude('system/PersistentTable.hh')
MakeInclude('system/Sequencer.hh') MakeInclude('system/Sequencer.hh')

View file

@ -33,8 +33,7 @@
#include <iomanip> #include <iomanip>
#include "base/hashmap.hh" #include "base/hashmap.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
#include "mem/ruby/system/NodeID.hh"
const int ADDRESS_WIDTH = 64; // address width in bytes const int ADDRESS_WIDTH = 64; // address width in bytes

View file

@ -32,7 +32,7 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
class DataBlock class DataBlock
{ {

View file

@ -34,7 +34,6 @@
#include "mem/ruby/common/Address.hh" #include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Consumer.hh" #include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
class Driver class Driver
{ {

View file

@ -29,16 +29,7 @@
#ifndef __MEM_RUBY_COMMON_GLOBAL_HH__ #ifndef __MEM_RUBY_COMMON_GLOBAL_HH__
#define __MEM_RUBY_COMMON_GLOBAL_HH__ #define __MEM_RUBY_COMMON_GLOBAL_HH__
// external includes for all classes #include "base/str.hh"
#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;
class RubyEventQueue; class RubyEventQueue;
extern RubyEventQueue* g_eventQueue_ptr; extern RubyEventQueue* g_eventQueue_ptr;

View file

@ -32,7 +32,7 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
class Histogram class Histogram
{ {

View file

@ -42,7 +42,6 @@
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Set.hh" #include "mem/ruby/common/Set.hh"
#include "mem/ruby/system/MachineID.hh" #include "mem/ruby/system/MachineID.hh"
#include "mem/ruby/system/NodeID.hh"
class NetDest class NetDest
{ {

View file

@ -36,7 +36,6 @@
#include <limits> #include <limits>
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/system/System.hh" #include "mem/ruby/system/System.hh"
class Set class Set

View file

@ -44,4 +44,9 @@ typedef long long integer_t;
typedef int64 Time; typedef int64 Time;
typedef uint64 physical_address_t; typedef uint64 physical_address_t;
typedef int64 Index; // what the address bit ripper returns
typedef int LinkID;
typedef int NodeID;
typedef int SwitchID;
#endif #endif

View file

@ -59,7 +59,7 @@
#include <iostream> #include <iostream>
#include "config/no_vector_bounds_checks.hh" #include "config/no_vector_bounds_checks.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
#include "sim/eventq.hh" #include "sim/eventq.hh"
class Consumer; class Consumer;

View file

@ -47,7 +47,6 @@
#include "mem/protocol/LinkDirection.hh" #include "mem/protocol/LinkDirection.hh"
#include "mem/protocol/MessageSizeType.hh" #include "mem/protocol/MessageSizeType.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/system/System.hh" #include "mem/ruby/system/System.hh"
#include "params/RubyNetwork.hh" #include "params/RubyNetwork.hh"
#include "sim/sim_object.hh" #include "sim/sim_object.hh"

View file

@ -45,8 +45,7 @@
#include <vector> #include <vector>
#include "mem/protocol/LinkDirection.hh" #include "mem/protocol/LinkDirection.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
#include "mem/ruby/system/NodeID.hh"
#include "params/Topology.hh" #include "params/Topology.hh"
#include "sim/sim_object.hh" #include "sim/sim_object.hh"

View file

@ -31,9 +31,6 @@
#ifndef __MEM_RUBY_NETWORK_GARNET_NETWORKHEADER_HH__ #ifndef __MEM_RUBY_NETWORK_GARNET_NETWORKHEADER_HH__
#define __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 flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_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_}; enum VNET_type {CTRL_VNET_, DATA_VNET_, NULL_VNET_, NUM_VNET_TYPE_};

View file

@ -31,6 +31,7 @@
#ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__ #ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__
#define __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" #include "mem/ruby/network/garnet/NetworkHeader.hh"
class InVcState class InVcState

View file

@ -31,6 +31,7 @@
#ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_OUT_VC_STATE_HH__ #ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_OUT_VC_STATE_HH__
#define __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" #include "mem/ruby/network/garnet/NetworkHeader.hh"
class OutVcState class OutVcState

View file

@ -71,8 +71,7 @@ PerfectSwitch::addInPort(const vector<MessageBuffer*>& in)
for (int j = 0; j < m_virtual_networks; j++) { for (int j = 0; j < m_virtual_networks; j++) {
m_in[port][j]->setConsumer(this); m_in[port][j]->setConsumer(this);
string desc = csprintf("[Queue from port %s %s %s to PerfectSwitch]", string desc = csprintf("[Queue from port %s %s %s to PerfectSwitch]",
NodeIDToString(m_switch_id), NodeIDToString(port), to_string(m_switch_id), to_string(port), to_string(j));
NodeIDToString(j));
m_in[port][j]->setDescription(desc); m_in[port][j]->setDescription(desc);
m_in[port][j]->setIncomingLink(port); m_in[port][j]->setIncomingLink(port);
m_in[port][j]->setVnet(j); m_in[port][j]->setVnet(j);

View file

@ -42,7 +42,6 @@
#include "mem/ruby/common/Consumer.hh" #include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
class MessageBuffer; class MessageBuffer;
class NetDest; class NetDest;

View file

@ -34,7 +34,6 @@
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/network/Network.hh" #include "mem/ruby/network/Network.hh"
#include "mem/ruby/system/NodeID.hh"
#include "params/SimpleNetwork.hh" #include "params/SimpleNetwork.hh"
#include "sim/sim_object.hh" #include "sim/sim_object.hh"

View file

@ -113,8 +113,8 @@ Throttle::addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr)
// Set consumer and description // Set consumer and description
m_in[m_vnets]->setConsumer(this); m_in[m_vnets]->setConsumer(this);
string desc = "[Queue to Throttle " + NodeIDToString(m_sID) + " " + string desc = "[Queue to Throttle " + to_string(m_sID) + " " +
NodeIDToString(m_node) + "]"; to_string(m_node) + "]";
m_in[m_vnets]->setDescription(desc); m_in[m_vnets]->setDescription(desc);
m_vnets++; m_vnets++;
} }

View file

@ -45,7 +45,6 @@
#include "mem/ruby/common/Consumer.hh" #include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/network/Network.hh" #include "mem/ruby/network/Network.hh"
#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/system/System.hh" #include "mem/ruby/system/System.hh"
class MessageBuffer; class MessageBuffer;

View file

@ -36,7 +36,6 @@
#include "mem/ruby/common/Address.hh" #include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Set.hh" #include "mem/ruby/common/Set.hh"
#include "mem/ruby/system/NodeID.hh"
class Histogram; class Histogram;

View file

@ -38,7 +38,6 @@
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Histogram.hh" #include "mem/ruby/common/Histogram.hh"
#include "mem/ruby/profiler/AccessTraceForAddress.hh" #include "mem/ruby/profiler/AccessTraceForAddress.hh"
#include "mem/ruby/system/NodeID.hh"
class Set; class Set;

View file

@ -39,7 +39,6 @@
#include "mem/protocol/RubyRequestType.hh" #include "mem/protocol/RubyRequestType.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Histogram.hh" #include "mem/ruby/common/Histogram.hh"
#include "mem/ruby/system/NodeID.hh"
class CacheProfiler class CacheProfiler
{ {

View file

@ -33,7 +33,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
class MemCntrlProfiler class MemCntrlProfiler
{ {

View file

@ -64,7 +64,6 @@
#include "mem/ruby/common/Set.hh" #include "mem/ruby/common/Set.hh"
#include "mem/ruby/system/MachineID.hh" #include "mem/ruby/system/MachineID.hh"
#include "mem/ruby/system/MemoryControl.hh" #include "mem/ruby/system/MemoryControl.hh"
#include "mem/ruby/system/NodeID.hh"
#include "params/RubyProfiler.hh" #include "params/RubyProfiler.hh"
#include "sim/sim_object.hh" #include "sim/sim_object.hh"

View file

@ -41,7 +41,6 @@
#include "mem/protocol/RubyRequestType.hh" #include "mem/protocol/RubyRequestType.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/recorder/TraceRecord.hh" #include "mem/ruby/recorder/TraceRecord.hh"
#include "mem/ruby/system/NodeID.hh"
class Address; class Address;
class TraceRecord; class TraceRecord;

View file

@ -38,7 +38,6 @@
#include "mem/ruby/common/Address.hh" #include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/system/Sequencer.hh" #include "mem/ruby/system/Sequencer.hh"
class CacheMsg; class CacheMsg;

View file

@ -39,7 +39,6 @@
#include "mem/protocol/RubyRequestType.hh" #include "mem/protocol/RubyRequestType.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/NodeID.hh"
#include "params/RubyTracer.hh" #include "params/RubyTracer.hh"
#include "sim/sim_object.hh" #include "sim/sim_object.hh"
#include "gzstream.hh" #include "gzstream.hh"

View file

@ -33,6 +33,7 @@
#include "base/refcnt.hh" #include "base/refcnt.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/TypeDefines.hh"
#include "mem/ruby/eventqueue/RubyEventQueue.hh" #include "mem/ruby/eventqueue/RubyEventQueue.hh"
class Message; class Message;

View file

@ -35,7 +35,6 @@
#include "mem/ruby/common/NetDest.hh" #include "mem/ruby/common/NetDest.hh"
#include "mem/ruby/system/DirectoryMemory.hh" #include "mem/ruby/system/DirectoryMemory.hh"
#include "mem/ruby/system/MachineID.hh" #include "mem/ruby/system/MachineID.hh"
#include "mem/ruby/system/NodeID.hh"
// used to determine the home directory // used to determine the home directory
// returns a value between 0 and total_directories_within_the_system // returns a value between 0 and total_directories_within_the_system

View file

@ -39,7 +39,6 @@
#include "mem/ruby/common/Address.hh" #include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/Global.hh"
#include "mem/ruby/profiler/Profiler.hh" #include "mem/ruby/profiler/Profiler.hh"
#include "mem/ruby/system/NodeID.hh"
class Set; class Set;

View file

@ -45,7 +45,6 @@
#include "mem/ruby/network/Network.hh" #include "mem/ruby/network/Network.hh"
#include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh" #include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh"
#include "mem/ruby/system/MachineID.hh" #include "mem/ruby/system/MachineID.hh"
#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/system/System.hh" #include "mem/ruby/system/System.hh"
class Set; class Set;

View file

@ -34,7 +34,6 @@
#include "base/cprintf.hh" #include "base/cprintf.hh"
#include "mem/protocol/MachineType.hh" #include "mem/protocol/MachineType.hh"
#include "mem/ruby/common/Global.hh"
struct MachineID struct MachineID
{ {

View file

@ -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__

View file

@ -1355,7 +1355,7 @@ ${ident}_ProfileDumper::dumpStats(std::ostream& out) const
#include "mem/protocol/${ident}_Event.hh" #include "mem/protocol/${ident}_Event.hh"
#include "mem/protocol/${ident}_State.hh" #include "mem/protocol/${ident}_State.hh"
#include "mem/ruby/common/Global.hh" #include "mem/ruby/common/TypeDefines.hh"
class ${ident}_Profiler class ${ident}_Profiler
{ {

View file

@ -439,7 +439,6 @@ ${{self.c_ident}}::print(ostream& out) const
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "mem/ruby/common/Global.hh"
''') ''')
if self.isStateDecl: if self.isStateDecl:
code('#include "mem/protocol/AccessPermission.hh"') code('#include "mem/protocol/AccessPermission.hh"')
@ -448,7 +447,6 @@ ${{self.c_ident}}::print(ostream& out) const
code('#include "base/misc.hh"') code('#include "base/misc.hh"')
code('#include "mem/protocol/GenericMachineType.hh"') code('#include "mem/protocol/GenericMachineType.hh"')
code('#include "mem/ruby/common/Address.hh"') code('#include "mem/ruby/common/Address.hh"')
code('#include "mem/ruby/system/NodeID.hh"')
code('struct MachineID;') code('struct MachineID;')
code(''' code('''