configs: Do not require args.kernel to be set in baremetal.py
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 24 Apr 2020 14:59:25 +0000 (15:59 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 28 Apr 2020 09:51:36 +0000 (09:51 +0000)
This is allowing to us run baremetal.py with the --dtb-gen option
without needing to specify a --kernel argument

Change-Id: I98f1bc865d2f4e2230b1a85453efe83d95ec8a55
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/+/28148
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/example/arm/baremetal.py

index 24f40ec2eafc0afae099b90900bfde5b1714dea0..412625d576cebc2b66c156d9e4bdd6783d5c3930 100644 (file)
@@ -89,6 +89,8 @@ def create(args):
         print("Error: Bootscript %s does not exist" % args.readfile)
         sys.exit(1)
 
+    object_file = args.kernel if args.kernel else ""
+
     cpu_class = cpu_types[args.cpu][0]
     mem_mode = cpu_class.memory_mode()
     # Only simulate caches when using a timing CPU (e.g., the HPI model)
@@ -111,7 +113,7 @@ def create(args):
             stdout=args.semi_stdout,
             stderr=args.semi_stderr,
             files_root_dir=args.semi_path,
-            cmd_line = " ".join([ args.kernel ] + args.args)
+            cmd_line = " ".join([ object_file ] + args.args)
         )
 
     # Add the PCI devices we need for this system. The base system
@@ -162,7 +164,7 @@ def create(args):
 
     workload_class = workloads.workload_list.get(args.workload)
     system.workload = workload_class(
-        args.kernel, system)
+        object_file, system)
 
     return system