diff --git a/DRAMSys/traceAnalyzer/scripts/metrics.py b/DRAMSys/traceAnalyzer/scripts/metrics.py index a8e9f79e..6e451867 100644 --- a/DRAMSys/traceAnalyzer/scripts/metrics.py +++ b/DRAMSys/traceAnalyzer/scripts/metrics.py @@ -117,11 +117,15 @@ def memory_idle(connection): cursor = connection.cursor() cursor.execute(query) idle = cursor.fetchone() + + cursor.execute(""" SELECT min(PhaseBegin) FROM Phases WHERE PhaseName = 'REQ' """) + idle_start = cursor.fetchone() + clk, unit = getClock(connection) + if (idle[0] is None): - return 0 + return (idle_start[0] / clk) else: - clk, unit = getClock(connection) - return (idle[0]/clk) + return ((idle[0] + idle_start[0]) / clk) @metric def memory_delayed(connection):