config: add --bootloader to fs.py and fs_bigLITTLE.py
authorCiro Santilli <ciro.santilli@arm.com>
Mon, 18 Nov 2019 15:30:49 +0000 (15:30 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 31 Jan 2020 12:41:49 +0000 (12:41 +0000)
This allows explicitly selecting which bootloader to use.

Before this commit, the bootloader had a fixed basename which
had to be present inside M5_PATH.

Change-Id: I02919207d6f175854017ae7b603d811da63d618e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23670
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

configs/common/FSConfig.py
configs/common/Options.py
configs/example/arm/fs_bigLITTLE.py
configs/example/fs.py

index ecc5f1c82c53b2f70ee44f0e01bdfa2b6e4ff8f9..e218c14c524443bc13f57d67ef0916de70acd424 100644 (file)
@@ -221,7 +221,7 @@ def makeSparcSystem(mem_mode, mdesc=None, cmdline=None):
 def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
                   dtb_filename=None, bare_metal=False, cmdline=None,
                   external_memory="", ruby=False, security=False,
-                  vio_9p=None):
+                  vio_9p=None, bootloader=None):
     assert machine_type
 
     pci_devices = []
@@ -312,7 +312,7 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
                       'lpj=19988480 norandmaps rw loglevel=8 ' + \
                       'mem=%(mem)s root=%(rootdev)s'
 
-        self.realview.setupBootLoader(self, binary)
+        self.realview.setupBootLoader(self, binary, bootloader)
 
         if hasattr(self.realview.gic, 'cpu_addr'):
             self.gic_cpu_addr = self.realview.gic.cpu_addr
index 173bd483caba11d08a225bdbd65a3eabb5b30d1f..1405012d6dbf53ab38b95ea7a47d8d19c517e8ae 100644 (file)
@@ -444,6 +444,8 @@ def addFSOptions(parser):
                 action="store_true", help="Enable stats dump at context "\
                 "switches and dump tasks file (required for Streamline)")
         parser.add_option("--vio-9p", action="store_true", help=vio_9p_help)
+        parser.add_option("--bootloader", action='append',
+                help="executable file that runs before the --kernel")
 
     # Benchmark options
     parser.add_option("--dual", action="store_true",
index 4645d9ee8cd2c47b799b52589e172073639202a7..969a844883577c0837e09821ed2a7d9ef8692063 100644 (file)
@@ -117,7 +117,7 @@ class Ex5LittleCluster(devices.CpuCluster):
                                          cpu_voltage, *cpu_config)
 
 def createSystem(caches, kernel, bootscript, machine_type="VExpress_GEM5",
-                 disks=[],  mem_size=default_mem_size):
+                 disks=[],  mem_size=default_mem_size, bootloader=None):
     platform = ObjectList.platform_list.get(machine_type)
     m5.util.inform("Simulated platform: %s", platform.__name__)
 
@@ -144,7 +144,7 @@ def createSystem(caches, kernel, bootscript, machine_type="VExpress_GEM5",
         for dev in sys.pci_vio_block:
             sys.attach_pci(dev)
 
-    sys.realview.setupBootLoader(sys, SysPaths.binary)
+    sys.realview.setupBootLoader(sys, SysPaths.binary, bootloader)
 
     return sys
 
@@ -203,6 +203,8 @@ def addOptions(parser):
                         help="System memory size")
     parser.add_argument("--kernel-cmd", type=str, default=None,
                         help="Custom Linux kernel command")
+    parser.add_argument("--bootloader", action="append",
+                        help="executable file that runs before the --kernel")
     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 "
@@ -239,7 +241,8 @@ def build(options):
                           options.bootscript,
                           options.machine_type,
                           disks=disks,
-                          mem_size=options.mem_size)
+                          mem_size=options.mem_size,
+                          bootloader=options.bootloader)
 
     root.system = system
     if options.kernel_cmd:
index e202d75130acabd33c1e6edb74484b0777449357..e747b1aab8f6329429cc8da63edeef0cf38a2754 100644 (file)
@@ -104,6 +104,7 @@ def build_test_system(np):
             ruby=options.ruby,
             security=options.enable_security_extensions,
             vio_9p=options.vio_9p,
+            bootloader=options.bootloader,
         )
         if options.enable_context_switch_stats_dump:
             test_sys.enable_context_switch_stats_dump = True