Sherif Elhabbal has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/12684

Change subject: config, arm, power: Example to report the power for the L2 Cache
......................................................................

config, arm, power: Example to report the power for the L2 Cache

This patch add an example to demonstrate how to report the power for the L2
Cache of the big cluster separately ,it decouples the L2 contributions from
the CPU power equation

Signed-off-by: Sherif Elhabbal <[email protected]>
Change-Id: Idde43c8bcb10df9d44d20282eaf21ce87a9d3f58
---
M configs/example/arm/fs_power.py
1 file changed, 25 insertions(+), 0 deletions(-)



diff --git a/configs/example/arm/fs_power.py b/configs/example/arm/fs_power.py
index b27455f..debdd4d 100644
--- a/configs/example/arm/fs_power.py
+++ b/configs/example/arm/fs_power.py
@@ -69,6 +69,23 @@
         CpuPowerOff(), # OFF
     ]

+class L2PowerOn(MathExprPowerModel):
+    # Example to report l2 Cache overall_accesses
+    dyn = "overall_accesses"
+    st = "voltage * 2"
+
+class L2PowerOff(MathExprPowerModel):
+    dyn = "0"
+    st = "0"
+
+class L2PowerModel(PowerModel):
+    pm = [
+        L2PowerOn(), # ON
+        L2PowerOff(), # CLK_GATED
+        L2PowerOff(), # SRAM_RETENTION
+        L2PowerOff(), # OFF
+    ]
+

 def main():
     parser = argparse.ArgumentParser(
@@ -90,6 +107,14 @@
         cpu.default_p_state = "ON"
         cpu.power_model = CpuPowerModel()

+    # Example power model for the L2 Cache of the bigCluster
+    for l2 in root.system.bigCluster.l2.descendants():
+        if not isinstance(l2, m5.objects.Cache):
+            continue
+
+        l2.default_p_state = "ON"
+        l2.power_model = L2PowerModel()
+
     bL.instantiate(options)

     print("*" * 70)

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Idde43c8bcb10df9d44d20282eaf21ce87a9d3f58
Gerrit-Change-Number: 12684
Gerrit-PatchSet: 1
Gerrit-Owner: Sherif Elhabbal <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to