configs: Use workloads.py in baremetal.py
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 15 Apr 2020 16:27:02 +0000 (17:27 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 23 Apr 2020 09:23:08 +0000 (09:23 +0000)
Change-Id: I806b771df448241a7a61f496ac22c29d5bc6b84c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27971
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/example/arm/baremetal.py

index 00a350a4542365e497a658f1804654cd737d3e33..24f40ec2eafc0afae099b90900bfde5b1714dea0 100644 (file)
@@ -57,6 +57,7 @@ from common import ObjectList
 from common.cores.arm import HPI
 
 import devices
+import workloads
 
 # Pre-defined CPU configurations. Each tuple must be ordered as : (cpu_class,
 # l1_icache_class, l1_dcache_class, walk_cache_class, l2_Cache_class). Any of
@@ -100,9 +101,6 @@ def create(args):
                                   args.mem_size,
                                   platform=platform(),
                                   mem_mode=mem_mode,
-                                  workload=ArmFsWorkload(
-                                      atags_addr=0,
-                                      object_file=args.kernel),
                                   readfile=args.readfile)
 
     MemConfig.config_mem(args, system)
@@ -162,6 +160,10 @@ def create(args):
     system.have_virtualization = True
     system.have_security = True
 
+    workload_class = workloads.workload_list.get(args.workload)
+    system.workload = workload_class(
+        args.kernel, system)
+
     return system
 
 def run(args):
@@ -190,6 +192,10 @@ def main():
     parser.add_argument("--kernel", type=str,
                         default=None,
                         help="Binary to run")
+    parser.add_argument("--workload", type=str,
+                        default="ArmBaremetal",
+                        choices=workloads.workload_list.get_names(),
+                        help="Workload type")
     parser.add_argument("--disk-image", type=str,
                         default=None,
                         help="Disk to instantiate")