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

Change subject: config: Discover CPU timing models based on target ISA
......................................................................

config: Discover CPU timing models based on target ISA

The CpuConfig helper currently assumes that all timing models live in
the cores.arm package. This ignores the potential mismatch between the
target ISA and the ISA assumptions made by the timing models.

Instead of unconditionally listing all CPU models in cores.arm, list
timing models from cores.generic and cores.${TARGET_ISA}. This ensures
that the listed timing models support the ISA that gem5 is targeting.

Change-Id: If6235af2118889638f56ac4151003f38edfe9485
Signed-off-by: Andreas Sandberg <[email protected]>
---
M configs/common/CpuConfig.py
1 file changed, 13 insertions(+), 4 deletions(-)



diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 731ba4f..327c431 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -114,7 +114,16 @@
 for name, cls in inspect.getmembers(m5.objects, is_cpu_class):
     _cpu_classes[name] = cls

-import cores.arm
-for mod_name, module in inspect.getmembers(cores.arm, inspect.ismodule):
-    for name, cls in inspect.getmembers(module, is_cpu_class):
-        _cpu_classes[name] = cls
+
+from m5.defines import buildEnv
+from importlib import import_module
+for package in [ "generic", buildEnv['TARGET_ISA']]:
+    try:
+        package = import_module(".cores." + package, package=__package__)
+    except ImportError:
+        # No timing models for this ISA
+        continue
+
+    for mod_name, module in inspect.getmembers(package, inspect.ismodule):
+        for name, cls in inspect.getmembers(module, is_cpu_class):
+            _cpu_classes[name] = cls

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6235af2118889638f56ac4151003f38edfe9485
Gerrit-Change-Number: 3947
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