funcmem = PhysicalMemory(),
physmem = PhysicalMemory())
-system.ruby = Ruby.create_system(options, system.physmem)
+system.ruby = Ruby.create_system(options, system)
assert(len(cpus) == len(system.ruby.cpu_ruby_ports))
system = makeLinuxAlphaRubySystem(test_mem_mode, bm[0])
system.ruby = Ruby.create_system(options,
- system.physmem,
+ system,
system.piobus,
system.dma_devices)
system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
physmem = PhysicalMemory())
-system.ruby = Ruby.create_system(options, system.physmem)
+system.ruby = Ruby.create_system(options, system)
assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
#
system = System(physmem = PhysicalMemory())
-system.ruby = Ruby.create_system(options, system.physmem)
+system.ruby = Ruby.create_system(options, system)
assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
def define_options(parser):
return
-def create_system(options, phys_mem, piobus, dma_devices):
+def create_system(options, system, piobus, dma_devices):
if buildEnv['PROTOCOL'] != 'MESI_CMP_directory':
panic("This script requires the MESI_CMP_directory protocol to be built.")
cpu_seq = RubySequencer(version = i,
icache = l1i_cache,
dcache = l1d_cache,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
if piobus != None:
cpu_seq.pio_port = piobus.port
L1IcacheMemory = l1i_cache,
L1DcacheMemory = l1d_cache,
l2_select_num_bits = \
- math.log(options.num_l2caches, 2))
+ math.log(options.num_l2caches,
+ 2))
+
+ exec("system.l1_cntrl%d = l1_cntrl" % i)
+
#
# Add controllers and sequencers to the appropriate lists
#
l2_cntrl = L2Cache_Controller(version = i,
L2cacheMemory = l2_cache)
+ exec("system.l2_cntrl%d = l2_cntrl" % i)
l2_cntrl_nodes.append(l2_cntrl)
- phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 1
+ phys_mem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
mem_module_size = phys_mem_size / options.num_dirs
for i in xrange(options.num_dirs):
dir_cntrl = Directory_Controller(version = i,
directory = \
RubyDirectoryMemory(version = i,
- size = dir_size),
+ size = \
+ dir_size),
memBuffer = mem_cntrl)
+ exec("system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
for i, dma_device in enumerate(dma_devices):
# Create the Ruby objects associated with the dma controller
#
dma_seq = DMASequencer(version = i,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
dma_cntrl = DMA_Controller(version = i,
dma_sequencer = dma_seq)
dma_cntrl.dma_sequencer.port = dma_device.dma
+ exec("system.dma_cntrl%d = dma_cntrl" % i)
dma_cntrl_nodes.append(dma_cntrl)
all_cntrls = l1_cntrl_nodes + \
def define_options(parser):
return
-def create_system(options, phys_mem, piobus, dma_devices):
+def create_system(options, system, piobus, dma_devices):
if buildEnv['PROTOCOL'] != 'MI_example':
panic("This script requires the MI_example protocol to be built.")
cpu_seq = RubySequencer(version = i,
icache = cache,
dcache = cache,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
if piobus != None:
cpu_seq.pio_port = piobus.port
l1_cntrl = L1Cache_Controller(version = i,
sequencer = cpu_seq,
cacheMemory = cache)
+
+ exec("system.l1_cntrl%d = l1_cntrl" % i)
#
# Add controllers and sequencers to the appropriate lists
#
cpu_sequencers.append(cpu_seq)
l1_cntrl_nodes.append(l1_cntrl)
- phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 1
+ phys_mem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
mem_module_size = phys_mem_size / options.num_dirs
for i in xrange(options.num_dirs):
dir_cntrl = Directory_Controller(version = i,
directory = \
- RubyDirectoryMemory(version = i,
- size = dir_size,
- use_map = options.use_map,
- map_levels = options.map_levels),
+ RubyDirectoryMemory( \
+ version = i,
+ size = dir_size,
+ use_map = options.use_map,
+ map_levels = \
+ options.map_levels),
memBuffer = mem_cntrl)
+ exec("system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
for i, dma_device in enumerate(dma_devices):
# Create the Ruby objects associated with the dma controller
#
dma_seq = DMASequencer(version = i,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
dma_cntrl = DMA_Controller(version = i,
dma_sequencer = dma_seq)
+ exec("system.dma_cntrl%d = dma_cntrl" % i)
dma_cntrl.dma_sequencer.port = dma_device.dma
dma_cntrl_nodes.append(dma_cntrl)
def define_options(parser):
return
-def create_system(options, phys_mem, piobus, dma_devices):
+def create_system(options, system, piobus, dma_devices):
if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory':
panic("This script requires the MOESI_CMP_directory protocol to be built.")
cpu_seq = RubySequencer(version = i,
icache = l1i_cache,
dcache = l1d_cache,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
if piobus != None:
cpu_seq.pio_port = piobus.port
L1IcacheMemory = l1i_cache,
L1DcacheMemory = l1d_cache,
l2_select_num_bits = \
- math.log(options.num_l2caches, 2))
+ math.log(options.num_l2caches,
+ 2))
+
+ exec("system.l1_cntrl%d = l1_cntrl" % i)
#
# Add controllers and sequencers to the appropriate lists
#
l2_cntrl = L2Cache_Controller(version = i,
L2cacheMemory = l2_cache)
+ exec("system.l2_cntrl%d = l2_cntrl" % i)
l2_cntrl_nodes.append(l2_cntrl)
- phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 1
+ phys_mem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
mem_module_size = phys_mem_size / options.num_dirs
for i in xrange(options.num_dirs):
dir_cntrl = Directory_Controller(version = i,
directory = \
RubyDirectoryMemory(version = i,
- size = dir_size),
+ size = \
+ dir_size),
memBuffer = mem_cntrl)
+ exec("system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
for i, dma_device in enumerate(dma_devices):
# Create the Ruby objects associated with the dma controller
#
dma_seq = DMASequencer(version = i,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
dma_cntrl = DMA_Controller(version = i,
dma_sequencer = dma_seq)
+ exec("system.dma_cntrl%d = dma_cntrl" % i)
dma_cntrl.dma_sequencer.port = dma_device.dma
dma_cntrl_nodes.append(dma_cntrl)
parser.add_option("--disable-dyn-timeouts", action="store_true",
help="Token_CMP: disable dyanimc timeouts, use fixed latency instead")
-def create_system(options, phys_mem, piobus, dma_devices):
+def create_system(options, system, piobus, dma_devices):
if buildEnv['PROTOCOL'] != 'MOESI_CMP_token':
panic("This script requires the MOESI_CMP_token protocol to be built.")
cpu_seq = RubySequencer(version = i,
icache = l1i_cache,
dcache = l1d_cache,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
if piobus != None:
cpu_seq.pio_port = piobus.port
L1IcacheMemory = l1i_cache,
L1DcacheMemory = l1d_cache,
l2_select_num_bits = \
- math.log(options.num_l2caches, 2),
+ math.log(options.num_l2caches,
+ 2),
N_tokens = n_tokens,
- retry_threshold = options.l1_retries,
+ retry_threshold = \
+ options.l1_retries,
fixed_timeout_latency = \
options.timeout_latency,
dynamic_timeout_enabled = \
not options.disable_dyn_timeouts)
+ exec("system.l1_cntrl%d = l1_cntrl" % i)
#
# Add controllers and sequencers to the appropriate lists
#
L2cacheMemory = l2_cache,
N_tokens = n_tokens)
+ exec("system.l2_cntrl%d = l2_cntrl" % i)
l2_cntrl_nodes.append(l2_cntrl)
- phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 1
+ phys_mem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
mem_module_size = phys_mem_size / options.num_dirs
for i in xrange(options.num_dirs):
dir_cntrl = Directory_Controller(version = i,
directory = \
RubyDirectoryMemory(version = i,
- size = dir_size),
+ size = \
+ dir_size),
memBuffer = mem_cntrl,
l2_select_num_bits = \
- math.log(options.num_l2caches, 2))
+ math.log(options.num_l2caches,
+ 2))
+ exec("system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
for i, dma_device in enumerate(dma_devices):
# Create the Ruby objects associated with the dma controller
#
dma_seq = DMASequencer(version = i,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
dma_cntrl = DMA_Controller(version = i,
dma_sequencer = dma_seq)
+ exec("system.dma_cntrl%d = dma_cntrl" % i)
dma_cntrl.dma_sequencer.port = dma_device.dma
dma_cntrl_nodes.append(dma_cntrl)
def define_options(parser):
return
-def create_system(options, phys_mem, piobus, dma_devices):
+def create_system(options, system, piobus, dma_devices):
if buildEnv['PROTOCOL'] != 'MOESI_hammer':
panic("This script requires the MOESI_hammer protocol to be built.")
cpu_seq = RubySequencer(version = i,
icache = l1i_cache,
dcache = l1d_cache,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
if piobus != None:
cpu_seq.pio_port = piobus.port
L1IcacheMemory = l1i_cache,
L1DcacheMemory = l1d_cache,
L2cacheMemory = l2_cache)
+
+ exec("system.l1_cntrl%d = l1_cntrl" % i)
#
# Add controllers and sequencers to the appropriate lists
#
cpu_sequencers.append(cpu_seq)
l1_cntrl_nodes.append(l1_cntrl)
- phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 1
+ phys_mem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
mem_module_size = phys_mem_size / options.num_dirs
for i in xrange(options.num_dirs):
dir_cntrl = Directory_Controller(version = i,
directory = \
- RubyDirectoryMemory(version = i,
- size = dir_size,
- use_map = options.use_map,
- map_levels = options.map_levels),
+ RubyDirectoryMemory( \
+ version = i,
+ size = dir_size,
+ use_map = options.use_map,
+ map_levels = \
+ options.map_levels),
memBuffer = mem_cntrl)
+ exec("system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
for i, dma_device in enumerate(dma_devices):
# Create the Ruby objects associated with the dma controller
#
dma_seq = DMASequencer(version = i,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
dma_cntrl = DMA_Controller(version = i,
dma_sequencer = dma_seq)
+ exec("system.dma_cntrl%d = dma_cntrl" % i)
dma_cntrl.dma_sequencer.port = dma_device.dma
dma_cntrl_nodes.append(dma_cntrl)
exec "import %s" % protocol
eval("%s.define_options(parser)" % protocol)
-def create_system(options, physmem, piobus = None, dma_devices = []):
+def create_system(options, system, piobus = None, dma_devices = []):
protocol = buildEnv['PROTOCOL']
exec "import %s" % protocol
try:
(cpu_sequencers, dir_cntrls, all_cntrls) = \
- eval("%s.create_system(options, physmem, piobus, dma_devices)" \
+ eval("%s.create_system(options, system, piobus, dma_devices)" \
% protocol)
except:
print "Error: could not create sytem for ruby protocol %s" % protocol
total_mem_size = MemorySize('0B')
for dir_cntrl in dir_cntrls:
total_mem_size.value += dir_cntrl.directory.size.value
- physmem_size = long(physmem.range.second) - long(physmem.range.first) + 1
+ physmem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
assert(total_mem_size.value == physmem_size)
ruby_profiler = RubyProfiler(num_of_sequencers = len(cpu_sequencers))