Richard Cooper has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69678?usp=email )

Change subject: cpu: Add CpuCluster method to allow querying the number of CPUs.
......................................................................

cpu: Add CpuCluster method to allow querying the number of CPUs.

Add a `__len__` method to `CpuCluster` to allow clients to query the
number of CPUs.

Change-Id: I6fe680423ed6fc301faaf75b8685b080a4774fef
---
M src/cpu/CpuCluster.py
1 file changed, 4 insertions(+), 1 deletion(-)



diff --git a/src/cpu/CpuCluster.py b/src/cpu/CpuCluster.py
index 31fdc49..42a7112 100644
--- a/src/cpu/CpuCluster.py
+++ b/src/cpu/CpuCluster.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2022 Arm Limited
+# Copyright (c) 2022-2023 Arm Limited
 # All rights reserved.
 #
 # The license below extends only to copyright in the software and shall
@@ -51,6 +51,9 @@
     def __iter__(self):
         return iter(self.cpus)

+    def __len__(self):
+        return len(self.cpus)
+
     def generate_cpus(self, cpu_type: "BaseCPU", num_cpus: int):
         """
         Instantiates the cpus within the cluster provided

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69678?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6fe680423ed6fc301faaf75b8685b080a4774fef
Gerrit-Change-Number: 69678
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Cooper <richard.coo...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to