configs: Fix undefined BaseCPU
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Sat, 19 Oct 2019 13:10:04 +0000 (15:10 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Mon, 28 Oct 2019 17:43:39 +0000 (17:43 +0000)
When using NULL ISA BaseCPU is undefined, and therefore the
isinstance call generates a NameError.

Change-Id: Ia4582606b775cdb20829966f8e312a333a55b6f3
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21959
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/FileSystemConfig.py

index a9c7c92a5a0fb2105f0f49b29368cb51862584e0..67e38019323d6ce156be68bd6956a5d2618d0f95 100644 (file)
@@ -77,7 +77,12 @@ def config_filesystem(system, options = None):
     procdir = joinpath(fsdir, 'proc')
     mkdir(procdir)
 
-    cpus = [obj for obj in system.descendants() if isinstance(obj, BaseCPU)]
+    try:
+        cpus = \
+            [obj for obj in system.descendants() if isinstance(obj, BaseCPU)]
+    except NameError:
+        # BaseCPU is not defined for the NULL ISA
+        cpus = []
 
     cpu_clock = 0
     if hasattr(options, 'cpu_clock'):