configs: fs.py can take multiple disk images on most ISAs

All ISAs except SPARC can now take multiple disk images by passing
the --disk-image option multiple times.

Before this patch, several ISAs automatically mounted a secondary disk
called "linux-bigswap2.img", which had to be in M5_PATH even if the end
user did not want more than one disk. This was the case for for example
for X86 but not ARM.

This change was done to:

* allow ARM to have a second disk image in fs.py, which was not possible,
  and allow other ISAs like X86 and ARM to take any number of disk images

* provide a simpler, more intuitive CLI interface that does not require
  magic disk images to be present in M5_PATH to work for ISAs such as X86.

  Linux does not need that secondary image to boot correctly, so it is
  more friendly to support a minimal setup that requires the least amount
  of binaries to boot, and let supply the second image manually only if
  they need it.

* make fs.py --disk-image work more similarly across all ISAs

SPARC was left with a single disk only because its setup was a bit more
complex and would require further testing.

Change-Id: I8b6e08ae6daf0a5b6cd1d57d285a9677f01eb7ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23671
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ciro Santilli
2019-10-29 16:00:24 +00:00
committed by Giacomo Travaglini
parent a29aaa364b
commit a6d98140ca
7 changed files with 52 additions and 54 deletions

View File

@@ -34,10 +34,10 @@ from os import environ as env
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
@@ -54,17 +54,17 @@ class SysConfig:
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'])
@@ -83,8 +83,8 @@ class SysConfig:
# 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')],
@@ -129,16 +129,16 @@ Benchmarks = {
'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')]
}