Ruby.py (10120:f5ceb3c3edb6) | Ruby.py (10122:1268f1fd2714) |
---|---|
1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 118 unchanged lines hidden (view full) --- 127 # Connect the system port for loading of binaries etc 128 system.system_port = system.sys_port_proxy.slave 129 130 131 # 132 # Set the network classes based on the command line options 133 # 134 if options.garnet_network == "fixed": | 1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 118 unchanged lines hidden (view full) --- 127 # Connect the system port for loading of binaries etc 128 system.system_port = system.sys_port_proxy.slave 129 130 131 # 132 # Set the network classes based on the command line options 133 # 134 if options.garnet_network == "fixed": |
135 class NetworkClass(GarnetNetwork_d): pass 136 class IntLinkClass(GarnetIntLink_d): pass 137 class ExtLinkClass(GarnetExtLink_d): pass 138 class RouterClass(GarnetRouter_d): pass | 135 NetworkClass = GarnetNetwork_d 136 IntLinkClass = GarnetIntLink_d 137 ExtLinkClass = GarnetExtLink_d 138 RouterClass = GarnetRouter_d 139 InterfaceClass = GarnetNetworkInterface_d 140 |
139 elif options.garnet_network == "flexible": | 141 elif options.garnet_network == "flexible": |
140 class NetworkClass(GarnetNetwork): pass 141 class IntLinkClass(GarnetIntLink): pass 142 class ExtLinkClass(GarnetExtLink): pass 143 class RouterClass(GarnetRouter): pass | 142 NetworkClass = GarnetNetwork 143 IntLinkClass = GarnetIntLink 144 ExtLinkClass = GarnetExtLink 145 RouterClass = GarnetRouter 146 InterfaceClass = GarnetNetworkInterface 147 |
144 else: | 148 else: |
145 class NetworkClass(SimpleNetwork): pass 146 class IntLinkClass(SimpleIntLink): pass 147 class ExtLinkClass(SimpleExtLink): pass 148 class RouterClass(Switch): pass | 149 NetworkClass = SimpleNetwork 150 IntLinkClass = SimpleIntLink 151 ExtLinkClass = SimpleExtLink 152 RouterClass = Switch 153 InterfaceClass = None |
149 150 151 # Create the network topology 152 network = NetworkClass(ruby_system = ruby, topology = topology.description, | 154 155 156 # Create the network topology 157 network = NetworkClass(ruby_system = ruby, topology = topology.description, |
153 routers = [], ext_links = [], int_links = []) | 158 routers = [], ext_links = [], int_links = [], netifs = []) |
154 topology.makeTopology(options, network, IntLinkClass, ExtLinkClass, | 159 topology.makeTopology(options, network, IntLinkClass, ExtLinkClass, |
155 RouterClass) | 160 RouterClass) |
156 | 161 |
162 if InterfaceClass != None: 163 netifs = [InterfaceClass(id=i) for (i,n) in enumerate(network.ext_links)] 164 network.netifs = netifs 165 |
|
157 if options.network_fault_model: 158 assert(options.garnet_network == "fixed") 159 network.enable_fault_model = True 160 network.fault_model = FaultModel() 161 162 # 163 # Loop through the directory controlers. 164 # Determine the total memory size of the ruby system and verify it is equal --- 41 unchanged lines hidden --- | 166 if options.network_fault_model: 167 assert(options.garnet_network == "fixed") 168 network.enable_fault_model = True 169 network.fault_model = FaultModel() 170 171 # 172 # Loop through the directory controlers. 173 # Determine the total memory size of the ruby system and verify it is equal --- 41 unchanged lines hidden --- |