diff --git a/DRAMSys/traceAnalyzer/scripts/plots.py b/DRAMSys/traceAnalyzer/scripts/plots.py index dc6def9f..e3c469a0 100755 --- a/DRAMSys/traceAnalyzer/scripts/plots.py +++ b/DRAMSys/traceAnalyzer/scripts/plots.py @@ -101,7 +101,7 @@ def plot(function): return function -@plot +#@plot def memory_utilisation_window(connection, tracePath, steps): # This function determines the average memory bandwidth over time in # percentage and in Gbit/s. The average bandwidth over time is done @@ -246,7 +246,7 @@ def queue_window(connection, tracePath, steps): return outputFile -@plot +#@plot def power_window(connection, tracePath, steps): windowSize = getWindowSize(connection) @@ -340,7 +340,7 @@ def latency_analysis(connection, tracePath, steps): return "none\n" -@plot +#@plot def latency_histogram(connection, tracePath, steps): # This function plots an histogram with access latencys diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 6acea07c..981e60fb 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -50,6 +50,8 @@ #include "qwt_scale_draw.h" #include "qwt_scale_widget.h" #include "qwt_legend.h" +#include "qwt_plot_magnifier.h" +#include "qwt_plot_panner.h" #include @@ -258,8 +260,92 @@ void TraceFileTab::on_startPowerAnalysis_clicked() data->setSamples(*samples); cur->setData(data); cur->attach(ui->powerPlot); + + QwtPlotMagnifier *mag1 = new QwtPlotMagnifier(ui->powerPlot->canvas()); + mag1->setAxisEnabled(QwtPlot::xBottom, true); + mag1->setAxisEnabled(QwtPlot::yLeft, false); + mag1->setWheelFactor(5); + QwtPlotPanner *pan1 = new QwtPlotPanner(ui->powerPlot->canvas()); + pan1->setAxisEnabled(QwtPlot::xBottom, true); + pan1->setAxisEnabled(QwtPlot::yLeft, false); + ui->powerPlot->replot(); // Bandwidth analysis: - // TODO + sql = "SELECT time, AverageBandwidth FROM Bandwidth;"; + query.exec(sql); + + QwtPointSeriesData * data2 = new QwtPointSeriesData; + QwtPlotCurve * cur2 = new QwtPlotCurve("Speed"); + QVector* samples2=new QVector; + + while (query.next()) { + double time = query.value(0).toDouble(); + double percentage = query.value(1).toDouble() * 100.0; + samples2->push_back(QPointF(time, percentage)); + } + + data2->setSamples(*samples2); + cur2->setData(data2); + cur2->attach(ui->bandwidthPlot); + + ui->bandwidthPlot->setAxisTitle(0,"Bandwidth [%]"); + ui->bandwidthPlot->setAxisScale(0,0.0,100.0); + QwtText axisTitle2( "Time [s]" ); + axisTitle2.setFont( ui->bandwidthPlot->axisTitle( QwtPlot::xBottom ).font() ); + ui->bandwidthPlot->setAxisTitle( QwtPlot::xBottom, axisTitle2 ); + + QwtPlotMagnifier *mag2 = new QwtPlotMagnifier(ui->bandwidthPlot->canvas()); + mag2->setAxisEnabled(QwtPlot::xBottom, true); + mag2->setAxisEnabled(QwtPlot::yLeft, false); + mag2->setWheelFactor(5); + QwtPlotPanner *pan2 = new QwtPlotPanner(ui->bandwidthPlot->canvas()); + pan2->setAxisEnabled(QwtPlot::xBottom, true); + pan2->setAxisEnabled(QwtPlot::yLeft, false); + + ui->bandwidthPlot->replot(); + + // Buffer analysis: + sql = "select max(BufferNumber) from BufferDepth;"; + query.exec(sql); + query.next(); + unsigned int numberOfBuffers = query.value(0).toUInt(); + + sql = "select MaxBufferDepth from GeneralInfo;"; + query.exec(sql); + query.next(); + unsigned int maxBufferDepth = query.value(0).toUInt(); + + sql = "select Time, AverageBufferDepth from BufferDepth where BufferNumber = 0"; // TODO + query.exec(sql); + + QwtPointSeriesData * data3 = new QwtPointSeriesData; + QwtPlotCurve * cur3 = new QwtPlotCurve("Speed"); + QVector* samples3 = new QVector; + + while (query.next()) { + double time = query.value(0).toDouble(); + double queue = query.value(1).toDouble(); + samples3->push_back(QPointF(time, queue)); + } + + data3->setSamples(*samples3); + cur3->setData(data3); + cur3->attach(ui->bufferPlot); + + ui->bufferPlot->setAxisTitle(0,"Buffer Utilization"); + ui->bufferPlot->setAxisScale(0,0.0, maxBufferDepth); + QwtText axisTitle3( "Time [s]" ); + axisTitle3.setFont( ui->bufferPlot->axisTitle( QwtPlot::xBottom ).font() ); + ui->bufferPlot->setAxisTitle( QwtPlot::xBottom, axisTitle3 ); + + QwtPlotMagnifier *mag3 = new QwtPlotMagnifier(ui->bufferPlot->canvas()); + mag3->setAxisEnabled(QwtPlot::xBottom, true); + mag3->setAxisEnabled(QwtPlot::yLeft, false); + mag3->setWheelFactor(5); + QwtPlotPanner *pan3 = new QwtPlotPanner(ui->bufferPlot->canvas()); + pan3->setAxisEnabled(QwtPlot::xBottom, true); + pan3->setAxisEnabled(QwtPlot::yLeft, false); + + ui->bufferPlot->replot(); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index b658ece7..182c410e 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -66,7 +66,7 @@ - 2 + 0 @@ -236,6 +236,13 @@ Power and Bandwidth Analysis + + + + Start Analysis + + + @@ -262,15 +269,20 @@ + + + + Buffer Analysis: + + + + + + + + - - - - Start Analysis - - -