From ce6fd7f084ad2f632f6d8486899a7328ea4d8f35 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 18 Dec 2023 06:08:49 +0000 Subject: [PATCH] configs: Fix SMT cpu type checking (#684) The args.cpu_type is not a type but a string so the isinstance checking will always fail and an assertion will always be thrown Change-Id: I6a88d1a514bb323c517949632f4e76be40e87e8c Signed-off-by: Giacomo Travaglini --- configs/common/ObjectList.py | 1 + configs/deprecated/example/se.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/common/ObjectList.py b/configs/common/ObjectList.py index 51b057f021..d36044e068 100644 --- a/configs/common/ObjectList.py +++ b/configs/common/ObjectList.py @@ -228,3 +228,4 @@ def _subclass_tester(name): is_kvm_cpu = _subclass_tester("BaseKvmCPU") is_noncaching_cpu = _subclass_tester("NonCachingSimpleCPU") +is_o3_cpu = _subclass_tester("BaseO3CPU") diff --git a/configs/deprecated/example/se.py b/configs/deprecated/example/se.py index 137dc030b7..afdb82489d 100644 --- a/configs/deprecated/example/se.py +++ b/configs/deprecated/example/se.py @@ -118,7 +118,8 @@ def get_processes(args): idx += 1 if args.smt: - assert isinstance(args.cpu_type, DerivO3CPU) + cpu_type = ObjectList.cpu_list.get(args.cpu_type) + assert ObjectList.is_o3_cpu(cpu_type), "SMT requires an O3CPU" return multiprocesses, idx else: return multiprocesses, 1