mem: Use beats_per_clock as the DDR data rate for DRAMPower
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Tue, 19 May 2020 16:25:32 +0000 (17:25 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Mon, 20 Jul 2020 11:47:01 +0000 (11:47 +0000)
commite50ab5a2ecb71e3c80bc8c85e1055f042f491967
tree6da883bb9ea671e35fef01830dc5d8b96aa3ecf9
parent0bd936d071b6ac053efc697b0a9880533f666693
mem: Use beats_per_clock as the DDR data rate for DRAMPower

The data rate is used by the drampower lib to estimate the power
consumption of the DRAM Core. Previously, we used the formula:

burst_cycles = divCeil(p->tBURST_MAX, p->tCK);
data_rate = p->burst_length / burst_cycles;

to derive the data_rate. However, under certain configurations this
formula computes the wrong result due to rounding errors. This patch
simplifies the way we derive the data_rate by passing the value of the
DRAM parameter beats_per_clock.

Change-Id: Ic8cd35bb4641d9c0a704675d2672a6fe4f4ec13e
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Wendy Elsasser <wendy.elsasser@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30056
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
src/mem/drampower.cc
src/mem/drampower.hh