summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2014-03-20 09:14:14 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2014-03-20 09:14:14 -0500
commit4b67ada89e2e47b26ad07562774ff65beb5633a5 (patch)
treea93e52d39595313eec559d9c4d9b164f76418706 /configs
parent4f7ef51efba1c1688eadc14f628a1411512b235e (diff)
downloadgem5-4b67ada89e2e47b26ad07562774ff65beb5633a5.tar.xz
ruby: garnet: convert network interfaces into clocked objects
This helps in configuring the network interfaces from the python script and these objects no longer rely on the network object for the timing information.
Diffstat (limited to 'configs')
-rw-r--r--configs/ruby/Ruby.py37
1 files changed, 23 insertions, 14 deletions
diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py
index 5e987f0ac..d9517456b 100644
--- a/configs/ruby/Ruby.py
+++ b/configs/ruby/Ruby.py
@@ -132,27 +132,36 @@ def create_system(options, system, piobus = None, dma_ports = []):
# 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
+ NetworkClass = GarnetNetwork_d
+ IntLinkClass = GarnetIntLink_d
+ ExtLinkClass = GarnetExtLink_d
+ RouterClass = GarnetRouter_d
+ InterfaceClass = GarnetNetworkInterface_d
+
elif options.garnet_network == "flexible":
- class NetworkClass(GarnetNetwork): pass
- class IntLinkClass(GarnetIntLink): pass
- class ExtLinkClass(GarnetExtLink): pass
- class RouterClass(GarnetRouter): pass
+ NetworkClass = GarnetNetwork
+ IntLinkClass = GarnetIntLink
+ ExtLinkClass = GarnetExtLink
+ RouterClass = GarnetRouter
+ InterfaceClass = GarnetNetworkInterface
+
else:
- class NetworkClass(SimpleNetwork): pass
- class IntLinkClass(SimpleIntLink): pass
- class ExtLinkClass(SimpleExtLink): pass
- class RouterClass(Switch): pass
+ NetworkClass = SimpleNetwork
+ IntLinkClass = SimpleIntLink
+ ExtLinkClass = SimpleExtLink
+ RouterClass = Switch
+ InterfaceClass = None
# Create the network topology
network = NetworkClass(ruby_system = ruby, topology = topology.description,
- routers = [], ext_links = [], int_links = [])
+ routers = [], ext_links = [], int_links = [], netifs = [])
topology.makeTopology(options, network, IntLinkClass, ExtLinkClass,
- RouterClass)
+ RouterClass)
+
+ if InterfaceClass != None:
+ netifs = [InterfaceClass(id=i) for (i,n) in enumerate(network.ext_links)]
+ network.netifs = netifs
if options.network_fault_model:
assert(options.garnet_network == "fixed")