from m5.defines import buildEnv
class SysConfig:
- def __init__(self, script=None, mem=None, disk=None, rootdev=None,
+ def __init__(self, script=None, mem=None, disks=None, rootdev=None,
os_type='linux'):
self.scriptname = script
- self.diskname = disk
+ self.disknames = disks
self.memsize = mem
self.root = rootdev
self.ostype = os_type
else:
return '128MB'
- def disk(self):
- if self.diskname:
- return disk(self.diskname)
+ def disks(self):
+ if self.disknames:
+ return [disk(diskname) for diskname in self.disknames]
elif buildEnv['TARGET_ISA'] == 'alpha':
- return env.get('LINUX_IMAGE', disk('linux-latest.img'))
+ return [env.get('LINUX_IMAGE', disk('linux-latest.img'))]
elif buildEnv['TARGET_ISA'] == 'x86':
- return env.get('LINUX_IMAGE', disk('x86root.img'))
+ return [env.get('LINUX_IMAGE', disk('x86root.img'))]
elif buildEnv['TARGET_ISA'] == 'arm':
- return env.get('LINUX_IMAGE', disk('linux-aarch32-ael.img'))
+ return [env.get('LINUX_IMAGE', disk('linux-aarch32-ael.img'))]
elif buildEnv['TARGET_ISA'] == 'sparc':
- return env.get('LINUX_IMAGE', disk('disk.s10hw2'))
+ return [env.get('LINUX_IMAGE', disk('disk.s10hw2'))]
else:
print("Don't know what default disk image to use for %s ISA" %
buildEnv['TARGET_ISA'])
# The first defined machine is the test system, the others are driving systems
Benchmarks = {
- 'PovrayBench': [SysConfig('povray-bench.rcS', '512MB', 'povray.img')],
- 'PovrayAutumn': [SysConfig('povray-autumn.rcS', '512MB', 'povray.img')],
+ 'PovrayBench': [SysConfig('povray-bench.rcS', '512MB', ['povray.img'])],
+ 'PovrayAutumn': [SysConfig('povray-autumn.rcS', '512MB', ['povray.img'])],
'NetperfStream': [SysConfig('netperf-stream-client.rcS'),
SysConfig('netperf-server.rcS')],
'MutexTest': [SysConfig('mutex-test.rcS', '128MB')],
'ArmAndroid-GB': [SysConfig('null.rcS', '256MB',
- 'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.clean.img',
+ ['ARMv7a-Gingerbread-Android.SMP.mouse.nolock.clean.img'],
None, 'android-gingerbread')],
- 'bbench-gb': [SysConfig('bbench-gb.rcS', '256MB',
- 'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.img',
+ 'bbench-gb': [SysConfig('bbench-gb.rcS', '256MB',
+ ['ARMv7a-Gingerbread-Android.SMP.mouse.nolock.img'],
None, 'android-gingerbread')],
'ArmAndroid-ICS': [SysConfig('null.rcS', '256MB',
- 'ARMv7a-ICS-Android.SMP.nolock.clean.img',
+ ['ARMv7a-ICS-Android.SMP.nolock.clean.img'],
None, 'android-ics')],
'bbench-ics': [SysConfig('bbench-ics.rcS', '256MB',
- 'ARMv7a-ICS-Android.SMP.nolock.img',
+ ['ARMv7a-ICS-Android.SMP.nolock.img'],
None, 'android-ics')]
}
parent.attachPciDevice(viopci, bus)
def fillInCmdline(mdesc, template, **kwargs):
- kwargs.setdefault('disk', mdesc.disk())
kwargs.setdefault('rootdev', mdesc.rootdev())
kwargs.setdefault('mem', mdesc.mem())
kwargs.setdefault('script', mdesc.script())
return template % kwargs
+def makeCowDisks(disk_paths):
+ disks = []
+ for disk_path in disk_paths:
+ disk = CowIdeDisk(driveID='master')
+ disk.childImage(disk_path);
+ disks.append(disk)
+ return disks
+
def makeLinuxAlphaSystem(mem_mode, mdesc=None, ruby=False, cmdline=None):
class BaseTsunami(Tsunami):
ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
- ide = IdeController(disks=[Parent.disk0, Parent.disk2],
+ ide = IdeController(disks=Parent.disks,
pci_func=0, pci_dev=0, pci_bus=0)
self = LinuxAlphaSystem()
self.system_port = self.membus.slave
self.mem_ranges = [AddrRange(mdesc.mem())]
- self.disk0 = CowIdeDisk(driveID='master')
- self.disk2 = CowIdeDisk(driveID='master')
- self.disk0.childImage(mdesc.disk())
- self.disk2.childImage(disk('linux-bigswap2.img'))
- self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
- read_only = True))
+ self.disks = makeCowDisks(mdesc.disks())
+ self.simple_disk = SimpleDisk(disk=RawDiskImage(
+ image_file = mdesc.disks()[0], read_only = True))
self.intrctrl = IntrControl()
self.mem_mode = mem_mode
self.terminal = Terminal()
self.partition_desc.port = self.membus.master
self.intrctrl = IntrControl()
self.disk0 = CowMmDisk()
- self.disk0.childImage(mdesc.disk())
+ self.disk0.childImage(mdesc.disks()[0])
self.disk0.pio = self.iobus.master
# The puart0 and hvuart are placed on the IO bus, so create ranges
self._bootmem = self.realview.bootmem
if isinstance(self.realview, VExpress_EMM64):
- if os.path.split(mdesc.disk())[-1] == 'linux-aarch32-ael.img':
+ if os.path.split(mdesc.disks()[0])[-1] == 'linux-aarch32-ael.img':
print("Selected 64-bit ARM architecture, updating default "
"disk image...")
mdesc.diskname = 'linaro-minimal-aarch64.img'
# Attach any PCI devices this platform supports
self.realview.attachPciDevices()
- self.cf0 = CowIdeDisk(driveID='master')
- self.cf0.childImage(mdesc.disk())
+ disks = makeCowDisks(mdesc.disks())
# Old platforms have a built-in IDE or CF controller. Default to
# the IDE controller if both exist. New platforms expect the
# storage controller to be added from the config script.
if hasattr(self.realview, "ide"):
- self.realview.ide.disks = [self.cf0]
+ self.realview.ide.disks = disks
elif hasattr(self.realview, "cf_ctrl"):
- self.realview.cf_ctrl.disks = [self.cf0]
+ self.realview.cf_ctrl.disks = disks
else:
- self.pci_ide = IdeController(disks=[self.cf0])
+ self.pci_ide = IdeController(disks=disks)
pci_devices.append(self.pci_ide)
self.mem_ranges = []
# behavior has been replaced with a more explicit option per
# the error message below. The disk can have any name now and
# doesn't need to include 'android' substring.
- if (os.path.split(mdesc.disk())[-1]).lower().count('android'):
+ if (mdesc.disks() and
+ os.path.split(mdesc.disks()[0])[-1]).lower().count('android'):
if 'android' not in mdesc.os_type():
fatal("It looks like you are trying to boot an Android " \
"platform. To boot Android, you must specify " \
def makeLinuxMipsSystem(mem_mode, mdesc=None, cmdline=None):
class BaseMalta(Malta):
ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
- ide = IdeController(disks=[Parent.disk0, Parent.disk2],
+ ide = IdeController(disks=Parent.disks,
pci_func=0, pci_dev=0, pci_bus=0)
self = LinuxMipsSystem()
self.mem_ranges = [AddrRange('1GB')]
self.bridge.master = self.iobus.slave
self.bridge.slave = self.membus.master
- self.disk0 = CowIdeDisk(driveID='master')
- self.disk2 = CowIdeDisk(driveID='master')
- self.disk0.childImage(mdesc.disk())
- self.disk2.childImage(disk('linux-bigswap2.img'))
+ self.disks = makeCowDisks(mdesc.disks())
self.malta = BaseMalta()
self.malta.attachIO(self.iobus)
self.malta.ide.pio = self.iobus.master
self.malta.ide.dma = self.iobus.slave
self.malta.ethernet.pio = self.iobus.master
self.malta.ethernet.dma = self.iobus.slave
- self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
- read_only = True))
+ self.simple_disk = SimpleDisk(disk=RawDiskImage(
+ image_file = mdesc.disks()[0], read_only = True))
self.intrctrl = IntrControl()
self.mem_mode = mem_mode
self.terminal = Terminal()
self.intrctrl = IntrControl()
# Disks
- disk0 = CowIdeDisk(driveID='master')
- disk2 = CowIdeDisk(driveID='master')
- disk0.childImage(mdesc.disk())
- disk2.childImage(disk('linux-bigswap2.img'))
- self.pc.south_bridge.ide.disks = [disk0, disk2]
+ disks = makeCowDisks(mdesc.disks())
+ self.pc.south_bridge.ide.disks = disks
# Add in a Bios information structure.
structures = [X86SMBiosBiosInformation()]