summaryrefslogtreecommitdiff
path: root/configs/common/cores
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-07-04 11:04:49 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-07-04 15:59:59 +0000
commit97187fa814167906ed168a02aad09ff6fd0ed17c (patch)
tree348ca378cb7ea51b7919b72ae237f174a8f6a98a /configs/common/cores
parent89530735d115578d7e88f1bba1f299becb1350ca (diff)
downloadgem5-97187fa814167906ed168a02aad09ff6fd0ed17c.tar.xz
config, arm: Don't import timing models for missing CPUs
When importing the cores.arm package, we currently throw an exception if a timing model can't be imported due to a missing dependency (e.g., the required CPU model wasn't included in the build). This is undesirable since it prevents other, working, timing models from being added to the package. Wrap the import_module call in a try-except block and skip timing models that have missing dependencies. Change-Id: I92bab62c989f433a8a4a7bf59207d9d81b3d19e1 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/3946 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'configs/common/cores')
-rw-r--r--configs/common/cores/arm/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/configs/common/cores/arm/__init__.py b/configs/common/cores/arm/__init__.py
index 96388f731..582e6b859 100644
--- a/configs/common/cores/arm/__init__.py
+++ b/configs/common/cores/arm/__init__.py
@@ -43,6 +43,12 @@ _cpu_modules = [
]
for c in _cpu_modules:
- import_module("." + c, package=__package__)
+ try:
+ import_module("." + c, package=__package__)
+ except NameError:
+ # Failed to import a CPU model due to a missing
+ # dependency. This typically happens if gem5 has been compiled
+ # without a CPU model needed by the timing model.
+ pass
__all__ = _cpu_modules