from m5.defines import buildEnv
class SysConfig:
- def __init__(self, script=None, mem=None, disk=None):
+ def __init__(self, script=None, mem=None, disk=None, rootdev=None):
self.scriptname = script
self.diskname = disk
self.memsize = mem
+ self.root = rootdev
def script(self):
if self.scriptname:
buildEnv['TARGET_ISA']
exit(1)
+ def rootdev(self):
+ if self.root:
+ return self.root
+ else:
+ return '/dev/sda1'
+
# Benchmarks are defined as a key in a dict which is a list of SysConfigs
# The first defined machine is the test system, the others are driving systems
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
if not cmdline:
cmdline = 'earlyprintk=pl011,0x1c090000 console=ttyAMA0 ' + \
'lpj=19988480 norandmaps rw loglevel=8 ' + \
- 'mem=%(mem)s root=/dev/sda1'
+ 'mem=%(mem)s root=%(rootdev)s'
self.realview.setupBootLoader(self.membus, self, binary)
self.gic_cpu_addr = self.realview.gic.cpu_addr
# Disk Image Options
parser.add_option("--disk-image", action="store", type="string", default=None,
help="Path to the disk image to use.")
+ parser.add_option("--root-device", action="store", type="string", default=None,
+ help="OS device name for root partition")
# Command line options
parser.add_option("--command-line", action="store", type="string",
sys.exit(1)
else:
if options.dual:
- bm = [SysConfig(disk=options.disk_image, mem=options.mem_size),
- SysConfig(disk=options.disk_image, mem=options.mem_size)]
+ bm = [SysConfig(disk=options.disk_image, rootdev=options.root_device,
+ mem=options.mem_size),
+ SysConfig(disk=options.disk_image, rootdev=options.root_device,
+ mem=options.mem_size)]
else:
- bm = [SysConfig(disk=options.disk_image, mem=options.mem_size)]
+ bm = [SysConfig(disk=options.disk_image, rootdev=options.root_device,
+ mem=options.mem_size)]
np = options.num_cpus