config: Add --mem-size option in fs_bigLITTLE.py
authorChun-Chen TK Hsu <chunchenhsu@google.com>
Fri, 13 Sep 2019 04:06:17 +0000 (12:06 +0800)
committerChun-Chen TK Hsu <chunchenhsu@google.com>
Fri, 1 Nov 2019 02:29:50 +0000 (02:29 +0000)
Allow users to specify system memory size.

Change-Id: I1e0c099dc08d04f71b406d8cc86850f68b6048cb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20899
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

configs/example/arm/fs_bigLITTLE.py

index 36c5963cfbc945b6d861cf7662d70e4fe1f8faff..01619586f266711a0767e167abf67c2275bbb621 100644 (file)
@@ -114,13 +114,13 @@ class Ex5LittleCluster(devices.CpuCluster):
         super(Ex5LittleCluster, self).__init__(system, num_cpus, cpu_clock,
                                          cpu_voltage, *cpu_config)
 
-def createSystem(caches, kernel, bootscript,
-                 machine_type="VExpress_GEM5", disks=[]):
+def createSystem(caches, kernel, bootscript, machine_type="VExpress_GEM5",
+                 disks=[],  mem_size=default_mem_size):
     platform = ObjectList.platform_list.get(machine_type)
     m5.util.inform("Simulated platform: %s", platform.__name__)
 
     sys = devices.simpleSystem(LinuxArmSystem,
-                               caches, default_mem_size, platform(),
+                               caches, mem_size, platform(),
                                kernel=SysPaths.binary(kernel),
                                readfile=bootscript)
 
@@ -194,6 +194,8 @@ def addOptions(parser):
     parser.add_argument("--sim-quantum", type=str, default="1ms",
                         help="Simulation quantum for parallel simulation. " \
                         "Default: %(default)s")
+    parser.add_argument("--mem-size", type=str, default=default_mem_size,
+                        help="System memory size")
     parser.add_argument("-P", "--param", action="append", default=[],
         help="Set a SimObject parameter relative to the root node. "
              "An extended Python multi range slicing syntax can be used "
@@ -213,7 +215,7 @@ def build(options):
         "lpj=19988480",
         "norandmaps",
         "loglevel=8",
-        "mem=%s" % default_mem_size,
+        "mem=%s" % options.mem_size,
         "root=%s" % options.root,
         "rw",
         "init=%s" % options.kernel_init,
@@ -227,7 +229,8 @@ def build(options):
                           options.kernel,
                           options.bootscript,
                           options.machine_type,
-                          disks=disks)
+                          disks=disks,
+                          mem_size=options.mem_size)
 
     root.system = system
     system.boot_osflags = " ".join(kernel_cmd)