configs: Isolate ISA related object lists
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Thu, 3 Oct 2019 20:39:41 +0000 (22:39 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Mon, 7 Oct 2019 13:08:22 +0000 (13:08 +0000)
Some objects are not compiled when using NULL ISA, and therefore
their object lists cannot exist.

Change-Id: I93ec576229916c892de50bb6c73cd602e18a3654
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21439
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/common/ObjectList.py

index c197439c51846bc83cc4322fb815afe34cae7cd0..8b3233fb58a2bd6fdca0f43b76ca5d12037174b8 100644 (file)
@@ -153,11 +153,11 @@ class CPUList(ObjectList):
                     self._is_obj_class):
                     self._sub_classes[name] = cls
 
-bp_list = ObjectList(m5.objects.BranchPredictor)
-cpu_list = CPUList(m5.objects.BaseCPU)
-hwp_list = ObjectList(m5.objects.BasePrefetcher)
-indirect_bp_list = ObjectList(m5.objects.IndirectPredictor)
-mem_list = ObjectList(m5.objects.AbstractMemory)
+bp_list = ObjectList(getattr(m5.objects, 'BranchPredictor', None))
+cpu_list = CPUList(getattr(m5.objects, 'BaseCPU', None))
+hwp_list = ObjectList(getattr(m5.objects, 'BasePrefetcher', None))
+indirect_bp_list = ObjectList(getattr(m5.objects, 'IndirectPredictor', None))
+mem_list = ObjectList(getattr(m5.objects, 'AbstractMemory', None))
 
 # Platform aliases. The platforms listed here might not be compiled,
 # we make sure they exist before we add them to the platform list.
@@ -165,7 +165,8 @@ _platform_aliases_all = [
     ("RealView_PBX", "RealViewPBX"),
     ("VExpress_GEM5", "VExpress_GEM5_V1"),
     ]
-platform_list = ObjectList(m5.objects.Platform, _platform_aliases_all)
+platform_list = ObjectList(getattr(m5.objects, 'Platform', None), \
+    _platform_aliases_all)
 
 def _subclass_tester(name):
     sub_class = getattr(m5.objects, name, None)