From f8652646e7dc6cdafce330afa2cdc120c2379d31 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Wed, 16 Feb 2022 14:28:12 +0100 Subject: [PATCH] Fix crash in command_utilization_plot --- DRAMSys/traceAnalyzer/scripts/metrics.py | 4 ++++ DRAMSys/traceAnalyzer/scripts/plots.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/DRAMSys/traceAnalyzer/scripts/metrics.py b/DRAMSys/traceAnalyzer/scripts/metrics.py index 0d00da20..4d05186e 100644 --- a/DRAMSys/traceAnalyzer/scripts/metrics.py +++ b/DRAMSys/traceAnalyzer/scripts/metrics.py @@ -49,6 +49,10 @@ def command_bus_utilisation_in_percent(connection): ON Phases.PhaseName = CommandLengths.Command """) result = cursor.fetchone()[0] + + if (result is None): + result = 0 + clk, _ = getClock(connection) traceEnd = getTraceEndTime(connection) cmdBusOccupied = result * clk diff --git a/DRAMSys/traceAnalyzer/scripts/plots.py b/DRAMSys/traceAnalyzer/scripts/plots.py index f1378a88..6b564ffe 100755 --- a/DRAMSys/traceAnalyzer/scripts/plots.py +++ b/DRAMSys/traceAnalyzer/scripts/plots.py @@ -488,6 +488,10 @@ def command_bus_utilisation_window(connection, tracePath, steps): cursor.execute(query_full, (left_limit, right_limit)) result = cursor.fetchone()[0] + + if (result is None): + result = 0 + cmdBusOccupied = result * clk time[i] = ((i * windowSize) - (windowSize / 2)) / 1000 # ps to ns