configs: Add Tarmac tracing option to the simple Arm configs

gem5 supports Tarmac trace generation for Arm simulations, but there
are no examples of how to use this feature.

This patch adds a `--tarmac-gen` option to three of the simple Arm
configs. Tarmac generation is useful for out-of-the-box users, and
this patch also provides an example of how to use the Tarmac
generation feature.

Change-Id: I0d3c523b5c0bb6d94de93bc502e4451622fb635d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69684
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Richard Cooper
2022-09-08 18:46:16 +01:00
parent 324ac185c8
commit a83f699f1d
4 changed files with 106 additions and 16 deletions

View File

@@ -106,6 +106,8 @@ class ArmCpuCluster(CpuCluster):
l1i_type,
l1d_type,
l2_type,
tarmac_gen=False,
tarmac_dest=None,
):
super().__init__()
self._cpu_type = cpu_type
@@ -122,6 +124,12 @@ class ArmCpuCluster(CpuCluster):
self.generate_cpus(cpu_type, num_cpus)
for cpu in self.cpus:
if tarmac_gen:
cpu.tracer = TarmacTracer()
if tarmac_dest is not None:
cpu.tracer.outfile = tarmac_dest
system.addCpuCluster(self)
def addL1(self):
@@ -177,23 +185,54 @@ class ArmCpuCluster(CpuCluster):
class AtomicCluster(ArmCpuCluster):
def __init__(self, system, num_cpus, cpu_clock, cpu_voltage="1.0V"):
cpu_config = [
ObjectList.cpu_list.get("AtomicSimpleCPU"),
None,
None,
None,
]
super().__init__(system, num_cpus, cpu_clock, cpu_voltage, *cpu_config)
def __init__(
self,
system,
num_cpus,
cpu_clock,
cpu_voltage="1.0V",
tarmac_gen=False,
tarmac_dest=None,
):
super().__init__(
system,
num_cpus,
cpu_clock,
cpu_voltage,
cpu_type=ObjectList.cpu_list.get("AtomicSimpleCPU"),
l1i_type=None,
l1d_type=None,
l2_type=None,
tarmac_gen=tarmac_gen,
tarmac_dest=tarmac_dest,
)
def addL1(self):
pass
class KvmCluster(ArmCpuCluster):
def __init__(self, system, num_cpus, cpu_clock, cpu_voltage="1.0V"):
cpu_config = [ObjectList.cpu_list.get("ArmV8KvmCPU"), None, None, None]
super().__init__(system, num_cpus, cpu_clock, cpu_voltage, *cpu_config)
def __init__(
self,
system,
num_cpus,
cpu_clock,
cpu_voltage="1.0V",
tarmac_gen=False,
tarmac_dest=None,
):
super().__init__(
system,
num_cpus,
cpu_clock,
cpu_voltage,
cpu_type=ObjectList.cpu_list.get("ArmV8KvmCPU"),
l1i_type=None,
l1d_type=None,
l2_type=None,
tarmac_gen=tarmac_gen,
tarmac_dest=tarmac_dest,
)
def addL1(self):
pass