summaryrefslogtreecommitdiff
path: root/configs/common/CpuConfig.py
diff options
context:
space:
mode:
authorRadhika Jagtap <radhika.jagtap@ARM.com>2015-12-07 16:42:16 -0600
committerRadhika Jagtap <radhika.jagtap@ARM.com>2015-12-07 16:42:16 -0600
commit9bd5051b6022249f95364ef30b100b69ac7e7c37 (patch)
tree81ee5797338a1ed3660093dc600156e286c82a01 /configs/common/CpuConfig.py
parent8f1ca0a212ede0ecac1199027681f3c2ca9308db (diff)
downloadgem5-9bd5051b6022249f95364ef30b100b69ac7e7c37.tar.xz
config: Enable elastic trace capture and replay in se/fs
This patch adds changes to the configuration scripts to support elastic tracing and replay. The patch adds a command line option to enable elastic tracing in SE mode and FS mode. When enabled the Elastic Trace cpu probe is attached to O3CPU and a few O3 CPU parameters are tuned. The Elastic Trace probe writes out both instruction fetch and data dependency traces. The patch also enables configuring the TraceCPU to replay traces using the SE and FS script. The replay run is designed to resume from checkpoint using atomic cpu to restore state keeping it consistent with FS run flow. It then switches to TraceCPU to replay the input traces.
Diffstat (limited to 'configs/common/CpuConfig.py')
-rw-r--r--configs/common/CpuConfig.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 6b530623d..3220acecd 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -53,6 +53,7 @@ _cpu_aliases_all = [
("minor", "MinorCPU"),
("detailed", "DerivO3CPU"),
("kvm", ("ArmKvmCPU", "ArmV8KvmCPU", "X86KvmCPU")),
+ ("trace", "TraceCPU"),
]
# Filtered list of aliases. Only aliases for existing CPUs exist in
@@ -108,6 +109,30 @@ def cpu_names():
"""Return a list of valid CPU names."""
return _cpu_classes.keys() + _cpu_aliases.keys()
+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
+ # revisited when creating elastic traces for multi processor systems.
+ for cpu in cpu_list:
+ # Attach the elastic trace probe listener. Set the protobuf trace
+ # file names. Set the dependency window size equal to the cpu it
+ # is attached to.
+ cpu.traceListener = m5.objects.ElasticTrace(
+ instFetchTraceFile = options.inst_trace_file,
+ dataDepTraceFile = options.data_trace_file,
+ depWindowSize = 3 * cpu.numROBEntries)
+ # Make the number of entries in the ROB, LQ and SQ very
+ # large so that there are no stalls due to resource
+ # limitation as such stalls will get captured in the trace
+ # as compute delay. For replay, ROB, LQ and SQ sizes are
+ # modelled in the Trace CPU.
+ cpu.numROBEntries = 512;
+ cpu.LQEntries = 128;
+ cpu.SQEntries = 128;
+ else:
+ fatal("%s does not support data dependency tracing. Use a CPU model of"
+ " type or inherited from DerivO3CPU.", cpu_cls)
+
# The ARM detailed CPU is special in the sense that it doesn't exist
# in the normal object hierarchy, so we have to add it manually.
try: