Andreas Sandberg has uploaded this change for review. ( https://gem5-review.googlesource.com/3946

Change subject: config, arm: Don't import timing models for missing CPUs
......................................................................

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 <[email protected]>
---
M configs/common/cores/arm/__init__.py
1 file changed, 7 insertions(+), 1 deletion(-)



diff --git a/configs/common/cores/arm/__init__.py b/configs/common/cores/arm/__init__.py
index 96388f7..582e6b8 100644
--- a/configs/common/cores/arm/__init__.py
+++ b/configs/common/cores/arm/__init__.py
@@ -43,6 +43,12 @@
 ]

 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

--
To view, visit https://gem5-review.googlesource.com/3946
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92bab62c989f433a8a4a7bf59207d9d81b3d19e1
Gerrit-Change-Number: 3946
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to