Skip to content

Commit

Permalink
config: Discover CPU timing models based on target ISA
Browse files Browse the repository at this point in the history
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]>
Reviewed-on: https://gem5-review.googlesource.com/3947
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
  • Loading branch information
andysan committed Jul 28, 2017
1 parent 662d2cd commit dcb9334
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions configs/common/CpuConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,16 @@ def config_etrace(cpu_cls, cpu_list, options):
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

0 comments on commit dcb9334

Please sign in to comment.