summaryrefslogtreecommitdiff
path: root/configs/example/arm
diff options
context:
space:
mode:
authorSherif Elhabbal <elhabbalsherif@gmail.com>2018-09-14 17:10:24 +0200
committerSherif Elhabbal <elhabbalsherif@gmail.com>2018-09-17 17:59:34 +0000
commit537d6874c89da93d9e415ca135dbe0ec3f132669 (patch)
treecdfb637008ca99b38a66b733c8c8d39458d5cb60 /configs/example/arm
parentb1cb96672a7e32dcf341cb665a5676f046125dd9 (diff)
downloadgem5-537d6874c89da93d9e415ca135dbe0ec3f132669.tar.xz
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 <elhabbalsherif@gmail.com> Change-Id: Idde43c8bcb10df9d44d20282eaf21ce87a9d3f58 Reviewed-on: https://gem5-review.googlesource.com/12684 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Anouk Van Laer <anouk.vanlaer@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'configs/example/arm')
-rw-r--r--configs/example/arm/fs_power.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/configs/example/arm/fs_power.py b/configs/example/arm/fs_power.py
index b27455f13..7b92c8db8 100644
--- a/configs/example/arm/fs_power.py
+++ b/configs/example/arm/fs_power.py
@@ -69,6 +69,25 @@ class CpuPowerModel(PowerModel):
CpuPowerOff(), # OFF
]
+class L2PowerOn(MathExprPowerModel):
+ # Example to report l2 Cache overall_accesses
+ # The estimated power is converted to Watt and will vary based on the size of the cache
+ dyn = "overall_accesses*0.000018000"
+ st = "(voltage * 3)/10"
+
+class L2PowerOff(MathExprPowerModel):
+ dyn = "0"
+ st = "0"
+
+class L2PowerModel(PowerModel):
+ # Choose a power model for every power state
+ pm = [
+ L2PowerOn(), # ON
+ L2PowerOff(), # CLK_GATED
+ L2PowerOff(), # SRAM_RETENTION
+ L2PowerOff(), # OFF
+ ]
+
def main():
parser = argparse.ArgumentParser(
@@ -90,6 +109,14 @@ def main():
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)