configs: Enabling SimObj CLI for baremetal platform
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 29 Jan 2020 09:41:20 +0000 (09:41 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 1 Apr 2020 16:06:54 +0000 (16:06 +0000)
Change-Id: I0d4059976c8fb6a1d796998af302eaa764609f86
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27347
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/example/arm/baremetal.py

index 1eb2a82f94f9276c292818bf8b2e2c3341455249..87e89528417088efc8664f70dae6ed35b36cfa84 100644 (file)
@@ -225,12 +225,22 @@ def main():
                         "(default: gem5's stderr)")
     parser.add_argument("args", default=[], nargs="*",
                         help="Semihosting arguments to pass to benchmark")
+    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 "
+             "for arrays. For example: "
+             "'system.cpu[0,1,3:8:2].max_insts_all_threads = 42' "
+             "sets max_insts_all_threads for cpus 0, 1, 3, 5 and 7 "
+             "Direct parameters of the root object are not accessible, "
+             "only parameters of its children.")
 
     args = parser.parse_args()
 
     root = Root(full_system=True)
     root.system = create(args)
 
+    root.apply_config(args.param)
+
     if args.restore is not None:
         m5.instantiate(args.restore)
     else: