configs: Add --with-pmu option to the simple Arm FS configs
Add an option to add a PMU to the CPUs in `starter_fs.py` and `baremetal.py`. By default PMUs will not be added. Also adds an `--arm-ppi-number` option. Each PMU will be connected to its core using the specified PPI. Change-Id: I9cfb5781f211338919550f2320a7133d88801f6a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69957 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
@@ -157,6 +157,11 @@ def create(args):
|
||||
workload_class = workloads.workload_list.get(args.workload)
|
||||
system.workload = workload_class(object_file, system)
|
||||
|
||||
if args.with_pmu:
|
||||
for cluster in system.cpu_cluster:
|
||||
interrupt_numbers = [args.pmu_ppi_number] * len(cluster)
|
||||
cluster.addPMUs(interrupt_numbers)
|
||||
|
||||
if args.exit_on_uart_eot:
|
||||
for uart in system.realview.uart:
|
||||
uart.end_on_eot = True
|
||||
@@ -182,6 +187,15 @@ def run(args):
|
||||
break
|
||||
|
||||
|
||||
def arm_ppi_arg(int_num: int) -> int:
|
||||
"""Argparse argument parser for valid Arm PPI numbers."""
|
||||
# PPIs (1056 <= int_num <= 1119) are not yet supported by gem5
|
||||
int_num = int(int_num)
|
||||
if 16 <= int_num <= 31:
|
||||
return int_num
|
||||
raise ValueError(f"{int_num} is not a valid Arm PPI number")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(epilog=__doc__)
|
||||
|
||||
@@ -257,6 +271,18 @@ def main():
|
||||
default="stdoutput",
|
||||
help="Destination for the Tarmac trace output. [Default: stdoutput]",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--with-pmu",
|
||||
action="store_true",
|
||||
help="Add a PMU to each core in the cluster.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--pmu-ppi-number",
|
||||
type=arm_ppi_arg,
|
||||
default=23,
|
||||
help="The number of the PPI to use to connect each PMU to its core. "
|
||||
"Must be an integer and a valid PPI number (16 <= int_num <= 31).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--exit-on-uart-eot",
|
||||
action="store_true",
|
||||
|
||||
@@ -177,6 +177,11 @@ def create(args):
|
||||
]
|
||||
system.workload.command_line = " ".join(kernel_cmd)
|
||||
|
||||
if args.with_pmu:
|
||||
for cluster in system.cpu_cluster:
|
||||
interrupt_numbers = [args.pmu_ppi_number] * len(cluster)
|
||||
cluster.addPMUs(interrupt_numbers)
|
||||
|
||||
return system
|
||||
|
||||
|
||||
@@ -198,6 +203,15 @@ def run(args):
|
||||
break
|
||||
|
||||
|
||||
def arm_ppi_arg(int_num: int) -> int:
|
||||
"""Argparse argument parser for valid Arm PPI numbers."""
|
||||
# PPIs (1056 <= int_num <= 1119) are not yet supported by gem5
|
||||
int_num = int(int_num)
|
||||
if 16 <= int_num <= 31:
|
||||
return int_num
|
||||
raise ValueError(f"{int_num} is not a valid Arm PPI number")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(epilog=__doc__)
|
||||
|
||||
@@ -272,6 +286,18 @@ def main():
|
||||
default="stdoutput",
|
||||
help="Destination for the Tarmac trace output. [Default: stdoutput]",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--with-pmu",
|
||||
action="store_true",
|
||||
help="Add a PMU to each core in the cluster.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--pmu-ppi-number",
|
||||
type=arm_ppi_arg,
|
||||
default=23,
|
||||
help="The number of the PPI to use to connect each PMU to its core. "
|
||||
"Must be an integer and a valid PPI number (16 <= int_num <= 31).",
|
||||
)
|
||||
parser.add_argument("--checkpoint", action="store_true")
|
||||
parser.add_argument("--restore", type=str, default=None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user