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-05-31 15:59:08 +0800
commitdf8a5016d82e2c85e96f99eeff30d9a963cecffe (patch)
treed780d3710302c7835e295406df3ff2cd3b4c77e6 /configs/common/CpuConfig.py
parenta4c6e88d766858b675a7fd256df5a8b9a7e18ada (diff)
downloadgem5-df8a5016d82e2c85e96f99eeff30d9a963cecffe.tar.xz
invisispec-1.0 configs and exp script
import from original code: https://github.com/mjyan0720/InvisiSpec-1.0
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 f0d009e95..43539ee4d 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -100,6 +100,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