- #
- # 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(BasicRouter): pass
-
- #
- # Important: the topology must be instantiated before the network and after
- # the controllers. Hence the separation between topology definition and
- # instantiation. TopologyCreator is in src/mem/ruby/network/topologies/.
- #
- from TopologyCreator import instantiateTopology
- try:
- net_topology = instantiateTopology(topology, options, \
- IntLinkClass, ExtLinkClass, \
- RouterClass)
- except:
- print "Error: could not make topology %s" % options.topology
- raise
+ if InterfaceClass != None:
+ netifs = [InterfaceClass(id=i) for (i,n) in enumerate(network.ext_links)]
+ network.netifs = netifs