-# Copyright (c) 2010-2012, 2015-2017 ARM Limited
+# Copyright (c) 2010-2012, 2015-2018 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# iobus, as gem5's membus is only used for initialization and
# SST doesn't use it. Attaching nvmem to iobus solves this issue.
# During initialization, system_port -> membus -> iobus -> nvmem.
- if external_memory or ruby:
+ if external_memory:
self.realview.setupBootLoader(self.iobus, self, binary)
+ elif ruby:
+ self.realview.setupBootLoader(None, self, binary)
else:
self.realview.setupBootLoader(self.membus, self, binary)
self.gic_cpu_addr = self.realview.gic.cpu_addr
elif ruby:
self._dma_ports = [ ]
self.realview.attachOnChipIO(self.iobus, dma_ports=self._dma_ports)
- # Force Ruby to treat the boot ROM as an IO device.
- self.realview.nvmem.in_addr_map = False
self.realview.attachIO(self.iobus, dma_ports=self._dma_ports)
else:
self.realview.attachOnChipIO(self.membus, self.bridge)
test_sys.kvm_vm = KvmVM()
if options.ruby:
+ bootmem = getattr(test_sys, 'bootmem', None)
Ruby.create_system(options, True, test_sys, test_sys.iobus,
- test_sys._dma_ports)
+ test_sys._dma_ports, bootmem)
# Create a seperate clock domain for Ruby
test_sys.ruby.clk_domain = SrcClockDomain(clock = options.ruby_clock,
parser.add_option("--tcc-dir-factor", type='int', default=4,
help="TCCdir size = factor *(TCPs + TCC)")
-def create_system(options, full_system, system, dma_devices, ruby_system):
+def create_system(options, full_system, system, dma_devices, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'GPU_RfO':
panic("This script requires the GPU_RfO protocol to be built.")
parser.add_option("--noL1", action = "store_true", default = False,
help = "bypassL1")
-def create_system(options, full_system, system, dma_devices, ruby_system):
+def create_system(options, full_system, system, dma_devices, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'GPU_VIPER':
panic("This script requires the GPU_VIPER protocol to be built.")
parser.add_option("--noL2", action = "store_true", default = False,
help = "bypassL2")
-def create_system(options, full_system, system, dma_devices, ruby_system):
+def create_system(options, full_system, system, dma_devices, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'GPU_VIPER_Baseline':
panic("This script requires the" \
"GPU_VIPER_Baseline protocol to be built.")
action="store_true", default=False)
parser.add_option("--use-L3-on-WT", action="store_true", default=False)
-def create_system(options, full_system, system, dma_devices, ruby_system):
+def create_system(options, full_system, system, dma_devices, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'GPU_VIPER_Region':
panic("This script requires the GPU_VIPER_Region protocol to be built.")
def define_options(parser):
return
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'Garnet_standalone':
panic("This script requires Garnet_standalone protocol to be built.")
l1_cntrl.responseFromCache = MessageBuffer()
l1_cntrl.forwardFromCache = MessageBuffer()
-
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
# Connect the directory controllers and the network
dir_cntrl.requestToDir = MessageBuffer()
all_cntrls = l1_cntrl_nodes + dir_cntrl_nodes
ruby_system.network.number_of_virtual_networks = 3
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
caches private to clusters")
return
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MESI_Three_Level':
fatal("This script requires the MESI_Three_Level protocol to be\
ruby_system.memctrl_clk_domain = DerivedClockDomain(
clk_domain = ruby_system.clk_domain, clk_divider = 3)
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
# Connect the directory controllers and the network
dir_cntrl.requestToDir = MessageBuffer()
ruby_system.network.number_of_virtual_networks = 3
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
def define_options(parser):
return
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MESI_Two_Level':
fatal("This script requires the MESI_Two_Level protocol to be built.")
clk_domain = ruby_system.clk_domain,
clk_divider = 3)
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
# Connect the directory controllers and the network
dir_cntrl.requestToDir = MessageBuffer()
ruby_system.network.number_of_virtual_networks = 3
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
def define_options(parser):
return
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MI_example':
panic("This script requires the MI_example protocol to be built.")
clk_domain=ruby_system.clk_domain,
clk_divider=3)
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
# Connect the directory controllers and the network
dir_cntrl.requestToDir = MessageBuffer(ordered = True)
ruby_system.network.number_of_virtual_networks = 5
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
parser.add_option("--num-tbes", type="int", default=256)
parser.add_option("--l2-latency", type="int", default=50) # load to use
-def create_system(options, full_system, system, dma_devices, ruby_system):
+def create_system(options, full_system, system, dma_devices, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MOESI_AMD_Base':
panic("This script requires the MOESI_AMD_Base protocol.")
def define_options(parser):
return
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory':
panic("This script requires the MOESI_CMP_directory protocol to be built.")
clk_divider=3)
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
# Connect the directory controllers and the network
dir_cntrl.requestToDir = MessageBuffer()
ruby_system.network.number_of_virtual_networks = 3
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
parser.add_option("--allow-atomic-migration", action="store_true",
help="allow migratory sharing for atomic only accessed blocks")
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MOESI_CMP_token':
panic("This script requires the MOESI_CMP_token protocol to be built.")
clk_domain=ruby_system.clk_domain,
clk_divider=3)
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
dir_cntrl.l2_select_num_bits = l2_bits
# Connect the directory controllers and the network
ruby_system.network.number_of_virtual_networks = 6
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
parser.add_option("--dir-on", action="store_true",
help="Hammer: enable Full-bit Directory")
-def create_system(options, full_system, system, dma_ports, ruby_system):
+def create_system(options, full_system, system, dma_ports, bootmem,
+ ruby_system):
if buildEnv['PROTOCOL'] != 'MOESI_hammer':
panic("This script requires the MOESI_hammer protocol to be built.")
clk_domain=ruby_system.clk_domain,
clk_divider=3)
- dir_cntrl_nodes = create_directories(options, system.mem_ranges,
- ruby_system)
+ mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
+ options, system.mem_ranges, bootmem, ruby_system, system)
+ dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
+ if rom_dir_cntrl_node is not None:
+ dir_cntrl_nodes.append(rom_dir_cntrl_node)
for dir_cntrl in dir_cntrl_nodes:
pf = ProbeFilter(size = pf_size, assoc = 4,
start_index_bit = pf_start_bit)
ruby_system.network.number_of_virtual_networks = 6
topology = create_topology(all_cntrls, options)
- return (cpu_sequencers, dir_cntrl_nodes, topology)
+ return (cpu_sequencers, mem_dir_cntrl_nodes, topology)
-# Copyright (c) 2012, 2017 ARM Limited
+# Copyright (c) 2012, 2017-2018 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
topology = eval("Topo.%s(controllers)" % options.topology)
return topology
-def create_system(options, full_system, system, piobus = None, dma_ports = []):
+def create_system(options, full_system, system, piobus = None, dma_ports = [],
+ bootmem=None):
system.ruby = RubySystem()
ruby = system.ruby
try:
(cpu_sequencers, dir_cntrls, topology) = \
eval("%s.create_system(options, full_system, system, dma_ports,\
- ruby)"
+ bootmem, ruby)"
% protocol)
except:
print("Error: could not create sytem for ruby protocol %s" % protocol)
ruby.phys_mem = SimpleMemory(range=system.mem_ranges[0],
in_addr_map=False)
-def create_directories(options, mem_ranges, ruby_system):
+def create_directories(options, mem_ranges, bootmem, ruby_system,
+ system):
dir_cntrl_nodes = []
if options.numa_high_bit:
numa_bit = options.numa_high_bit
exec("ruby_system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
- return dir_cntrl_nodes
+
+ if bootmem is not None:
+ rom_dir_cntrl = Directory_Controller()
+ rom_dir_cntrl.directory = RubyDirectoryMemory()
+ rom_dir_cntrl.ruby_system = ruby_system
+ rom_dir_cntrl.version = i + 1
+ rom_dir_cntrl.memory = bootmem.port
+ rom_dir_cntrl.addr_ranges = bootmem.range
+ return (dir_cntrl_nodes, rom_dir_cntrl)
+
+ return (dir_cntrl_nodes, None)
def send_evicts(options):
# currently, 2 scenarios warrant forwarding evictions to the CPU:
-# Copyright (c) 2009-2017 ARM Limited
+# Copyright (c) 2009-2018 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
self._attach_io(self._off_chip_devices(), *args, **kwargs)
def setupBootLoader(self, mem_bus, cur_sys, loc):
- self.nvmem = SimpleMemory(range = AddrRange('2GB', size = '64MB'),
- conf_table_reported = False)
- self.nvmem.port = mem_bus.master
+ cur_sys.bootmem = SimpleMemory(
+ range = AddrRange('2GB', size = '64MB'),
+ conf_table_reported = False)
+ if mem_bus is not None:
+ cur_sys.bootmem.port = mem_bus.master
cur_sys.boot_loader = loc('boot.arm')
cur_sys.atags_addr = 0x100
cur_sys.load_offset = 0
self.gicv2m.frames = [Gicv2mFrame(spi_base=256, spi_len=64, addr=0x2C1C0000)]
def setupBootLoader(self, mem_bus, cur_sys, loc):
- self.nvmem = SimpleMemory(range = AddrRange('64MB'),
- conf_table_reported = False)
- self.nvmem.port = mem_bus.master
+ cur_sys.bootmem = SimpleMemory(range = AddrRange('64MB'),
+ conf_table_reported = False)
+ if mem_bus is not None:
+ cur_sys.bootmem.port = mem_bus.master
if not cur_sys.boot_loader:
cur_sys.boot_loader = loc('boot_emm.arm')
cur_sys.atags_addr = 0x8000000
pci_pio_base=0x2f000000)
def setupBootLoader(self, mem_bus, cur_sys, loc):
- self.nvmem = SimpleMemory(range=AddrRange(0, size='64MB'),
- conf_table_reported=False)
- self.nvmem.port = mem_bus.master
+ cur_sys.bootmem = SimpleMemory(range=AddrRange(0, size='64MB'),
+ conf_table_reported=False)
+ if mem_bus is not None:
+ cur_sys.bootmem.port = mem_bus.master
if not cur_sys.boot_loader:
cur_sys.boot_loader = loc('boot_emm.arm64')
cur_sys.atags_addr = 0x8000000
cur_sys.load_offset = 0x80000000
-
class VExpress_GEM5_V1(RealView):
"""
The VExpress gem5 memory map is loosely based on a modified
self._attach_device(device, *args, **kwargs)
def setupBootLoader(self, mem_bus, cur_sys, loc):
- self.nvmem = SimpleMemory(range=AddrRange(0, size='64MB'),
- conf_table_reported=False)
- self.nvmem.port = mem_bus.master
+ cur_sys.bootmem = SimpleMemory(range=AddrRange(0, size='64MB'),
+ conf_table_reported=False)
+ if mem_bus is not None:
+ cur_sys.bootmem.port = mem_bus.master
if not cur_sys.boot_loader:
cur_sys.boot_loader = [ loc('boot_emm.arm64'), loc('boot_emm.arm') ]
cur_sys.atags_addr = 0x8000000
options.num_cpus = self.num_cpus
options.num_dirs = 2
+ bootmem = getattr(system, 'bootmem', None)
Ruby.create_system(options, True, system, system.iobus,
- system._dma_ports)
+ system._dma_ports, bootmem)
# Create a seperate clock domain for Ruby
system.ruby.clk_domain = SrcClockDomain(