From 5d09ff452580c5a42b9a2b3a825e2827f2551003 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 18 Dec 2023 14:37:51 -0800 Subject: [PATCH] configs: Add `hasattr` guard to ensure DerivO3CPU compiled configs/ruby/Ruby.py fails when `DerivO3CPU` is not compiled into the gem5 binary. The `isinstance` check fails. This fix addds a guard. Change-Id: I1e5503ab18ec94683056c6eb28cebeda6632ae8e --- configs/ruby/Ruby.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index d3f798ec3a..b84a69a80f 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -331,8 +331,9 @@ def send_evicts(options): # 2. The x86 mwait instruction is built on top of coherence invalidations # 3. The local exclusive monitor in ARM systems - if isinstance(options.cpu_type, DerivO3CPU) or ObjectList.cpu_list.get_isa( - options.cpu_type - ) in [ISA.X86, ISA.ARM]: + if ( + hasattr(m5.objects, "DerivO3CPU") + and isinstance(options.cpu_type, DerivO3CPU) + ) or ObjectList.cpu_list.get_isa(options.cpu_type) in [ISA.X86, ISA.ARM]: return True return False