From 2235ccedc751ccd78ed742081290f8f2fb20ca85 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Thu, 28 Feb 2019 17:07:41 +0800 Subject: invisispec-1.0 configs --- configs/common/CpuConfig.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'configs/common/CpuConfig.py') 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 -- cgit v1.2.3