Ruby.py (8939:4c84b2566d2f) | Ruby.py (9100:3caf131d7a95) |
---|---|
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 --- 65 unchanged lines hidden (view full) --- 74 help="Used for seeding the random number generator") 75 76 parser.add_option("--ruby_stats", type="string", default="ruby.stats") 77 78 protocol = buildEnv['PROTOCOL'] 79 exec "import %s" % protocol 80 eval("%s.define_options(parser)" % protocol) 81 | 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 --- 65 unchanged lines hidden (view full) --- 74 help="Used for seeding the random number generator") 75 76 parser.add_option("--ruby_stats", type="string", default="ruby.stats") 77 78 protocol = buildEnv['PROTOCOL'] 79 exec "import %s" % protocol 80 eval("%s.define_options(parser)" % protocol) 81 |
82def create_topology(controllers, options): 83 """ Called from create_system in configs/ruby/<protocol>.py 84 Must return an object which is a subclass of BaseTopology 85 found in configs/topologies/BaseTopology.py 86 This is a wrapper for the legacy topologies. 87 """ 88 exec "import %s as Topo" % options.topology 89 topology = eval("Topo.%s(controllers)" % options.topology) 90 return topology 91 |
|
82def create_system(options, system, piobus = None, dma_ports = []): 83 84 system.ruby = RubySystem(clock = options.clock, 85 stats_filename = options.ruby_stats, 86 no_mem_vec = options.use_map) 87 ruby = system.ruby 88 89 protocol = buildEnv['PROTOCOL'] 90 exec "import %s" % protocol 91 try: | 92def create_system(options, system, piobus = None, dma_ports = []): 93 94 system.ruby = RubySystem(clock = options.clock, 95 stats_filename = options.ruby_stats, 96 no_mem_vec = options.use_map) 97 ruby = system.ruby 98 99 protocol = buildEnv['PROTOCOL'] 100 exec "import %s" % protocol 101 try: |
92 (cpu_sequencers, dir_cntrls, all_cntrls) = \ | 102 (cpu_sequencers, dir_cntrls, topology) = \ |
93 eval("%s.create_system(options, system, piobus, dma_ports, ruby)" 94 % protocol) 95 except: 96 print "Error: could not create sytem for ruby protocol %s" % protocol 97 raise 98 99 # Create a port proxy for connecting the system port. This is 100 # independent of the protocol and kept in the protocol-agnostic --- 22 unchanged lines hidden (view full) --- 123 class RouterClass(GarnetRouter): pass 124 else: 125 class NetworkClass(SimpleNetwork): pass 126 class IntLinkClass(SimpleIntLink): pass 127 class ExtLinkClass(SimpleExtLink): pass 128 class RouterClass(BasicRouter): pass 129 130 # | 103 eval("%s.create_system(options, system, piobus, dma_ports, ruby)" 104 % protocol) 105 except: 106 print "Error: could not create sytem for ruby protocol %s" % protocol 107 raise 108 109 # Create a port proxy for connecting the system port. This is 110 # independent of the protocol and kept in the protocol-agnostic --- 22 unchanged lines hidden (view full) --- 133 class RouterClass(GarnetRouter): pass 134 else: 135 class NetworkClass(SimpleNetwork): pass 136 class IntLinkClass(SimpleIntLink): pass 137 class ExtLinkClass(SimpleExtLink): pass 138 class RouterClass(BasicRouter): pass 139 140 # |
131 # Important: the topology must be created before the network and after the 132 # controllers. | 141 # Important: the topology must be instantiated before the network and after 142 # the controllers. Hence the separation between topology definition and 143 # instantiation. TopologyCreator is in src/mem/ruby/network/topologies/. |
133 # | 144 # |
134 exec "import %s" % options.topology | 145 from TopologyCreator import instantiateTopology |
135 try: | 146 try: |
136 net_topology = eval("%s.makeTopology(all_cntrls, options, \ 137 IntLinkClass, ExtLinkClass, \ 138 RouterClass)" \ 139 % options.topology) | 147 net_topology = instantiateTopology(topology, options, \ 148 IntLinkClass, ExtLinkClass, \ 149 RouterClass) |
140 except: | 150 except: |
141 print "Error: could not create topology %s" % options.topology | 151 print "Error: could not make topology %s" % options.topology |
142 raise 143 144 if options.network_fault_model: 145 assert(options.garnet_network == "fixed") 146 fault_model = FaultModel() 147 network = NetworkClass(ruby_system = ruby, topology = net_topology,\ 148 enable_fault_model=True, fault_model = fault_model) 149 else: --- 40 unchanged lines hidden --- | 152 raise 153 154 if options.network_fault_model: 155 assert(options.garnet_network == "fixed") 156 fault_model = FaultModel() 157 network = NetworkClass(ruby_system = ruby, topology = net_topology,\ 158 enable_fault_model=True, fault_model = fault_model) 159 else: --- 40 unchanged lines hidden --- |