summaryrefslogtreecommitdiff
path: root/configs/common/CpuConfig.py
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-02-28 17:07:41 +0800
committerIru Cai <mytbk920423@gmail.com>2019-03-20 15:52:58 +0800
commite71c8ea0994ef1f450137a85b3e461a3400550ee (patch)
tree0bcb38ab37cf59915f6039ae75a07d03a19c3718 /configs/common/CpuConfig.py
parent2c99e0e616c61bb31c6902fb7d11e10042b5b210 (diff)
downloadgem5-e71c8ea0994ef1f450137a85b3e461a3400550ee.tar.xz
invisispec-1.0 configs
Diffstat (limited to 'configs/common/CpuConfig.py')
-rw-r--r--configs/common/CpuConfig.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 3f193ae60..653220528 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -88,6 +88,35 @@ def cpu_names():
"""Return a list of valid CPU names."""
return _cpu_classes.keys()
+# [InvisiSpec] add knob to configure the CPU modes/simulation schemes
+def config_scheme(cpu_cls, cpu_list, options):
+ if issubclass(cpu_cls, m5.objects.DerivO3CPU):
+ # Assign the same file name to all cpus for now.
+ if options.needsTSO==None or options.scheme==None:
+ fatal("Need to provide needsTSO and scheme "
+ "to run simulation with DerivO3CPU")
+
+ print("**********")
+ print("info: Configure for DerivO3CPU. needsTSO=%d; scheme=%s"\
+ % (options.needsTSO, options.scheme))
+ print("**********")
+ for cpu in cpu_list:
+ if options.needsTSO:
+ cpu.needsTSO = True
+ else:
+ cpu.needsTSO = False
+
+ if options.allowSpecBuffHit:
+ cpu.allowSpecBuffHit = True
+ else:
+ cpu.allowSpecBuffHit = False
+ if len(options.scheme)!=0:
+ cpu.simulateScheme = options.scheme
+ else:
+ print("not DerivO3CPU")
+
+
+
def config_etrace(cpu_cls, cpu_list, options):
if issubclass(cpu_cls, m5.objects.DerivO3CPU):
# Assign the same file name to all cpus for now. This must be