Ruby.py (8322:19949c6de823) Ruby.py (8436:5648986156db)
1# Copyright (c) 2006-2007 The Regents of The University of Michigan
2# Copyright (c) 2009 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 48 unchanged lines hidden (view full) ---

57 help="Used for seeding the random number generator")
58
59 protocol = buildEnv['PROTOCOL']
60 exec "import %s" % protocol
61 eval("%s.define_options(parser)" % protocol)
62
63def create_system(options, system, piobus = None, dma_devices = []):
64
1# Copyright (c) 2006-2007 The Regents of The University of Michigan
2# Copyright (c) 2009 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 48 unchanged lines hidden (view full) ---

57 help="Used for seeding the random number generator")
58
59 protocol = buildEnv['PROTOCOL']
60 exec "import %s" % protocol
61 eval("%s.define_options(parser)" % protocol)
62
63def create_system(options, system, piobus = None, dma_devices = []):
64
65 system.ruby = RubySystem(clock = options.clock)
66 ruby = system.ruby
67
65 protocol = buildEnv['PROTOCOL']
66 exec "import %s" % protocol
67 try:
68 (cpu_sequencers, dir_cntrls, all_cntrls) = \
68 protocol = buildEnv['PROTOCOL']
69 exec "import %s" % protocol
70 try:
71 (cpu_sequencers, dir_cntrls, all_cntrls) = \
69 eval("%s.create_system(options, system, piobus, dma_devices)" \
72 eval("%s.create_system(options, system, piobus, \
73 dma_devices, ruby)" \
70 % protocol)
71 except:
72 print "Error: could not create sytem for ruby protocol %s" % protocol
73 raise
74
75 #
76 # Set the network classes based on the command line options
77 #

--- 22 unchanged lines hidden (view full) ---

100 net_topology = eval("%s.makeTopology(all_cntrls, options, \
101 IntLinkClass, ExtLinkClass, \
102 RouterClass)" \
103 % options.topology)
104 except:
105 print "Error: could not create topology %s" % options.topology
106 raise
107
74 % protocol)
75 except:
76 print "Error: could not create sytem for ruby protocol %s" % protocol
77 raise
78
79 #
80 # Set the network classes based on the command line options
81 #

--- 22 unchanged lines hidden (view full) ---

104 net_topology = eval("%s.makeTopology(all_cntrls, options, \
105 IntLinkClass, ExtLinkClass, \
106 RouterClass)" \
107 % options.topology)
108 except:
109 print "Error: could not create topology %s" % options.topology
110 raise
111
108 network = NetworkClass(topology = net_topology)
112 network = NetworkClass(ruby_system = ruby, topology = net_topology)
109
110 #
111 # Loop through the directory controlers.
112 # Determine the total memory size of the ruby system and verify it is equal
113 # to physmem. However, if Ruby memory is using sparse memory in SE
114 # mode, then the system should not back-up the memory state with
115 # the Memory Vector and thus the memory size bytes should stay at 0.
116 # Also set the numa bits to the appropriate values.

--- 15 unchanged lines hidden (view full) ---

132 for dir_cntrl in dir_cntrls:
133 total_mem_size.value += dir_cntrl.directory.size.value
134 dir_cntrl.directory.numa_high_bit = numa_bit
135
136 physmem_size = long(system.physmem.range.second) - \
137 long(system.physmem.range.first) + 1
138 assert(total_mem_size.value == physmem_size)
139
113
114 #
115 # Loop through the directory controlers.
116 # Determine the total memory size of the ruby system and verify it is equal
117 # to physmem. However, if Ruby memory is using sparse memory in SE
118 # mode, then the system should not back-up the memory state with
119 # the Memory Vector and thus the memory size bytes should stay at 0.
120 # Also set the numa bits to the appropriate values.

--- 15 unchanged lines hidden (view full) ---

136 for dir_cntrl in dir_cntrls:
137 total_mem_size.value += dir_cntrl.directory.size.value
138 dir_cntrl.directory.numa_high_bit = numa_bit
139
140 physmem_size = long(system.physmem.range.second) - \
141 long(system.physmem.range.first) + 1
142 assert(total_mem_size.value == physmem_size)
143
140 ruby_profiler = RubyProfiler(num_of_sequencers = len(cpu_sequencers))
144 ruby_profiler = RubyProfiler(ruby_system = ruby,
145 num_of_sequencers = len(cpu_sequencers))
146 ruby_tracer = RubyTracer(ruby_system = ruby)
141
147
142 ruby = RubySystem(clock = options.clock,
143 network = network,
144 profiler = ruby_profiler,
145 tracer = RubyTracer(),
146 mem_size = total_mem_size)
147
148 ruby.network = network
149 ruby.profiler = ruby_profiler
150 ruby.tracer = ruby_tracer
151 ruby.mem_size = total_mem_size
148 ruby._cpu_ruby_ports = cpu_sequencers
149 ruby.random_seed = options.random_seed
152 ruby._cpu_ruby_ports = cpu_sequencers
153 ruby.random_seed = options.random_seed
150
151 return ruby