- #
- # 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(SimpleIntLink): pass
- class ExtLinkClass(SimpleExtLink): pass
- class RouterClass(Switch): pass
-
- #
- # Important: the topology must be instantiated before the network and after
- # the controllers. Hence the separation between topology definition and
- # instantiation.
- #
-
- routers, int_links, ext_links = topology.makeTopology(options,
- IntLinkClass, ExtLinkClass, RouterClass)
- network = NetworkClass(ruby_system = ruby, routers = routers,
- int_links = int_links, ext_links = ext_links,
- topology = topology.description)