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
This commit is contained in:
Bobby R. Bruce
2023-12-18 14:37:51 -08:00
parent b42d9fabf7
commit 5d09ff4525

View File

@@ -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