summaryrefslogtreecommitdiff
path: root/configs/ruby/Ruby.py
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2011-04-28 17:18:14 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2011-04-28 17:18:14 -0700
commit40bcbf42539fec83628f2ae2627238adff27f62c (patch)
tree993083e3b6e5661697261e81869bf40e17027826 /configs/ruby/Ruby.py
parentbc5eb596053f7f69c88f8218f20709d94b2a331c (diff)
downloadgem5-40bcbf42539fec83628f2ae2627238adff27f62c.tar.xz
network: convert links & switches to first class C++ SimObjects
This patch converts links and switches from second class simobjects that were virtually ignored by the networks (both simple and Garnet) to first class simobjects that directly correspond to c++ ojbects manipulated by the topology and network classes. This is especially true for Garnet, where the links and switches directly correspond to specific C++ objects. By making this change, many aspects of the Topology class were simplified. --HG-- rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/BasicLink.cc rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/BasicLink.hh rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.cc rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.hh rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.cc rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.hh rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py
Diffstat (limited to 'configs/ruby/Ruby.py')
-rw-r--r--configs/ruby/Ruby.py34
1 files changed, 25 insertions, 9 deletions
diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py
index e5d3c4a7c..7f32829d6 100644
--- a/configs/ruby/Ruby.py
+++ b/configs/ruby/Ruby.py
@@ -71,25 +71,41 @@ def create_system(options, system, piobus = None, dma_devices = []):
except:
print "Error: could not create sytem for ruby protocol %s" % protocol
raise
-
+
+ #
+ # Set the network classes based on the command line options
+ #
+ if options.garnet_network == "fixed":
+ class NetworkClass(GarnetNetwork_d): pass
+ class IntLinkClass(GarnetIntLink_d): pass
+ class ExtLinkClass(GarnetExtLink_d): pass
+ class RouterClass(GarnetRouter_d): pass
+ elif options.garnet_network == "flexible":
+ class NetworkClass(GarnetNetwork): pass
+ class IntLinkClass(GarnetIntLink): pass
+ class ExtLinkClass(GarnetExtLink): pass
+ class RouterClass(GarnetRouter): pass
+ else:
+ class NetworkClass(SimpleNetwork): pass
+ class IntLinkClass(BasicIntLink): pass
+ class ExtLinkClass(BasicExtLink): pass
+ class RouterClass(BasicRouter): pass
+
#
# Important: the topology must be created before the network and after the
# controllers.
#
exec "import %s" % options.topology
try:
- net_topology = eval("%s.makeTopology(all_cntrls, options)" \
+ net_topology = eval("%s.makeTopology(all_cntrls, options, \
+ IntLinkClass, ExtLinkClass, \
+ RouterClass)" \
% options.topology)
except:
print "Error: could not create topology %s" % options.topology
raise
-
- if options.garnet_network == "fixed":
- network = GarnetNetwork_d(topology = net_topology)
- elif options.garnet_network == "flexible":
- network = GarnetNetwork(topology = net_topology)
- else:
- network = SimpleNetwork(topology = net_topology)
+
+ network = NetworkClass(topology = net_topology)
#
# Loop through the directory controlers.