configs: Do not assume bootmem is a System child
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 16 Oct 2019 12:08:28 +0000 (13:08 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 22 Oct 2019 10:24:54 +0000 (10:24 +0000)
As far as I can see bootmem is used in Arm systems only.

With

https://gem5-review.googlesource.com/c/public/gem5/+/21604

bootmem has been moved from system to system.realview.
This patch fix things by removing the assumption that the bootmem
SimObject lives under the system.
It is now trying to getattr a reference of the bootmem.
It is the ISA specific system builder's duty to bind the bootmem
reference (_bootmem) to the real bootmem object

Change-Id: I1e7405b5cb186de13c44bfd93fb4c8a1a5447f24
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22001
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/common/FSConfig.py
configs/example/fs.py
tests/configs/base_config.py

index fa383bb93f34b3377b0fa906692d6bbd60e3a7c1..1a4e3810b952d685c717ae48160846706a6be736 100644 (file)
@@ -236,6 +236,7 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
     # variable might have been an alias.
     machine_type = platform_class.__name__
     self.realview = platform_class()
+    self._bootmem = self.realview.bootmem
 
     if isinstance(self.realview, VExpress_EMM64):
         if os.path.split(mdesc.disk())[-1] == 'linux-aarch32-ael.img':
index 9216f704ca81b987175878f24c3ad86d2a6e55b1..c9273198b444d704199cc8ebbf437f001b0c9fc1 100644 (file)
@@ -149,7 +149,7 @@ def build_test_system(np):
         test_sys.kvm_vm = KvmVM()
 
     if options.ruby:
-        bootmem = getattr(test_sys, 'bootmem', None)
+        bootmem = getattr(test_sys, '_bootmem', None)
         Ruby.create_system(options, True, test_sys, test_sys.iobus,
                            test_sys._dma_ports, bootmem)
 
index 2bed5f66111279408278f753489b120172d16dfb..d79496d7c91de385c786e5710c8fa8c4b36a1653 100644 (file)
@@ -170,7 +170,7 @@ class BaseSystem(object):
             options.num_cpus = self.num_cpus
             options.num_dirs = 2
 
-            bootmem = getattr(system, 'bootmem', None)
+            bootmem = getattr(system, '_bootmem', None)
             Ruby.create_system(options, True, system, system.iobus,
                                system._dma_ports, bootmem)