From 467b49992a2eee1cbf7a8d7c8b3d9333a1bba2dc Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Sat, 19 Oct 2019 15:10:04 +0200 Subject: [PATCH] configs: Fix undefined BaseCPU When using NULL ISA BaseCPU is undefined, and therefore the isinstance call generates a NameError. Change-Id: Ia4582606b775cdb20829966f8e312a333a55b6f3 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21959 Reviewed-by: Bobby R. Bruce Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- configs/common/FileSystemConfig.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py index a9c7c92a5..67e380193 100644 --- a/configs/common/FileSystemConfig.py +++ b/configs/common/FileSystemConfig.py @@ -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'): -- 2.30.2