From d705a36183aa1267c20671182fbe0363e4197238 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 23 Nov 2021 12:11:15 +0100 Subject: [PATCH 001/121] Testing new color configuration -- Refactored ColorGenerator and added HSV15. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../businessObjects/phases/phase.cpp | 2 +- .../presentation/util/colorgenerator.cpp | 89 ++------- .../presentation/util/colorgenerator.h | 21 +- .../presentation/util/colorobject.cpp | 179 ++++++++++++++++++ .../presentation/util/colorobject.h | 71 +++++++ 6 files changed, 286 insertions(+), 77 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp create mode 100644 DRAMSys/traceAnalyzer/presentation/util/colorobject.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 355a8c90..c703e713 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -68,6 +68,7 @@ add_executable(TraceAnalyzer data/tracedb.cpp presentation/tracenavigator.cpp presentation/util/colorgenerator.cpp + presentation/util/colorobject.cpp presentation/tracedrawing.cpp presentation/traceplotitem.cpp gototimedialog.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 15ec782a..55a7e0d0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -187,7 +187,7 @@ QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); break; case ColorGrouping::AlphaTransaction: - return ColorGenerator::getAlphaColored(transaction.lock()->id); + return ColorGenerator::getAlphaColored(transaction.lock()->id, ColorName::HSV15); break; case ColorGrouping::Transaction: diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index ae3070a6..11cf1023 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -38,79 +38,30 @@ #include "colorgenerator.h" #include -ColorGenerator::ColorGenerator() + +QColor ColorGenerator::getColor(unsigned int i, ColorName color) { - r[0] = 0xFF; - r[1] = 0x00; - r[2] = 0x00; - r[3] = 0xFF; - g[0] = 0x00; - g[1] = 0xFF; - g[2] = 0x00; - g[3] = 0xFF; - b[0] = 0x00; - b[1] = 0x00; - b[2] = 0xFF; - b[3] = 0x00; - - r[4] = 0xFF; - r[5] = 0x00; - r[6] = 0xFF; - r[7] = 0x6B; - g[4] = 0x00; - g[5] = 0xFF; - g[6] = 0xA5; - g[7] = 0x8E; - b[4] = 0xFF; - b[5] = 0xFF; - b[6] = 0x00; - b[7] = 0x23; - - r[8] = 0x8A; - r[9] = 0xFF; - r[10] = 0x7C; - r[11] = 0x00; - g[8] = 0x2B; - g[9] = 0xD7; - g[10] = 0xFC; - g[11] = 0x00; - b[8] = 0xE2; - b[9] = 0x00; - b[10] = 0x00; - b[11] = 0x80; - - r[12] = 0x80; - r[13] = 0x00; - r[14] = 0xEE; - r[15] = 0xFF; - g[12] = 0x00; - g[13] = 0x80; - g[14] = 0x82; - g[15] = 0x45; - b[12] = 0x00; - b[13] = 0x00; - b[14] = 0xEE; - b[15] = 0x00; + switch(color) { + case ColorName::Default: + return cDefault.getColor(i); + case ColorName::HSV15: + return cHSV15.getColor(i); + } + return {0, 0, 0}; } -QColor ColorGenerator::getColor(unsigned int i) +QColor ColorGenerator::getAlphaColored(unsigned int i, ColorName color) { - static ColorGenerator gen; - i = i % 16; - QColor result(gen.r[i], gen.g[i], gen.b[i]); - result.setAlpha(130); - return result; + switch(color) { + case ColorName::Default: + return cDefault.getAlphaColored(i); + case ColorName::HSV15: + return cHSV15.getAlphaColored(i); + } + + return {0, 0, 0}; } -QColor ColorGenerator::getAlphaColored(unsigned int i) -{ - static ColorGenerator gen; - const int minAlpha = 25; - const int alphaLevels = 40 - 255 / minAlpha; - int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); - i = (i / alphaLevels) % 16; - QColor result(gen.r[i], gen.g[i], gen.b[i]); - result.setAlpha(alpha); - return result; -} +ColorDefault ColorGenerator::cDefault; +ColorHSV15 ColorGenerator::cHSV15; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h index 35941474..7897393d 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h @@ -39,21 +39,28 @@ #ifndef COLORGENERATOR_H #define COLORGENERATOR_H +#include "colorobject.h" + #include #include +enum ColorName +{ + Default, + HSV15 +}; + class ColorGenerator { private: - static constexpr int NumberOfColors = 16; - int r[NumberOfColors]; - int g[NumberOfColors]; - int b[NumberOfColors]; - ColorGenerator(); + ColorGenerator() = delete; + + static ColorDefault cDefault; + static ColorHSV15 cHSV15; public: - static QColor getColor(unsigned int i); - static QColor getAlphaColored(unsigned int i); + static QColor getColor(unsigned int i, ColorName color = ColorName::Default); + static QColor getAlphaColored(unsigned int i, ColorName color = ColorName::Default); }; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp new file mode 100644 index 00000000..9f708e98 --- /dev/null +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2015, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + * Iron Prando da Silva + */ + +#include "colorobject.h" + + +QColor ColorObject::getColor(unsigned int i) +{ + i = i % numberOfColors; + QColor result(r[i], g[i], b[i]); + result.setAlpha(130); + return result; +} + +QColor ColorObject::getAlphaColored(unsigned int i) +{ + const int minAlpha = 50; + const int alphaLevels = 20 - 255 / minAlpha; + + int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); + i = (i / alphaLevels) % numberOfColors; + QColor result(r[i], g[i], b[i]); + result.setAlpha(alpha); + + return result; +} + +ColorDefault::ColorDefault() +{ + numberOfColors = 16; + + r.resize(numberOfColors); + g.resize(numberOfColors); + b.resize(numberOfColors); + + r[0] = 0xFF; + r[1] = 0x00; + r[2] = 0x00; + r[3] = 0xFF; + g[0] = 0x00; + g[1] = 0xFF; + g[2] = 0x00; + g[3] = 0xFF; + b[0] = 0x00; + b[1] = 0x00; + b[2] = 0xFF; + b[3] = 0x00; + + r[4] = 0xFF; + r[5] = 0x00; + r[6] = 0xFF; + r[7] = 0x6B; + g[4] = 0x00; + g[5] = 0xFF; + g[6] = 0xA5; + g[7] = 0x8E; + b[4] = 0xFF; + b[5] = 0xFF; + b[6] = 0x00; + b[7] = 0x23; + + r[8] = 0x8A; + r[9] = 0xFF; + r[10] = 0x7C; + r[11] = 0x00; + g[8] = 0x2B; + g[9] = 0xD7; + g[10] = 0xFC; + g[11] = 0x00; + b[8] = 0xE2; + b[9] = 0x00; + b[10] = 0x00; + b[11] = 0x80; + + r[12] = 0x80; + r[13] = 0x00; + r[14] = 0xEE; + r[15] = 0xFF; + g[12] = 0x00; + g[13] = 0x80; + g[14] = 0x82; + g[15] = 0x45; + b[12] = 0x00; + b[13] = 0x00; + b[14] = 0xEE; + b[15] = 0x00; +} + +ColorHSV15::ColorHSV15() +{ + numberOfColors = 15; + + r.resize(numberOfColors); + g.resize(numberOfColors); + b.resize(numberOfColors); + + r[0] = 0XFF; + r[1] = 0XFF; + r[2] = 0XFF; + r[3] = 0XD1; + r[4] = 0X6C; + r[5] = 0X08; + r[6] = 0X00; + r[7] = 0X00; + r[8] = 0X00; + r[9] = 0X00; + r[10] = 0X00; + r[11] = 0X54; + r[12] = 0XB9; + r[13] = 0XFF; + r[14] = 0XFF; + + g[0] = 0X00; + g[1] = 0X64; + g[2] = 0XC9; + g[3] = 0XFF; + g[4] = 0XFF; + g[5] = 0XFF; + g[6] = 0XFF; + g[7] = 0XFF; + g[8] = 0XD9; + g[9] = 0X74; + g[10] = 0X10; + g[11] = 0X00; + g[12] = 0X00; + g[13] = 0X00; + g[14] = 0X00; + + b[0] = 0X00; + b[1] = 0X00; + b[2] = 0X00; + b[3] = 0X00; + b[4] = 0X00; + b[5] = 0X00; + b[6] = 0X5C; + b[7] = 0XC1; + b[8] = 0XFF; + b[9] = 0XFF; + b[10] = 0XFF; + b[11] = 0XFF; + b[12] = 0XFF; + b[13] = 0XE1; + b[14] = 0X7C; +} diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h new file mode 100644 index 00000000..f54ee8f4 --- /dev/null +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + * Iron Prando da Silva + */ + +#pragma once + +#include + +class ColorObject +{ +protected: + int numberOfColors = 0; + + std::vector r; + std::vector g; + std::vector b; + // std::vector a; + + ColorObject() {}; + +public: + + virtual QColor getColor(unsigned int i); + virtual QColor getAlphaColored(unsigned int i); +}; + +class ColorDefault : public ColorObject +{ +public: + ColorDefault(); +}; + +class ColorHSV15 : public ColorObject +{ +public: + ColorHSV15(); +}; From 92c8e0c72c6a371d344907c53b2e4b2c07eff582 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 23 Nov 2021 13:22:09 +0100 Subject: [PATCH 002/121] Minor correction to alpha distribution equation. --- DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp index 9f708e98..a3e21ca8 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -51,8 +51,9 @@ QColor ColorObject::getAlphaColored(unsigned int i) { const int minAlpha = 50; const int alphaLevels = 20 - 255 / minAlpha; - - int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); + const int alphaStep = (255. - minAlpha) / alphaLevels; + + int alpha = minAlpha + (int)(alphaStep * (i % alphaLevels)); i = (i / alphaLevels) % numberOfColors; QColor result(r[i], g[i], b[i]); result.setAlpha(alpha); From 2f93773913b7ad7b4601e13bed88a3fdfab52d41 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 25 Nov 2021 14:05:14 +0100 Subject: [PATCH 003/121] Renamed 'Alpha Colored' to 'Rainbow Colored'. --- .../businessObjects/phases/phase.cpp | 4 ++-- .../presentation/tracedrawingproperties.h | 2 +- DRAMSys/traceAnalyzer/presentation/traceplot.cpp | 16 ++++++++-------- DRAMSys/traceAnalyzer/presentation/traceplot.h | 4 ++-- .../presentation/util/colorgenerator.cpp | 6 +++--- .../presentation/util/colorgenerator.h | 2 +- .../presentation/util/colorobject.cpp | 2 +- .../presentation/util/colorobject.h | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 55a7e0d0..42c9d66d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -186,8 +186,8 @@ QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const case ColorGrouping::Thread: return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); break; - case ColorGrouping::AlphaTransaction: - return ColorGenerator::getAlphaColored(transaction.lock()->id, ColorName::HSV15); + case ColorGrouping::RainbowTransaction: + return ColorGenerator::getRainbowColored(transaction.lock()->id, ColorName::HSV15); break; case ColorGrouping::Transaction: diff --git a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h index 2573606e..0b71ce48 100644 --- a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h +++ b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h @@ -57,7 +57,7 @@ enum class ColorGrouping PhaseType, Transaction, Thread, - AlphaTransaction + RainbowTransaction }; class TracePlot; diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index 7c93d29d..9389c5e5 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -147,10 +147,10 @@ void TracePlot::setUpActions() QObject::connect(setColorGroupingTransaction, SIGNAL(triggered()), this, SLOT(on_colorGroupingTransaction())); - setColorGroupingAlphaTransaction = new QAction("Group by Transaction - Alpha Colored", this); - addAction(setColorGroupingAlphaTransaction); - QObject::connect(setColorGroupingAlphaTransaction, SIGNAL(triggered()), this, - SLOT(on_colorGroupingAlphaTransaction())); + setColorGroupingRainbowTransaction = new QAction("Group by Transaction - Rainbow Colored", this); + addAction(setColorGroupingRainbowTransaction); + QObject::connect(setColorGroupingRainbowTransaction, SIGNAL(triggered()), this, + SLOT(on_colorGroupingRainbowTransaction())); setColorGroupingThread = new QAction("Group by Thread", this); addAction(setColorGroupingThread); @@ -222,7 +222,7 @@ void TracePlot::setUpContextMenu() QMenu *colorGroupingSubMenu = new QMenu("Group by", contextMenu); colorGroupingSubMenu->addActions( - {setColorGroupingPhase, setColorGroupingTransaction, setColorGroupingThread, setColorGroupingAlphaTransaction}); + {setColorGroupingPhase, setColorGroupingTransaction, setColorGroupingRainbowTransaction, setColorGroupingThread}); contextMenu->addMenu(colorGroupingSubMenu); dependenciesSubMenu = new QMenu("Show dependencies", contextMenu); @@ -586,10 +586,10 @@ void TracePlot::on_colorGroupingTransaction() replot(); } -void TracePlot::on_colorGroupingAlphaTransaction() +void TracePlot::on_colorGroupingRainbowTransaction() { - drawingProperties.colorGrouping = ColorGrouping::AlphaTransaction; - Q_EMIT(colorGroupingChanged(ColorGrouping::AlphaTransaction)); + drawingProperties.colorGrouping = ColorGrouping::RainbowTransaction; + Q_EMIT(colorGroupingChanged(ColorGrouping::RainbowTransaction)); replot(); } diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.h b/DRAMSys/traceAnalyzer/presentation/traceplot.h index c3ec388c..560b819f 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.h +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.h @@ -108,7 +108,7 @@ private Q_SLOTS: void on_colorGroupingPhase(); void on_colorGroupingTransaction(); void on_colorGroupingThread(); - void on_colorGroupingAlphaTransaction(); + void on_colorGroupingRainbowTransaction(); void on_goToTransaction(); void on_goToPhase(); void on_deselectAll(); @@ -181,7 +181,7 @@ private: QAction *setColorGroupingPhase; QAction *setColorGroupingTransaction; QAction *setColorGroupingThread; - QAction *setColorGroupingAlphaTransaction; + QAction *setColorGroupingRainbowTransaction; QAction *exportToPdf; ToggleCollapsedAction *toggleCollapsedState; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index 11cf1023..c42339f5 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -51,13 +51,13 @@ QColor ColorGenerator::getColor(unsigned int i, ColorName color) return {0, 0, 0}; } -QColor ColorGenerator::getAlphaColored(unsigned int i, ColorName color) +QColor ColorGenerator::getRainbowColored(unsigned int i, ColorName color) { switch(color) { case ColorName::Default: - return cDefault.getAlphaColored(i); + return cDefault.getRainbowColored(i); case ColorName::HSV15: - return cHSV15.getAlphaColored(i); + return cHSV15.getRainbowColored(i); } return {0, 0, 0}; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h index 7897393d..e1e98ec0 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h @@ -60,7 +60,7 @@ private: public: static QColor getColor(unsigned int i, ColorName color = ColorName::Default); - static QColor getAlphaColored(unsigned int i, ColorName color = ColorName::Default); + static QColor getRainbowColored(unsigned int i, ColorName color = ColorName::Default); }; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp index a3e21ca8..a9a4e82b 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -47,7 +47,7 @@ QColor ColorObject::getColor(unsigned int i) return result; } -QColor ColorObject::getAlphaColored(unsigned int i) +QColor ColorObject::getRainbowColored(unsigned int i) { const int minAlpha = 50; const int alphaLevels = 20 - 255 / minAlpha; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h index f54ee8f4..d3ec584c 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h @@ -55,7 +55,7 @@ protected: public: virtual QColor getColor(unsigned int i); - virtual QColor getAlphaColored(unsigned int i); + virtual QColor getRainbowColored(unsigned int i); }; class ColorDefault : public ColorObject From da63d2670e019985883b2f945812728e8c0fcf9b Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 14:44:35 +0100 Subject: [PATCH 004/121] Began adding base algorithm for dependency calculations. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../phasedependenciestracker.cpp | 134 ++++++++++++++++++ .../phasedependenciestracker.h | 45 ++++++ .../businessObjects/phases/phasedependency.h | 4 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 12 +- DRAMSys/traceAnalyzer/data/tracedb.h | 3 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 20 +++ DRAMSys/traceAnalyzer/tracefiletab.h | 1 + DRAMSys/traceAnalyzer/tracefiletab.ui | 9 ++ 9 files changed, 222 insertions(+), 7 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index c703e713..cdea25c1 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -91,6 +91,7 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp + businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp new file mode 100644 index 00000000..715eed86 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -0,0 +1,134 @@ + +#include "phasedependenciestracker.h" + +void +PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector& commands) { + mDropTable(tdb); + mCreateTable(tdb); + + auto& phases = mGetAllPhases(tdb, commands); + + auto& entries = mCalculateDependencies(phases); + + mInsertIntoTable(tdb, entries); + +} + +void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { + QString command = "DROP TABLE DirectDependencies; "; + + auto query = mExecuteQuery(tdb, command); + query.finish(); +} + +void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { + QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID, DependencyPhaseName ); "; + + auto query = mExecuteQuery(tdb, command); + query.finish(); +} + +void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { + auto numberOfEntries = entries.size(); + size_t bulkInsertionSize = 1000; + + QString command; + size_t counter = 0; + for (auto& entry : entries) { + if (counter == 0) { + // TODO Reset command string and add first command + command = ""; + + } else if (counter == bulkInsertionSize) { + // TODO Write last command and submit + + counter = 0; + + } else { + // TODO + + counter++; + + } + + } + + if (counter != 0) { + // TODO Submit command string + } + +} + +const std::vector> +PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { + std::vector> phases; + + QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " + " FROM Phases " + " INNER JOIN Transactions " + " ON Phases.Transact=Transactions.ID " + " WHERE PhaseName IN ("; + + for (auto cmd : commands) { + queryStr += '\"' + QString::fromStdString(cmd + "\","); + } + queryStr.back() = ')'; + queryStr += " ORDER BY PhaseBegin "; + + auto query = mExecuteQuery(tdb, queryStr); + + if (!query.last()) { + throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" + "Could not retrieve number of rows\n").toStdString(), + tdb.pathToDB.toStdString()); + } + + size_t nrows = query.at() + 1; + + if (!query.first()) { + throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" + "Could not safely retrieve number of rows\n").toStdString(), + tdb.pathToDB.toStdString()); + } + + phases.resize(nrows); + + size_t rowIt = 0; + do { + DBPhaseEntry phase; + phase.id = query.value(0).toLongLong(); + phase.phaseName = query.value(1).toString(); + phase.phaseBegin = query.value(2).toLongLong(); + phase.phaseEnd = query.value(3).toLongLong(); + phase.transact = query.value(4).toLongLong(); + phase.tBank = query.value(5).toLongLong(); + phase.tRank = query.value(6).toLongLong(); + + phases[rowIt] = std::make_shared(phase); + ++rowIt; + } while (query.next()); + + if (rowIt != nrows) { + throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); + } + + return phases; +} + +const std::vector +PhaseDependenciesTracker::mCalculateDependencies(const std::vector>& transactions) { + std::vector entries; + + // TODO Get dependency object for specific trace + // TODO Main dependency calculation loop + + return entries; +} + +QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString queryStr) { + QSqlQuery query(tdb.getDatabase()); + query.prepare(queryStr); + tdb.executeQuery(query); + + return query; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h new file mode 100644 index 00000000..fcfe7021 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -0,0 +1,45 @@ + +#pragma once + +#include +#include +#include + +#include "data/tracedb.h" + +struct DBPhaseEntry { + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; + size_t tRank; +}; + +struct DBDependencyEntry { + size_t delayedPhaseID; + QString delayedPhaseName; + QString dependencyType; + QString timeDependency; + size_t dependencyPhaseID; + QString dependencyPhaseName; +}; + +class PhaseDependenciesTracker { +public: + static void calculateDependencies(TraceDB& tdb, const std::vector& commands); + +private: + static void mDropTable(TraceDB& tdb); + static void mCreateTable(TraceDB& tdb); + static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); + + static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::vector>& phases); + + static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); + + PhaseDependenciesTracker() = delete; + ~PhaseDependenciesTracker() = delete; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index 41be1c1e..fa203556 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -48,8 +48,8 @@ class Phase; enum DependencyType { - Bank, - Rank, + IntraBank, + IntraRank, InterRank }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 98fa0978..0bf0bf42 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -152,10 +152,12 @@ vector> TraceDB::getTransactionsInTimespan(const Timespa bool TraceDB::checkDependencyTableExists() { executeQuery(checkDependenciesExist); - if (checkDependenciesExist.next() && checkDependenciesExist.value(0).toInt() == 1) - return true; - return false; + bool exists = checkDependenciesExist.next() && checkDependenciesExist.value(0).toInt() == 1; + + checkDependenciesExist.finish(); + + return exists; } void TraceDB::updateDependenciesInTimespan(const Timespan &span) @@ -505,11 +507,11 @@ void TraceDB::mUpdateDependenciesFromQuery(QSqlQuery &query) QString dependencyTypeStr = query.value(2).toString(); if (dependencyTypeStr == "bank") { - type = DependencyType::Bank; + type = DependencyType::IntraBank; } else if (dependencyTypeStr == "rank") { - type = DependencyType::Rank; + type = DependencyType::IntraRank; } else if (dependencyTypeStr == "interRank") { diff --git a/DRAMSys/traceAnalyzer/data/tracedb.h b/DRAMSys/traceAnalyzer/data/tracedb.h index 525824b8..e6450f8e 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.h +++ b/DRAMSys/traceAnalyzer/data/tracedb.h @@ -151,6 +151,9 @@ private: unsigned int getLengthOfCommandFromDB(const std::string& command); std::map> _visiblePhases; // Updated at parseTransactionsFromQuery + + // At businessObjects/phasedependenciestracker.h + friend class PhaseDependenciesTracker; }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 8135e0f8..7f060bfb 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -42,6 +42,7 @@ #include "businessObjects/commentmodel.h" #include "businessObjects/configmodels.h" #include "businessObjects/pythoncaller.h" +#include "businessObjects/phasedependenciestracker.h" #include "presentation/traceselector.h" #include "qmessagebox.h" #include "queryeditor.h" @@ -303,6 +304,25 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } } +void TraceFileTab::on_calculateDependencies_clicked() { + // TODO - anything else? Update view maybe? + // TODO - For now fixed, but must be selectable + std::vector commands = { + "ACT", + "PRE", + "RD", + "RDA", + "WR", + "WRA", + "PDE", + "PDX", + "PREA" + }; + + PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), commands); + +} + void TraceFileTab::on_startLatencyAnalysis_clicked() { // Setup Database: diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index a3dd8d43..fdd0374e 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -110,6 +110,7 @@ Q_SIGNALS: private Q_SLOTS: void on_latencyTreeView_doubleClicked(const QModelIndex &index); + void on_calculateDependencies_clicked(); void on_startLatencyAnalysis_clicked(); void on_startPowerAnalysis_clicked(); }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index 22a0a210..f2cac71d 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -208,6 +208,13 @@ Dependency Information + + + + Calculate Dependencies + + + @@ -247,6 +254,7 @@ + @@ -295,6 +303,7 @@ + true From 4219d1832dc023eafae452bd14afc6d09b3d9a85 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 16:56:52 +0100 Subject: [PATCH 005/121] Began adding time dependencies interface for to be generated code. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../timedependenciesIF.cpp | 85 +++++++++++++++++++ .../dramTimeDependencies/timedependenciesIF.h | 44 ++++++++++ 3 files changed, 130 insertions(+) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index cdea25c1..ab6f8302 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -95,6 +95,7 @@ add_executable(TraceAnalyzer businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp + businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp new file mode 100644 index 00000000..89cb4052 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -0,0 +1,85 @@ + +#include "timedependenciesIF.h" + +#include + +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { + mGetMemspec(tdb); + +} + +QMap +DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { + QMap dependenciesMap; + + dependenciesMap = mSpecializedGetDependencies(); + + mFilterDependencyMap(dependenciesMap, commands); + + auto it = dependenciesMap.begin(); + while (it != dependenciesMap.end()) { + mFilterDependencyList(it.value().dependencies, commands); + it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + } + + return dependenciesMap; +} + +void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT Memspec FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + QString memSpecJson = sqlQuery.value(0).toString(); + sqlQuery.finish(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + mMemspecJson = jsonDocument.object()["memspec"].toObject(); + +} + +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { + std::vector newDepList(dependencyList.size()); + + std::copy_if( + dependencyList.begin(), + dependencyList.end(), + newDepList.begin(), + [ commands ](const TimeDependency& dep) { + return dep.phaseDep == "NAW" + || ( + std::find_if( + commands.begin(), + commands.end(), + [ dep ](const QString& cmd) { + return dep.phaseDep == cmd; + } + ) != commands.end() ) + ; + } + ); + + newDepList.shrink_to_fit(); + + dependencyList = newDepList; + +} + +void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { + // TODO +} + +size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { + auto maxElement = std::max_element( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& dep1, const TimeDependency& dep2) { + return dep1.timeValue < dep2.timeValue; + } + ); + + if (maxElement == dependencyList.end()) return 0; + + return maxElement->timeValue; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h new file mode 100644 index 00000000..7234090d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -0,0 +1,44 @@ + +#pragma once + +#include +#include +#include +#include + +#include "data/tracedb.h" +#include "businessObjects/phases/phasedependency.h" + +struct TimeDependency { + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; +}; + +struct PhaseTimeDependencies { + QString phaseName; + std::vector dependencies; + size_t maxTime; +}; + +class DRAMTimeDependenciesIF { +public: + DRAMTimeDependenciesIF(const TraceDB& tdb); + virtual ~DRAMTimeDependenciesIF() = default; + + QMap getDependencies(const std::vector& commands) const; + +protected: + void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; + void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + size_t mFindVectorMaximum(const std::vector& dependencyList) const; + +protected: + QJsonObject mMemspecJson; + virtual void mInitializeValues() = 0; + virtual QMap mSpecializedGetDependencies() const = 0; + +private: + void mGetMemspec(const TraceDB& tdb); +}; From 71e98adbda48004bdb5c67d55bf971bb4af8162e Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 12:43:19 +0100 Subject: [PATCH 006/121] Finished interface class for auto-generated time dependencies code. --- .../timedependenciesIF.cpp | 88 ++++++++++++++----- .../dramTimeDependencies/timedependenciesIF.h | 15 ++-- .../phasedependenciestracker.cpp | 5 +- DRAMSys/traceAnalyzer/tracefiletab.cpp | 7 +- 4 files changed, 84 insertions(+), 31 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 89cb4052..8f6c8c7f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,18 +8,26 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -QMap -DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { - QMap dependenciesMap; +std::map +DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { + std::map dependenciesMap; + + std::sort( + dependencyFilter.begin(), + dependencyFilter.end(), + [](const QString& s1, const QString& s2) { + return s1.compare(s2); + } + ); dependenciesMap = mSpecializedGetDependencies(); - mFilterDependencyMap(dependenciesMap, commands); + mFilterDependencyMap(dependenciesMap, dependencyFilter); auto it = dependenciesMap.begin(); while (it != dependenciesMap.end()) { - mFilterDependencyList(it.value().dependencies, commands); - it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + mFilterDependencyList(it->second.dependencies, dependencyFilter); + it->second.maxTime = mFindVectorMaximum(it->second.dependencies); } return dependenciesMap; @@ -39,24 +47,26 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); std::copy_if( dependencyList.begin(), dependencyList.end(), newDepList.begin(), - [ commands ](const TimeDependency& dep) { - return dep.phaseDep == "NAW" - || ( - std::find_if( - commands.begin(), - commands.end(), - [ dep ](const QString& cmd) { - return dep.phaseDep == cmd; - } - ) != commands.end() ) - ; + [ dependencyFilter ](const TimeDependency& dep) { + auto it = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dep.phaseDep, + [](const QString& cmd, const QString& value) { + return value.compare(cmd); + } + ); + + if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; + + return false; } ); @@ -66,8 +76,46 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { - // TODO +void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { + if (!dependencyMap.empty()) { + + auto itFilter = dependencyFilter.begin(); + auto itFilterLast = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dependencyMap.rbegin()->first + ); + + auto itDependencyMap = dependencyMap.begin(); + + while (true) { + + auto pair = std::mismatch( + itFilter, + itFilterLast, + itDependencyMap, + [](const QString& cmd, const std::pair& vpair) { + return cmd == vpair.first; + } + ); + + if (pair.first == dependencyFilter.end() || pair.second == dependencyMap.end()) { + dependencyMap.erase(pair.second, dependencyMap.end()); + break; + + } else if (pair.first->compare(pair.second->first) < 0) { + ++(pair.first); + + } else { + pair.second = dependencyMap.erase(pair.second); + + } + + itFilter = pair.first; + itDependencyMap = pair.second; + + } + } } size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 7234090d..2d0c657f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "data/tracedb.h" @@ -27,17 +27,20 @@ public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - QMap getDependencies(const std::vector& commands) const; + std::map getDependencies(std::vector& dependencyFilter) const; protected: - void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; - void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; - + protected: QJsonObject mMemspecJson; + +// To be implemented +protected: virtual void mInitializeValues() = 0; - virtual QMap mSpecializedGetDependencies() const = 0; + virtual std::map mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 715eed86..667a046d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -29,12 +29,13 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { + static const size_t bulkInsertionSize = 1000; + auto numberOfEntries = entries.size(); - size_t bulkInsertionSize = 1000; QString command; size_t counter = 0; - for (auto& entry : entries) { + for (const auto& entry : entries) { if (counter == 0) { // TODO Reset command string and add first command command = ""; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 7f060bfb..f25587bd 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -307,7 +307,7 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) void TraceFileTab::on_calculateDependencies_clicked() { // TODO - anything else? Update view maybe? // TODO - For now fixed, but must be selectable - std::vector commands = { + std::vector dependencyFilter = { "ACT", "PRE", "RD", @@ -316,10 +316,11 @@ void TraceFileTab::on_calculateDependencies_clicked() { "WRA", "PDE", "PDX", - "PREA" + "PREA", + "NAW" }; - PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), commands); + PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); } From f6b84b19b994ff6705e2603afa3fa0bc361639de Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 13:29:06 +0100 Subject: [PATCH 007/121] Added stl map QString comparator. --- .../timedependenciesIF.cpp | 22 +++++++++++-------- .../dramTimeDependencies/timedependenciesIF.h | 16 +++++++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 8f6c8c7f..692c87c4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,16 +8,14 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -std::map +DependencyMap DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { - std::map dependenciesMap; + DependencyMap dependenciesMap; std::sort( dependencyFilter.begin(), dependencyFilter.end(), - [](const QString& s1, const QString& s2) { - return s1.compare(s2); - } + QStringsComparator::compareQStrings ); dependenciesMap = mSpecializedGetDependencies(); @@ -59,9 +57,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - [](const QString& cmd, const QString& value) { - return value.compare(cmd); - } + QStringsComparator::compareQStrings ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -76,7 +72,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -131,3 +127,11 @@ size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vectortimeValue; } + +bool QStringsComparator::operator()(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} + +bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 2d0c657f..a9bbde13 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -22,16 +22,24 @@ struct PhaseTimeDependencies { size_t maxTime; }; + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2); + static bool compareQStrings(const QString& s1, const QString& s2); +}; + +typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - std::map getDependencies(std::vector& dependencyFilter) const; + DependencyMap getDependencies(std::vector& dependencyFilter) const; protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; - void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; protected: @@ -40,8 +48,10 @@ protected: // To be implemented protected: virtual void mInitializeValues() = 0; - virtual std::map mSpecializedGetDependencies() const = 0; + virtual DependencyMap mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); + }; + From 5c71da1afe990342c62ac1fcdab13d3b48202694 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 15:50:26 +0100 Subject: [PATCH 008/121] Started adding manual code for DDR3 time dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 7 +- .../DDR3TimeDependencies.cpp | 80 +++++++++++++++++++ .../DDR3TimeDependencies.h | 59 ++++++++++++++ ...nciesIF.cpp => dramtimedependenciesIF.cpp} | 21 +++-- ...endenciesIF.h => dramtimedependenciesIF.h} | 20 +++-- .../dramtimedependencyfactory.cpp | 17 ++++ .../dramtimedependencyfactory.h | 15 ++++ .../phasedependenciestracker.cpp | 6 +- .../phasedependenciestracker.h | 3 +- 9 files changed, 209 insertions(+), 19 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{timedependenciesIF.cpp => dramtimedependenciesIF.cpp} (85%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{timedependenciesIF.h => dramtimedependenciesIF.h} (72%) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index ab6f8302..7b84d13f 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -91,11 +91,9 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp - businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp - businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp @@ -104,6 +102,11 @@ add_executable(TraceAnalyzer businessObjects/configmodels.cpp businessObjects/commentmodel.cpp + businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp + businessObjects/phasedependenciestracker.cpp + selectmetrics.ui preferences.ui evaluationtool.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp new file mode 100644 index 00000000..e1e375cf --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -0,0 +1,80 @@ + +#include "DDR3TimeDependencies.h" + +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTimeDependenciesIF(memspec) { + mInitializeValues(); +} + +void DDR3TimeDependencies::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toLongLong(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toLongLong(); + clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toLongLong(); + + nActivateWindow = 4; + + tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toLongLong(); + tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toLongLong(); + tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toLongLong(); + tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toLongLong(); + tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toLongLong(); + tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toLongLong(); + tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toLongLong(); + tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toLongLong(); + tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toLongLong(); + tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toLongLong(); + tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toLongLong(); + tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toLongLong(); + tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toLongLong(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toLongLong(); + tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toLongLong(); + tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toLongLong(); + tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toLongLong(); + tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toLongLong(); + tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toLongLong(); + tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toLongLong(); + tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toLongLong(); + tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toLongLong(); + tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toLongLong(); + tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toLongLong(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + + tPD = tCKE; + tBURST = (int) ((burstLength / dataRate) * clk); + tRDWR = tRL + tBURST + 2 * clk - tWL; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tBURST + tWTR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tWRPRE = tWL + tBURST + tWR; + tRDPDEN = tRL + tBURST + clk; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + clk; +} + +DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("ACT"), + std::forward_as_tuple( + std::initializer_list{ + TimeDependency{tRC, "ACT", DependencyType::IntraBank, "tRC"}, + TimeDependency{tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + TimeDependency{tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + TimeDependency{tRP, "PRE", DependencyType::IntraBank, "tRP"}, + TimeDependency{tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + TimeDependency{tRP, "PREA", DependencyType::IntraRank, "tRP"}, + TimeDependency{tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + TimeDependency{tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + TimeDependency{tRFC, "REFA", DependencyType::IntraRank, "tRFC"}, + TimeDependency{tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + TimeDependency{tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + } + ) + ); + + // TODO add all the rest + + return dmap; +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h new file mode 100644 index 00000000..793b50f1 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -0,0 +1,59 @@ + +#pragma once + +#include "dramtimedependenciesIF.h" + +class DDR3TimeDependencies : public DRAMTimeDependenciesIF { +public: + DDR3TimeDependencies(const QJsonObject& memspec); + +protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + +protected: + size_t burstLength; + size_t dataRate; + size_t clk; + + size_t nActivateWindow; + + size_t tRP; + size_t tRAS; + size_t tRC; + size_t tRTP; + size_t tRRD; + size_t tCCD; + size_t tRCD; + size_t tNAW; + size_t tRL; + size_t tWL; + size_t tWR; + size_t tWTR; + size_t tCKESR; + size_t tCKE; + size_t tXP; + size_t tXPDLL; + size_t tXS; + size_t tXSDLL; + size_t tAL; + size_t tRFC; + size_t tREFI; + size_t tRTRS; + + size_t tACTPDEN; + size_t tPRPDEN; + size_t tREFPDEN; + + size_t tPD; + size_t tBURST; + size_t tRDWR; + size_t tRDWR_R; + size_t tWRRD; + size_t tWRRD_R; + size_t tWRPRE; + size_t tRDPDEN; + size_t tWRPDEN; + size_t tWRAPDEN; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp similarity index 85% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 692c87c4..c740a801 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -1,10 +1,10 @@ -#include "timedependenciesIF.h" +#include "dramtimedependenciesIF.h" #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { - mGetMemspec(tdb); +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec) { + mMemspecJson = memspec; } @@ -31,7 +31,7 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); @@ -41,13 +41,16 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { sqlQuery.finish(); QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); - mMemspecJson = jsonDocument.object()["memspec"].toObject(); + return jsonDocument.object()["memspec"].toObject(); } void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); + // TODO - probably there is a smarter way to filter these values, + // although the lists are not to be greater than 20-50 elements + std::copy_if( dependencyList.begin(), dependencyList.end(), @@ -70,6 +73,14 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList = newDepList; + std::sort( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& v1, const TimeDependency& v2) { + return v1.timeValue < v2.timeValue; + } + ); + } void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h similarity index 72% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index a9bbde13..7071ef84 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -4,6 +4,10 @@ #include #include #include + +#include +#include +#include #include #include "data/tracedb.h" @@ -17,7 +21,8 @@ struct TimeDependency { }; struct PhaseTimeDependencies { - QString phaseName; + explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} + std::vector dependencies; size_t maxTime; }; @@ -32,11 +37,13 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const TraceDB& tdb); + DRAMTimeDependenciesIF(const QJsonObject& memspec); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; + static const QJsonObject getMemspec(const TraceDB& tdb); + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; @@ -45,13 +52,10 @@ protected: protected: QJsonObject mMemspecJson; -// To be implemented +// To be implemented by the specializing class protected: - virtual void mInitializeValues() = 0; - virtual DependencyMap mSpecializedGetDependencies() const = 0; - -private: - void mGetMemspec(const TraceDB& tdb); + virtual void mInitializeValues() {} ; + virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp new file mode 100644 index 00000000..f9c72c91 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -0,0 +1,17 @@ + +#include "dramtimedependencyfactory.h" + +DRAMTimeDependenciesIF DRAMTimeDependencyFactory::make(const TraceDB& tdb) { + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); + QString deviceType = memspec["memspec"]["memoryType"].toString(); + + if (deviceType == "DDR3") { + return DDR3TimeDependencies(memspec); + + } else { + // TODO maybe throw? + return DRAMTimeDependenciesIF(memspec); + + } + +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h new file mode 100644 index 00000000..d6232ffe --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -0,0 +1,15 @@ + +#pragma once + +#include "dramtimedependenciesIF.h" +#include "DDR3TimeDependencies.h" +#include "data/tracedb.h" + +class DRAMTimeDependencyFactory { +public: + static DRAMTimeDependenciesIF make(const TraceDB& tdb); + +private: + DRAMTimeDependencyFactory() = delete; + ~DRAMTimeDependencyFactory() = delete; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 667a046d..984a8886 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -8,7 +8,7 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector< auto& phases = mGetAllPhases(tdb, commands); - auto& entries = mCalculateDependencies(phases); + auto& entries = mCalculateDependencies(tdb, phases); mInsertIntoTable(tdb, entries); @@ -117,10 +117,10 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const std::vector>& transactions) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& transactions) { std::vector entries; - // TODO Get dependency object for specific trace + DRAMTimeDependenciesIF deviceDependencies = DRAMTimeDependencyFactory::make(tdb); // TODO Main dependency calculation loop return entries; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index fcfe7021..a46d6c05 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -6,6 +6,7 @@ #include #include "data/tracedb.h" +#include "dramTimeDependencies/dramtimedependencyfactory.h" struct DBPhaseEntry { size_t id; @@ -36,7 +37,7 @@ private: static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const std::vector>& phases); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); From 866d1f476511a2d7c83e47e21775426dfe1605a6 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 11:07:21 +0100 Subject: [PATCH 009/121] Added DDR3 time dependencies code manually. --- .../DDR3TimeDependencies.cpp | 210 ++++++++++++++++-- 1 file changed, 197 insertions(+), 13 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index e1e375cf..237939d3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -59,22 +59,206 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { std::forward_as_tuple("ACT"), std::forward_as_tuple( std::initializer_list{ - TimeDependency{tRC, "ACT", DependencyType::IntraBank, "tRC"}, - TimeDependency{tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, - TimeDependency{tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, - TimeDependency{tRP, "PRE", DependencyType::IntraBank, "tRP"}, - TimeDependency{tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, - TimeDependency{tRP, "PREA", DependencyType::IntraRank, "tRP"}, - TimeDependency{tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - TimeDependency{tXP, "PDXP", DependencyType::IntraRank, "tXP"}, - TimeDependency{tRFC, "REFA", DependencyType::IntraRank, "tRFC"}, - TimeDependency{tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - TimeDependency{tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tNAW, "NAW", DependencyType::IntraRank, "tNAW"} } ) ); - // TODO add all the rest + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("RD"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("RDA"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tWRPRE - tRTP, "WR", DependencyType::IntraBank, "tWRPRE - tRTP"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("WR"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PREPB"), + std::forward_as_tuple( + std::initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PREAB"), + std::forward_as_tuple( + std::initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("REFAB"), + std::forward_as_tuple( + std::initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("REFAB"), + std::forward_as_tuple( + std::initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDXA"), + std::forward_as_tuple( + std::initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDEP"), + std::forward_as_tuple( + std::initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDXP"), + std::forward_as_tuple( + std::initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("SREFEN"), + std::forward_as_tuple( + std::initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {std::max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {std::max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("SREFEX"), + std::forward_as_tuple( + std::initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} + } + ) + ); return dmap; -} \ No newline at end of file +} From 8bf98ac051dad295994f6f727696aa4ec760e8ca Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 15:14:39 +0100 Subject: [PATCH 010/121] Added main calculation loop and other modifications and corrections. Still missing table data storing and test. --- .../DDR3TimeDependencies.cpp | 83 ++++++++----- .../DDR3TimeDependencies.h | 79 ++++++------- .../dramtimedependenciesIF.cpp | 14 ++- .../dramtimedependenciesIF.h | 9 +- .../dramtimedependencyfactory.cpp | 8 +- .../dramtimedependencyfactory.h | 4 +- .../phasedependenciestracker.cpp | 109 ++++++++++++++++-- .../phasedependenciestracker.h | 6 +- .../phases/phasedependency.cpp | 20 +++- .../businessObjects/phases/phasedependency.h | 2 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 7 +- 11 files changed, 244 insertions(+), 97 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 237939d3..5b494732 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -6,41 +6,41 @@ DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTim } void DDR3TimeDependencies::mInitializeValues() { - burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toLongLong(); - dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toLongLong(); - clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toLongLong(); + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toInt(); + clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toInt(); nActivateWindow = 4; - tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toLongLong(); - tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toLongLong(); - tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toLongLong(); - tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toLongLong(); - tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toLongLong(); - tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toLongLong(); - tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toLongLong(); - tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toLongLong(); - tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toLongLong(); - tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toLongLong(); - tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toLongLong(); - tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toLongLong(); - tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toLongLong(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); - tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toLongLong(); - tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toLongLong(); - tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toLongLong(); - tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toLongLong(); - tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toLongLong(); - tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toLongLong(); - tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toLongLong(); - tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toLongLong(); - tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toLongLong(); - tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toLongLong(); - tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toLongLong(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toInt(); + tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toInt(); + tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toInt(); + tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toInt(); + tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toInt(); + tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toInt(); + tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toInt(); + tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toInt(); + tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toInt(); + tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toInt(); + tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toInt(); + tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toInt(); + tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toInt(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); + tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toInt(); + tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toInt(); + tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toInt(); + tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toInt(); + tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toInt(); + tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toInt(); + tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toInt(); + tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toInt(); + tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toInt(); + tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toInt(); + tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toInt(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); tPD = tCKE; - tBURST = (int) ((burstLength / dataRate) * clk); + tBURST = (uint) ((burstLength / (float) dataRate) * clk); tRDWR = tRL + tBURST + 2 * clk - tWL; tRDWR_R = tRL + tBURST + tRTRS - tWL; tWRRD = tWL + tBURST + tWTR; @@ -49,6 +49,7 @@ void DDR3TimeDependencies::mInitializeValues() { tRDPDEN = tRL + tBURST + clk; tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + clk; + } DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { @@ -135,6 +136,26 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ) ); + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("WRA"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + } + ) + ); + dmap.emplace( std::piecewise_construct, std::forward_as_tuple("PREPB"), @@ -182,7 +203,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { dmap.emplace( std::piecewise_construct, - std::forward_as_tuple("REFAB"), + std::forward_as_tuple("PDEA"), std::forward_as_tuple( std::initializer_list{ {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 793b50f1..53568c34 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -10,50 +10,47 @@ public: protected: void mInitializeValues() override; DependencyMap mSpecializedGetDependencies() const override; - + protected: - size_t burstLength; - size_t dataRate; - size_t clk; + uint burstLength; + uint dataRate; - size_t nActivateWindow; + uint tRP; + uint tRAS; + uint tRC; + uint tRTP; + uint tRRD; + uint tCCD; + uint tRCD; + uint tNAW; + uint tRL; + uint tWL; + uint tWR; + uint tWTR; + uint tCKESR; + uint tCKE; + uint tXP; + uint tXPDLL; + uint tXS; + uint tXSDLL; + uint tAL; + uint tRFC; + uint tREFI; + uint tRTRS; - size_t tRP; - size_t tRAS; - size_t tRC; - size_t tRTP; - size_t tRRD; - size_t tCCD; - size_t tRCD; - size_t tNAW; - size_t tRL; - size_t tWL; - size_t tWR; - size_t tWTR; - size_t tCKESR; - size_t tCKE; - size_t tXP; - size_t tXPDLL; - size_t tXS; - size_t tXSDLL; - size_t tAL; - size_t tRFC; - size_t tREFI; - size_t tRTRS; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; - size_t tACTPDEN; - size_t tPRPDEN; - size_t tREFPDEN; - - size_t tPD; - size_t tBURST; - size_t tRDWR; - size_t tRDWR_R; - size_t tWRRD; - size_t tWRRD_R; - size_t tWRPRE; - size_t tRDPDEN; - size_t tWRPDEN; - size_t tWRAPDEN; + uint tPD; + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRRD_R; + uint tWRPRE; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index c740a801..0960d646 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -26,8 +26,11 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) while (it != dependenciesMap.end()) { mFilterDependencyList(it->second.dependencies, dependencyFilter); it->second.maxTime = mFindVectorMaximum(it->second.dependencies); + + ++it; } + return dependenciesMap; } @@ -60,7 +63,9 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - QStringsComparator::compareQStrings + [](const QString& cmd, const QString& depName){ + return cmd == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + } ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -102,7 +107,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, itFilterLast, itDependencyMap, [](const QString& cmd, const std::pair& vpair) { - return cmd == vpair.first; + return cmd.compare(vpair.first) == 0; } ); @@ -113,6 +118,8 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } else if (pair.first->compare(pair.second->first) < 0) { ++(pair.first); + } else if (pair.first->compare(pair.second->first) == 0) { + ++(pair.second); } else { pair.second = dependencyMap.erase(pair.second); @@ -123,9 +130,10 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } } + } -size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { +uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { auto maxElement = std::max_element( dependencyList.begin(), dependencyList.end(), diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index 7071ef84..cc818162 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -35,6 +35,7 @@ struct QStringsComparator { typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const QJsonObject& memspec); @@ -44,10 +45,13 @@ public: static const QJsonObject getMemspec(const TraceDB& tdb); + const uint getClk() const { return clk; } + const uint getNAW() const { return nActivateWindow; }; + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; - size_t mFindVectorMaximum(const std::vector& dependencyList) const; + uint mFindVectorMaximum(const std::vector& dependencyList) const; protected: QJsonObject mMemspecJson; @@ -56,6 +60,9 @@ protected: protected: virtual void mInitializeValues() {} ; virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; + + uint clk = 0; + uint nActivateWindow = 0; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index f9c72c91..65f41cc7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -1,16 +1,16 @@ #include "dramtimedependencyfactory.h" -DRAMTimeDependenciesIF DRAMTimeDependencyFactory::make(const TraceDB& tdb) { +std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); - QString deviceType = memspec["memspec"]["memoryType"].toString(); + QString deviceType = memspec["memoryType"].toString(); if (deviceType == "DDR3") { - return DDR3TimeDependencies(memspec); + return std::make_shared(memspec); } else { // TODO maybe throw? - return DRAMTimeDependenciesIF(memspec); + throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index d6232ffe..748c5ab1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -1,13 +1,15 @@ #pragma once +#include + #include "dramtimedependenciesIF.h" #include "DDR3TimeDependencies.h" #include "data/tracedb.h" class DRAMTimeDependencyFactory { public: - static DRAMTimeDependenciesIF make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); private: DRAMTimeDependencyFactory() = delete; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 984a8886..7a18e978 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -2,13 +2,13 @@ #include "phasedependenciestracker.h" void -PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { mDropTable(tdb); mCreateTable(tdb); auto& phases = mGetAllPhases(tdb, commands); - auto& entries = mCalculateDependencies(tdb, phases); + auto& entries = mCalculateDependencies(tdb, phases, commands); mInsertIntoTable(tdb, entries); @@ -61,7 +61,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " @@ -70,8 +70,8 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& transactions) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; - DRAMTimeDependenciesIF deviceDependencies = DRAMTimeDependencyFactory::make(tdb); - // TODO Main dependency calculation loop + // Get dependencies for tdb device + auto device = DRAMTimeDependencyFactory::make(tdb); + DependencyMap deviceDependencies = device->getDependencies(commands); + + // Tries to find all timing dependencies for each phase on the trace + std::vector tmpPotentialNAW; + tmpPotentialNAW.reserve(16); + for (size_t i = 1; i < phases.size(); i++) { + // NAW dependencies variables reset + tmpPotentialNAW.clear(); + size_t nawCount = 0; + + // Auxiliary variables + const auto& phase = phases[i]; + const size_t cmdBank = phase->tBank; + const size_t cmdRank = phase->tRank; + + // Get time dependency descriptions for the current phase + const auto& deps = deviceDependencies.at(phase->phaseName); + + // Loop all previous phases until there cannot be any more time dependencies + for (int j = i-1; j >= 0; j--) { + // Get next phase to analyse + const auto& otherPhase = phases[j]; + // Calculates the time difference in nanoseconds + const auto timeDiff = phase->phaseBegin - otherPhase->phaseBegin; + + // Time difference begin greater than the maximum possible dependency time ends the internal loop + if (timeDiff > deps.maxTime) break; + + // For each possible dependency for the current phase, + // checks if otherPhase would match as a dependency + for (const auto& dep : deps.dependencies) { + if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; + + if ( + dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank + || dep.depType == DependencyType::IntraRank && cmdBank != otherPhase->tRank + || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? + ) { + continue; + } + + if (dep.phaseDep == "NAW") { + if (otherPhase->phaseName == "ACT") { + if (timeDiff == dep.timeValue) { + // Captures only the first (or exactly matching time) ACT in + // the ACT window as a dependency + tmpPotentialNAW.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName + }); + } + nawCount++; + + } + + continue; // TODO should this continue here or should it be removed for potentially more time dependencies to be captured? + } + + if (timeDiff == dep.timeValue) { + entries.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName + }); + } + + } + + if (timeDiff == device->getClk()) { + entries.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(DependencyType::IntraRank), + "CommandBus", + otherPhase->id, + otherPhase->phaseName + }); + } + + } + + if (nawCount >= device->getNAW()) { + entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); + } + + } return entries; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index a46d6c05..a01c537a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -29,15 +29,15 @@ struct DBDependencyEntry { class PhaseDependenciesTracker { public: - static void calculateDependencies(TraceDB& tdb, const std::vector& commands); + static void calculateDependencies(TraceDB& tdb, std::vector& dependencyFilter); private: static void mDropTable(TraceDB& tdb); static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases); + static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index e76d0f8e..de6c65ff 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -129,4 +129,22 @@ void PhaseDependency::mDraw(QPoint &end, double depY, const TraceDrawingProperti drawText(painter, mTimeDependency, textPosition, alignment); } -} \ No newline at end of file +} + +QString PhaseDependency::dependencyTypeName(DependencyType dtype) { + switch(dtype) { + case IntraBank: + return "IntraBank"; + + case IntraRank: + return "IntraRank"; + + case InterRank: + return "InterRank"; + + default: + // TODO - maybe throw? + return ""; + + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index fa203556..439f973c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -68,6 +68,8 @@ public: bool draw(QPoint &end, const TraceDrawingProperties &drawingProperties, QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap); + static QString dependencyTypeName(DependencyType); + protected: DependencyType mType; QString mTimeDependency; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index f25587bd..d0949ba3 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -307,17 +307,16 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) void TraceFileTab::on_calculateDependencies_clicked() { // TODO - anything else? Update view maybe? // TODO - For now fixed, but must be selectable - std::vector dependencyFilter = { + std::vector dependencyFilter = { "ACT", - "PRE", + "PREPB", "RD", "RDA", "WR", "WRA", "PDE", "PDX", - "PREA", - "NAW" + "PREAB" }; PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); From 0e1245ad98a607f8ce72579db4f3db7c4c146d17 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 13:31:15 +0100 Subject: [PATCH 011/121] Added dependency calculations. Still missing tests and interface. --- .../DDR3TimeDependencies.cpp | 60 ++++++++------- .../DDR3TimeDependencies.h | 2 +- .../dramtimedependenciesIF.cpp | 11 ++- .../dramtimedependenciesIF.h | 4 +- .../dramtimedependencyfactory.cpp | 5 +- .../phasedependenciestracker.cpp | 73 ++++++++++++++++--- .../phasedependenciestracker.h | 9 +++ DRAMSys/traceAnalyzer/tracefiletab.cpp | 2 +- 8 files changed, 114 insertions(+), 52 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 5b494732..1b59a3eb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -1,43 +1,41 @@ #include "DDR3TimeDependencies.h" -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTimeDependenciesIF(memspec) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint clk) : DRAMTimeDependenciesIF(memspec, clk) { mInitializeValues(); } void DDR3TimeDependencies::mInitializeValues() { - burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toInt(); - dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toInt(); - clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toInt(); + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; - - tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toInt(); - tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toInt(); - tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toInt(); - tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toInt(); - tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toInt(); - tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toInt(); - tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toInt(); - tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toInt(); - tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toInt(); - tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toInt(); - tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toInt(); - tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toInt(); - tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toInt(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); - tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toInt(); - tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toInt(); - tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toInt(); - tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toInt(); - tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toInt(); - tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toInt(); - tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toInt(); - tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toInt(); - tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toInt(); - tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toInt(); - tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toInt(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); + tRP = clk * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = clk * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = clk * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRTP = clk * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRD = clk * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tCCD = clk * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = clk * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tNAW = clk * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRL = clk * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = clk * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = clk * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = clk * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tCKESR = clk * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = clk * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXPDLL = clk * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); + tXS = clk * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = clk * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tAL = clk * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRFC = clk * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tREFI = clk * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tRTRS = clk * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + tACTPDEN = clk * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = clk * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = clk * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); tPD = tCKE; tBURST = (uint) ((burstLength / (float) dataRate) * clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 53568c34..7c8a30f4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -5,7 +5,7 @@ class DDR3TimeDependencies : public DRAMTimeDependenciesIF { public: - DDR3TimeDependencies(const QJsonObject& memspec); + DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); protected: void mInitializeValues() override; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 0960d646..40f43b6a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -3,8 +3,9 @@ #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec) { +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inClk) { mMemspecJson = memspec; + clk = inClk; } @@ -34,16 +35,18 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& clk) { QSqlDatabase db = tdb.getDatabase(); - QString query = "SELECT Memspec FROM GeneralInfo"; + QString query = "SELECT clk, Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); sqlQuery.next(); - QString memSpecJson = sqlQuery.value(0).toString(); + clk = sqlQuery.value(0).toInt(); + QString memSpecJson = sqlQuery.value(1).toString(); sqlQuery.finish(); QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + return jsonDocument.object()["memspec"].toObject(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index cc818162..bd495583 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -38,12 +38,12 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec); + DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint clk); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb); + static const QJsonObject getMemspec(const TraceDB& tdb, uint& clk); const uint getClk() const { return clk; } const uint getNAW() const { return nActivateWindow; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index 65f41cc7..1586406f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -2,11 +2,12 @@ #include "dramtimedependencyfactory.h" std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); + uint clk = 0; + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); QString deviceType = memspec["memoryType"].toString(); if (deviceType == "DDR3") { - return std::make_shared(memspec); + return std::make_shared(memspec, clk); } else { // TODO maybe throw? diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 7a18e978..2f0a8e45 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -3,15 +3,22 @@ void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { + mBeginTransaction(tdb); + mDropTable(tdb); mCreateTable(tdb); auto& phases = mGetAllPhases(tdb, commands); + if (phases.size() == 0) { + mRollbackChanges(tdb); + } + auto& entries = mCalculateDependencies(tdb, phases, commands); mInsertIntoTable(tdb, entries); + mCommitTransaction(tdb); } void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { @@ -29,7 +36,7 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { - static const size_t bulkInsertionSize = 1000; + static const size_t bulkInsertionSize = 200; auto numberOfEntries = entries.size(); @@ -37,25 +44,33 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< size_t counter = 0; for (const auto& entry : entries) { if (counter == 0) { - // TODO Reset command string and add first command - command = ""; + // Reset command string and add first entry + command = "INSERT INTO 'DirectDependencies' ('DelayedPhaseID', 'DelayedPhaseName', 'DependencyType', 'TimeDependency', 'DependencyPhaseID', 'DependencyPhaseName') "; + mAddFirstEntryCommandString(command, entry); + + counter++; - } else if (counter == bulkInsertionSize) { - // TODO Write last command and submit + } else if (counter == bulkInsertionSize-1) { + // Write last entry and submit + mAddEntryCommandString(command, entry); + + mExecuteQuery(tdb, command); counter = 0; } else { - // TODO + // Write entry + mAddEntryCommandString(command, entry); counter++; + } } if (counter != 0) { - // TODO Submit command string + mExecuteQuery(tdb, command); } } @@ -74,7 +89,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector queryStr = queryStr + '\"' + cmd + "\","; } queryStr.back() = ')'; - queryStr += " ORDER BY PhaseBegin "; + queryStr += " ORDER BY PhaseBegin; "; auto query = mExecuteQuery(tdb, queryStr); @@ -119,6 +134,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector const std::vector PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; + entries.reserve((size_t) (0.4 * phases.size())); // Get dependencies for tdb device auto device = DRAMTimeDependencyFactory::make(tdb); @@ -146,7 +162,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: const auto& otherPhase = phases[j]; // Calculates the time difference in nanoseconds const auto timeDiff = phase->phaseBegin - otherPhase->phaseBegin; - // Time difference begin greater than the maximum possible dependency time ends the internal loop if (timeDiff > deps.maxTime) break; @@ -157,12 +172,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: if ( dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank - || dep.depType == DependencyType::IntraRank && cmdBank != otherPhase->tRank + || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? ) { continue; } - if (dep.phaseDep == "NAW") { if (otherPhase->phaseName == "ACT") { if (timeDiff == dep.timeValue) { @@ -226,3 +240,40 @@ QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString qu return query; } + +void PhaseDependenciesTracker::mBeginTransaction(TraceDB& tdb) { + const QString queryStr = "BEGIN TRANSACTION;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mRollbackChanges(TraceDB& tdb) { + const QString queryStr = "ROLLBACK;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mCommitTransaction(TraceDB& tdb) { + const QString queryStr = "COMMIT;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry) { + command = command + " SELECT '" + QString::number(entry.delayedPhaseID) + "' AS 'DelayedPhaseID', '" + + entry.delayedPhaseName + "' AS 'DelayedPhaseName', '" + + entry.dependencyType + "' AS 'DependencyType', '" + + entry.timeDependency + "' AS 'TimeDependency', '" + + QString::number(entry.dependencyPhaseID) + "' AS 'DependencyPhaseID', '" + + entry.dependencyPhaseName + "' AS 'DependencyPhaseName' "; + +} + +void PhaseDependenciesTracker::mAddEntryCommandString(QString& command, const DBDependencyEntry& entry) { + command = command + " UNION ALL SELECT '" + QString::number(entry.delayedPhaseID) + "', '" + + entry.delayedPhaseName + "', '" + + entry.dependencyType + "', '" + + entry.timeDependency + "', '" + + QString::number(entry.dependencyPhaseID) + "', '" + + entry.dependencyPhaseName + "' "; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index a01c537a..17d5ecda 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -43,4 +43,13 @@ private: PhaseDependenciesTracker() = delete; ~PhaseDependenciesTracker() = delete; + +private: + static void mBeginTransaction(TraceDB& tdb); + static void mRollbackChanges(TraceDB& tdb); + static void mCommitTransaction(TraceDB& tdb); + + static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); + static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); + }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index d0949ba3..c98f4e2b 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -309,7 +309,7 @@ void TraceFileTab::on_calculateDependencies_clicked() { // TODO - For now fixed, but must be selectable std::vector dependencyFilter = { "ACT", - "PREPB", + "PREPB", "RD", "RDA", "WR", From 7bfb12813254d4e1a294fd9350237cb4b50a2650 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:30:45 +0100 Subject: [PATCH 012/121] Added interface for dependency calculation. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../businessObjects/configmodels.cpp | 139 ----------------- .../businessObjects/configmodels.h | 56 ------- .../businessObjects/dependencymodels.cpp | 141 ++++++++++++++++++ .../businessObjects/dependencymodels.h | 65 ++++++++ .../DDR3TimeDependencies.cpp | 18 +++ .../DDR3TimeDependencies.h | 2 + .../dramtimedependencyfactory.cpp | 29 ++++ .../dramtimedependencyfactory.h | 4 + .../phasedependenciestracker.cpp | 50 ++++--- DRAMSys/traceAnalyzer/data/QueryTexts.h | 10 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 9 +- .../traceAnalyzer/presentation/traceplot.cpp | 3 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 36 +++-- DRAMSys/traceAnalyzer/tracefiletab.h | 3 + DRAMSys/traceAnalyzer/tracefiletab.ui | 16 +- 16 files changed, 343 insertions(+), 239 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 7b84d13f..327e057b 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -101,6 +101,7 @@ add_executable(TraceAnalyzer presentation/traceselector.cpp businessObjects/configmodels.cpp businessObjects/commentmodel.cpp + businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp index 149ccf8d..439f85f1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp @@ -283,142 +283,3 @@ QModelIndex MemSpecModel::parent(const QModelIndex &index) const return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); } - -DependencyInfosModel::DependencyInfosModel(TraceDB &traceFile, QObject *parent) : QAbstractItemModel(parent) -{ - mDepInfosDepType = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyType); - mDepInfosTimeDep = traceFile.getDependencyInfos(DependencyInfos::Type::TimeDependency); - mDepInfosDelPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DelayedPhase); - mDepInfosDepPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyPhase); - - if (traceFile.checkDependencyTableExists()) - { - parseInfos(); - } -} - -int DependencyInfosModel::Node::getRow() const -{ - if (!parent) - return 0; - - const auto &siblings = parent->children; - const auto siblingsIt = std::find_if(siblings.begin(), siblings.end(), - [this](const std::unique_ptr &node) { return node.get() == this; }); - - Q_ASSERT(siblingsIt != siblings.end()); - - return std::distance(siblings.begin(), siblingsIt); -} - -void DependencyInfosModel::parseInfos() -{ - - std::vector> infos = {{"Dependency Granularity", mDepInfosDepType}, - {"Time Dependencies", mDepInfosTimeDep}, - {"Delayed Phases", mDepInfosDelPhase}, - {"Dependency Phases", mDepInfosDepPhase}}; - - for (auto pair : infos) - { - std::unique_ptr node = std::unique_ptr(new Node({pair.first, ""}, rootNode.get())); - - for (auto v : pair.second.getInfos()) - { - QString value = QString::number(v.value) + " %"; - node->children.push_back(std::move(std::unique_ptr(new Node({v.id, value}, node.get())))); - } - - rootNode->children.push_back(std::move(node)); - } -} - -int DependencyInfosModel::rowCount(const QModelIndex &parent) const -{ - if (parent.column() > 0) - return 0; - - const Node *parentNode; - - if (!parent.isValid()) - parentNode = rootNode.get(); - else - parentNode = static_cast(parent.internalPointer()); - - return parentNode->childCount(); -} - -int DependencyInfosModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent) - - return 2; -} - -QVariant DependencyInfosModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) - return QVariant(); - - if (role != Qt::DisplayRole && role != Qt::ToolTipRole) - return QVariant(); - - auto *node = static_cast(index.internalPointer()); - - if (index.column() == 0) - return QVariant(node->data.first); - else - return QVariant(node->data.second); -} - -QVariant DependencyInfosModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if (role != Qt::DisplayRole) - return QVariant(); - - if (orientation == Qt::Horizontal) - { - switch (section) - { - case 0: - return "Field"; - case 1: - return "Percentage"; - default: - break; - } - } - - return QVariant(); -} - -QModelIndex DependencyInfosModel::index(int row, int column, const QModelIndex &parent) const -{ - if (!hasIndex(row, column, parent)) - return QModelIndex(); - - const Node *parentNode; - - if (!parent.isValid()) - parentNode = rootNode.get(); - else - parentNode = static_cast(parent.internalPointer()); - - const Node *node = parentNode->children[row].get(); - - return createIndex(row, column, const_cast(node)); -} - -QModelIndex DependencyInfosModel::parent(const QModelIndex &index) const -{ - if (!index.isValid()) - return QModelIndex(); - - const Node *childNode = static_cast(index.internalPointer()); - const Node *parentNode = childNode->parent; - - if (!parentNode) - return QModelIndex(); - - return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h index 7408db5c..9b5731db 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h @@ -31,7 +31,6 @@ * * Authors: * Derek Christ - * Iron Prando da Silva */ #ifndef CONFIGMODELS_H @@ -124,59 +123,4 @@ private: std::unique_ptr rootNode = std::unique_ptr(new Node); }; -class DependencyInfosModel : public QAbstractItemModel -{ - Q_OBJECT -public: - explicit DependencyInfosModel(TraceDB &traceFile, QObject *parent = nullptr); - ~DependencyInfosModel() - { - } - -protected: - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - - QModelIndex index(int row, int column, const QModelIndex &parent) const override; - QModelIndex parent(const QModelIndex &index) const override; - -private: - DependencyInfos mDepInfosDepType; - DependencyInfos mDepInfosTimeDep; - DependencyInfos mDepInfosDelPhase; - DependencyInfos mDepInfosDepPhase; - - void parseInfos(); - struct Node - { - using NodeData = std::pair; - - Node() - { - } - Node(NodeData data, const Node *parent) : data(data), parent(parent) - { - } - - /** - * Gets the row relative to its parent. - */ - int getRow() const; - int childCount() const - { - return children.size(); - } - - NodeData data; - - const Node *parent = nullptr; - std::vector> children; - }; - - std::unique_ptr rootNode = std::unique_ptr(new Node); -}; - #endif // CONFIGMODELS_H diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp new file mode 100644 index 00000000..cbc39b65 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp @@ -0,0 +1,141 @@ + +#include "dependencymodels.h" + +DependencyInfosModel::DependencyInfosModel(TraceDB &traceFile, QObject *parent) : QAbstractItemModel(parent) +{ + mDepInfosDepType = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyType); + mDepInfosTimeDep = traceFile.getDependencyInfos(DependencyInfos::Type::TimeDependency); + mDepInfosDelPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DelayedPhase); + mDepInfosDepPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyPhase); + + if (traceFile.checkDependencyTableExists()) + { + parseInfos(); + } +} + +int DependencyInfosModel::Node::getRow() const +{ + if (!parent) + return 0; + + const auto &siblings = parent->children; + const auto siblingsIt = std::find_if(siblings.begin(), siblings.end(), + [this](const std::unique_ptr &node) { return node.get() == this; }); + + Q_ASSERT(siblingsIt != siblings.end()); + + return std::distance(siblings.begin(), siblingsIt); +} + +void DependencyInfosModel::parseInfos() +{ + + std::vector> infos = {{"Dependency Granularity", mDepInfosDepType}, + {"Time Dependencies", mDepInfosTimeDep}, + {"Delayed Phases", mDepInfosDelPhase}, + {"Dependency Phases", mDepInfosDepPhase}}; + + for (auto pair : infos) + { + std::unique_ptr node = std::unique_ptr(new Node({pair.first, ""}, rootNode.get())); + + for (auto v : pair.second.getInfos()) + { + QString value = QString::number(v.value) + " %"; + node->children.push_back(std::move(std::unique_ptr(new Node({v.id, value}, node.get())))); + } + + rootNode->children.push_back(std::move(node)); + } +} + +int DependencyInfosModel::rowCount(const QModelIndex &parent) const +{ + if (parent.column() > 0) + return 0; + + const Node *parentNode; + + if (!parent.isValid()) + parentNode = rootNode.get(); + else + parentNode = static_cast(parent.internalPointer()); + + return parentNode->childCount(); +} + +int DependencyInfosModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + + return 2; +} + +QVariant DependencyInfosModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + if (role != Qt::DisplayRole && role != Qt::ToolTipRole) + return QVariant(); + + auto *node = static_cast(index.internalPointer()); + + if (index.column() == 0) + return QVariant(node->data.first); + else + return QVariant(node->data.second); +} + +QVariant DependencyInfosModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (orientation == Qt::Horizontal) + { + switch (section) + { + case 0: + return "Field"; + case 1: + return "Percentage"; + default: + break; + } + } + + return QVariant(); +} + +QModelIndex DependencyInfosModel::index(int row, int column, const QModelIndex &parent) const +{ + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + const Node *parentNode; + + if (!parent.isValid()) + parentNode = rootNode.get(); + else + parentNode = static_cast(parent.internalPointer()); + + const Node *node = parentNode->children[row].get(); + + return createIndex(row, column, const_cast(node)); +} + +QModelIndex DependencyInfosModel::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + const Node *childNode = static_cast(index.internalPointer()); + const Node *parentNode = childNode->parent; + + if (!parentNode) + return QModelIndex(); + + return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h new file mode 100644 index 00000000..02736e13 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h @@ -0,0 +1,65 @@ + +#pragma once + +#include "../data/tracedb.h" +#include "phases/dependencyinfos.h" + +#include +#include +#include +#include + +class DependencyInfosModel : public QAbstractItemModel +{ + Q_OBJECT +public: + explicit DependencyInfosModel(TraceDB &traceFile, QObject *parent = nullptr); + ~DependencyInfosModel() + { + } + +protected: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + QModelIndex index(int row, int column, const QModelIndex &parent) const override; + QModelIndex parent(const QModelIndex &index) const override; + +private: + DependencyInfos mDepInfosDepType; + DependencyInfos mDepInfosTimeDep; + DependencyInfos mDepInfosDelPhase; + DependencyInfos mDepInfosDepPhase; + + void parseInfos(); + struct Node + { + using NodeData = std::pair; + + Node() + { + } + Node(NodeData data, const Node *parent) : data(data), parent(parent) + { + } + + /** + * Gets the row relative to its parent. + */ + int getRow() const; + int childCount() const + { + return children.size(); + } + + NodeData data; + + const Node *parent = nullptr; + std::vector> children; + }; + + std::unique_ptr rootNode = std::unique_ptr(new Node); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 1b59a3eb..fca581e0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -50,6 +50,24 @@ void DDR3TimeDependencies::mInitializeValues() { } +const std::vector DDR3TimeDependencies::getPossiblePhases() { + return {"ACT", + "RD", + "RDA", + "WR", + "WRA", + "PREPB", + "PREAB", + "REFAB", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX" + }; +} + DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { DependencyMap dmap; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 7c8a30f4..47d15f9a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -7,6 +7,8 @@ class DDR3TimeDependencies : public DRAMTimeDependenciesIF { public: DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); + static const std::vector getPossiblePhases(); + protected: void mInitializeValues() override; DependencyMap mSpecializedGetDependencies() const override; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index 1586406f..a71e0eed 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -16,3 +16,32 @@ std::shared_ptr DRAMTimeDependencyFactory::make(const Tr } } + +const std::vector DRAMTimeDependencyFactory::possiblePhases(const TraceDB& tdb) { + uint clk; // Not used + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); + QString deviceType = memspec["memoryType"].toString(); + + if (deviceType == "DDR3") { + return DDR3TimeDependencies::getPossiblePhases(); + + } else { + // TODO maybe throw? + throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + + } + +} + +bool DRAMTimeDependencyFactory::deviceSupported(const TraceDB& tdb) { + uint clk; // Not used + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); + QString deviceType = memspec["memoryType"].toString(); + + if (deviceType == "DDR3") { + return true; + + } else { + return false; + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index 748c5ab1..7a30dec4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -11,6 +11,10 @@ class DRAMTimeDependencyFactory { public: static std::shared_ptr make(const TraceDB& tdb); + static const std::vector possiblePhases(const TraceDB& tdb); + + static bool deviceSupported(const TraceDB& tdb); + private: DRAMTimeDependencyFactory() = delete; ~DRAMTimeDependencyFactory() = delete; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 2f0a8e45..0c2c6450 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -6,23 +6,28 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector 0) { + mCreateTable(tdb); + + auto& phases = mGetAllPhases(tdb, commands); + + if (phases.size() != 0) { + auto& entries = mCalculateDependencies(tdb, phases, commands); + mInsertIntoTable(tdb, entries); + + } else { + // mRollbackChanges(tdb); + // return; + } + } - auto& entries = mCalculateDependencies(tdb, phases, commands); - - mInsertIntoTable(tdb, entries); - mCommitTransaction(tdb); } void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { - QString command = "DROP TABLE DirectDependencies; "; + QString command = "DROP TABLE IF EXISTS DirectDependencies; "; auto query = mExecuteQuery(tdb, command); query.finish(); @@ -54,7 +59,8 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< // Write last entry and submit mAddEntryCommandString(command, entry); - mExecuteQuery(tdb, command); + auto query = mExecuteQuery(tdb, command); + query.finish(); counter = 0; @@ -70,7 +76,8 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } if (counter != 0) { - mExecuteQuery(tdb, command); + auto query = mExecuteQuery(tdb, command); + query.finish(); } } @@ -93,6 +100,9 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector auto query = mExecuteQuery(tdb, queryStr); + if (!query.next()) + return phases; + if (!query.last()) { throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" "Could not retrieve number of rows\n").toStdString(), @@ -128,6 +138,8 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); } + query.finish(); + return phases; } @@ -243,20 +255,20 @@ QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString qu void PhaseDependenciesTracker::mBeginTransaction(TraceDB& tdb) { const QString queryStr = "BEGIN TRANSACTION;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mRollbackChanges(TraceDB& tdb) { const QString queryStr = "ROLLBACK;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mCommitTransaction(TraceDB& tdb) { const QString queryStr = "COMMIT;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry) { diff --git a/DRAMSys/traceAnalyzer/data/QueryTexts.h b/DRAMSys/traceAnalyzer/data/QueryTexts.h index 361ec855..0b877a5d 100644 --- a/DRAMSys/traceAnalyzer/data/QueryTexts.h +++ b/DRAMSys/traceAnalyzer/data/QueryTexts.h @@ -63,7 +63,7 @@ struct TransactionQueryTexts { "WITH timespanTransactions AS (" + selectTransactionsByTimespan + ") SELECT * from DirectDependencies WHERE DelayedPhaseID IN (" " SELECT DirectDependencies.DelayedPhaseID FROM DirectDependencies JOIN timespanTransactions " - " ON DirectDependencies.DelayedPhaseID = timespanTransactions.PhaseID )"; + " ON DirectDependencies.DelayedPhaseID = timespanTransactions.PhaseID ) "; // For some reason I could not use a parameter for these below selectDependencyTypePercentages = @@ -79,7 +79,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectTimeDependencyPercentages = "WITH TotalDeps (total) AS ( " @@ -94,7 +94,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectDelayedPhasePercentages = "WITH TotalDeps (total) AS ( " @@ -109,7 +109,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectDependencyPhasePercentages = "WITH TotalDeps (total) AS ( " @@ -124,7 +124,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; } }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 0bf0bf42..47d12cf4 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -67,7 +67,10 @@ TraceDB::TraceDB(QString path, bool openExisting) database = QSqlDatabase::addDatabase("QSQLITE", path); database.setDatabaseName(path); - database.open(); + if (!database.open()) + { + qDebug() << database.lastError().text(); + } if (!openExisting) dropAndCreateTables(); prepareQueries(); @@ -399,6 +402,7 @@ DependencyInfos TraceDB::getDependencyInfos(DependencyInfos::Type infoType) executeQuery(checkDependenciesExist); if (!checkDependenciesExist.next() || checkDependenciesExist.value(0).toInt() != 1) { + checkDependenciesExist.finish(); return dummy; } @@ -562,6 +566,8 @@ DependencyInfos TraceDB::parseDependencyInfos(QSqlQuery &query, const Dependency infos.addInfo({query.value(0).toString(), query.value(1).toFloat()}); } + query.finish(); + return infos; } @@ -576,6 +582,7 @@ void TraceDB::executeQuery(QSqlQuery query) } else { + query.finish(); throw sqlException( ("Query:\n " + queryToString(query) + "\n failed. Error: \n" + query.lastError().text()).toStdString(), this->pathToDB.toStdString()); diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index 9389c5e5..7579a145 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -513,6 +513,9 @@ void TracePlot::currentTraceTimeChanged() } setAxisScale(xBottom, GetCurrentTimespan().Begin(), GetCurrentTimespan().End()); + + dependenciesSubMenu->setEnabled(navigator->TraceFile().checkDependencyTableExists()); + replot(); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index c98f4e2b..af64a089 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -85,6 +85,8 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path) setUpTraceSelector(); setUpCommentView(); + setUpPossiblePhases(); + ui->mcConfigView->setModel(mcConfigModel); ui->mcConfigView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); @@ -184,6 +186,18 @@ void TraceFileTab::setUpCommentView() commentModel, &CommentModel::rowDoubleClicked); } +void TraceFileTab::setUpPossiblePhases() { + const auto possiblePhases = DRAMTimeDependencyFactory::possiblePhases(navigator->TraceFile()); + for (auto p : possiblePhases) { + auto item = new QListWidgetItem(p, ui->depTabPossiblePhases); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag + item->setCheckState(Qt::Unchecked); // AND initialize check state + + } + + ui->calculateDependencies->setEnabled(DRAMTimeDependencyFactory::deviceSupported(navigator->TraceFile())); +} + void TraceFileTab::tracefileChanged() { if (savingChangesToDB == true) { @@ -305,21 +319,17 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } void TraceFileTab::on_calculateDependencies_clicked() { - // TODO - anything else? Update view maybe? - // TODO - For now fixed, but must be selectable - std::vector dependencyFilter = { - "ACT", - "PREPB", - "RD", - "RDA", - "WR", - "WRA", - "PDE", - "PDX", - "PREAB" - }; + std::vector dependencyFilter; + for (int row = 0; row < ui->depTabPossiblePhases->count(); row++) { + auto item = ui->depTabPossiblePhases->item(row); + if (item->checkState() == Qt::Checked) + dependencyFilter.push_back(item->text()); + } PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); + depInfosView = new DependencyInfosModel(navigator->TraceFile(), this); + ui->depInfosView->setModel(depInfosView); + ui->depInfosView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index fdd0374e..5ae2b116 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -47,6 +47,7 @@ #include "presentation/traceplot.h" #include "presentation/tracescroller.h" #include "businessObjects/configmodels.h" +#include "businessObjects/dependencymodels.h" class CommentModel; @@ -66,6 +67,8 @@ public: void setUpTraceplotScrollbar(); void setUpTraceSelector(); void setUpCommentView(); + void setUpPossiblePhases(); + void initNavigatorAndItsDependentWidgets(QString path); QString getPathToTraceFile() { diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index f2cac71d..31e8134a 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -209,16 +209,20 @@ - - - Calculate Dependencies + + + true - - - true + + + + + + + Calculate Dependencies From 4e7b5995cd77687b6e3300afb936ff36950e8251 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:42:47 +0100 Subject: [PATCH 013/121] Closing database before removal. --- DRAMSys/traceAnalyzer/data/tracedb.cpp | 40 ++++++++++++++++++-------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 47d12cf4..c7d5d57f 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -61,8 +61,8 @@ TraceDB::TraceDB(QString path, bool openExisting) database = QSqlDatabase::database(path); if (database.isValid() && database.isOpen()) { // Close the database connection if it exists and was not closed yet. - database.removeDatabase(path); database.close(); + QSqlDatabase::removeDatabase(path); } database = QSqlDatabase::addDatabase("QSQLITE", path); @@ -81,28 +81,44 @@ TraceDB::TraceDB(QString path, bool openExisting) void TraceDB::prepareQueries() { selectTransactionsByTimespan = QSqlQuery(database); - selectTransactionsByTimespan.prepare(queryTexts.selectTransactionsByTimespan); - selectTransactionById = QSqlQuery(database); + if (!selectTransactionsByTimespan.prepare(queryTexts.selectTransactionsByTimespan)) + qDebug() << database.lastError().text(); + + selectTransactionById = QSqlQuery(database); + if (!selectTransactionById.prepare(queryTexts.selectTransactionById)) + qDebug() << database.lastError().text(); - selectTransactionById.prepare(queryTexts.selectTransactionById); selectDebugMessagesByTimespan = QSqlQuery(database); - selectDebugMessagesByTimespan.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end "); + if (!selectDebugMessagesByTimespan.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end ")) + qDebug() << database.lastError().text(); + selectDebugMessagesByTimespanWithLimit = QSqlQuery(database); - selectDebugMessagesByTimespanWithLimit.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end LIMIT :limit"); + if (!selectDebugMessagesByTimespanWithLimit.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end LIMIT :limit")) + qDebug() << database.lastError().text(); checkDependenciesExist = QSqlQuery(database); - checkDependenciesExist.prepare(queryTexts.checkDependenciesExist); + if (!checkDependenciesExist.prepare(queryTexts.checkDependenciesExist)) + qDebug() << database.lastError().text(); + selectDependenciesByTimespan = QSqlQuery(database); - selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan); + if (!selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan)) + qDebug() << database.lastError().text(); selectDependencyTypePercentages = QSqlQuery(database); - selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages); + if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) + qDebug() << database.lastError().text(); + selectTimeDependencyPercentages = QSqlQuery(database); - selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages); + if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) + qDebug() << database.lastError().text(); + selectDelayedPhasePercentages = QSqlQuery(database); - selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages); + if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) + qDebug() << database.lastError().text(); + selectDependencyPhasePercentages = QSqlQuery(database); - selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages); + if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) + qDebug() << database.lastError().text(); } void TraceDB::updateComments(const std::vector &comments) From 6f14e6e23ff7f2ee005854c3837b5386bcd7ae99 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 15 Dec 2021 11:33:05 +0100 Subject: [PATCH 014/121] Added INT types to ID columns in DirectDependencies table creation. --- .../traceAnalyzer/businessObjects/phasedependenciestracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 0c2c6450..ccd0665c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -34,7 +34,7 @@ void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { - QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID, DependencyPhaseName ); "; + QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID INT, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID INT, DependencyPhaseName ); "; auto query = mExecuteQuery(tdb, command); query.finish(); From fe2d9dcfcbae4b412757533c20cb36a55971ec7c Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 23 Nov 2021 12:11:15 +0100 Subject: [PATCH 015/121] Testing new color configuration -- Refactored ColorGenerator and added HSV15. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../businessObjects/phases/phase.cpp | 24 ++- .../presentation/util/colorgenerator.cpp | 89 ++------- .../presentation/util/colorgenerator.h | 21 +- .../presentation/util/colorobject.cpp | 179 ++++++++++++++++++ .../presentation/util/colorobject.h | 71 +++++++ 6 files changed, 299 insertions(+), 86 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp create mode 100644 DRAMSys/traceAnalyzer/presentation/util/colorobject.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 28e71f52..07b15164 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -68,6 +68,7 @@ add_executable(TraceAnalyzer data/tracedb.cpp presentation/tracenavigator.cpp presentation/util/colorgenerator.cpp + presentation/util/colorobject.cpp presentation/tracedrawing.cpp presentation/traceplotitem.cpp gototimedialog.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 0c13f1fd..0e191fb9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -177,16 +177,20 @@ void Phase::drawPhaseDependencies(traceTime begin, traceTime end, double y, QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const { - switch (drawingProperties.colorGrouping) - { - case ColorGrouping::PhaseType: - return getPhaseColor(); - case ColorGrouping::Thread: - return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); - case ColorGrouping::AlphaTransaction: - return ColorGenerator::getAlphaColored(transaction.lock()->id); - case ColorGrouping::Transaction: default: - return ColorGenerator::getColor(transaction.lock()->id); + switch (drawingProperties.colorGrouping) { + case ColorGrouping::PhaseType: + return getPhaseColor(); + break; + case ColorGrouping::Thread: + return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); + break; + case ColorGrouping::AlphaTransaction: + return ColorGenerator::getAlphaColored(transaction.lock()->id, ColorName::HSV15); + + break; + case ColorGrouping::Transaction: + default: + return ColorGenerator::getColor(transaction.lock()->id); } } diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index ae3070a6..11cf1023 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -38,79 +38,30 @@ #include "colorgenerator.h" #include -ColorGenerator::ColorGenerator() + +QColor ColorGenerator::getColor(unsigned int i, ColorName color) { - r[0] = 0xFF; - r[1] = 0x00; - r[2] = 0x00; - r[3] = 0xFF; - g[0] = 0x00; - g[1] = 0xFF; - g[2] = 0x00; - g[3] = 0xFF; - b[0] = 0x00; - b[1] = 0x00; - b[2] = 0xFF; - b[3] = 0x00; - - r[4] = 0xFF; - r[5] = 0x00; - r[6] = 0xFF; - r[7] = 0x6B; - g[4] = 0x00; - g[5] = 0xFF; - g[6] = 0xA5; - g[7] = 0x8E; - b[4] = 0xFF; - b[5] = 0xFF; - b[6] = 0x00; - b[7] = 0x23; - - r[8] = 0x8A; - r[9] = 0xFF; - r[10] = 0x7C; - r[11] = 0x00; - g[8] = 0x2B; - g[9] = 0xD7; - g[10] = 0xFC; - g[11] = 0x00; - b[8] = 0xE2; - b[9] = 0x00; - b[10] = 0x00; - b[11] = 0x80; - - r[12] = 0x80; - r[13] = 0x00; - r[14] = 0xEE; - r[15] = 0xFF; - g[12] = 0x00; - g[13] = 0x80; - g[14] = 0x82; - g[15] = 0x45; - b[12] = 0x00; - b[13] = 0x00; - b[14] = 0xEE; - b[15] = 0x00; + switch(color) { + case ColorName::Default: + return cDefault.getColor(i); + case ColorName::HSV15: + return cHSV15.getColor(i); + } + return {0, 0, 0}; } -QColor ColorGenerator::getColor(unsigned int i) +QColor ColorGenerator::getAlphaColored(unsigned int i, ColorName color) { - static ColorGenerator gen; - i = i % 16; - QColor result(gen.r[i], gen.g[i], gen.b[i]); - result.setAlpha(130); - return result; + switch(color) { + case ColorName::Default: + return cDefault.getAlphaColored(i); + case ColorName::HSV15: + return cHSV15.getAlphaColored(i); + } + + return {0, 0, 0}; } -QColor ColorGenerator::getAlphaColored(unsigned int i) -{ - static ColorGenerator gen; - const int minAlpha = 25; - const int alphaLevels = 40 - 255 / minAlpha; - int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); - i = (i / alphaLevels) % 16; - QColor result(gen.r[i], gen.g[i], gen.b[i]); - result.setAlpha(alpha); - return result; -} +ColorDefault ColorGenerator::cDefault; +ColorHSV15 ColorGenerator::cHSV15; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h index 35941474..7897393d 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h @@ -39,21 +39,28 @@ #ifndef COLORGENERATOR_H #define COLORGENERATOR_H +#include "colorobject.h" + #include #include +enum ColorName +{ + Default, + HSV15 +}; + class ColorGenerator { private: - static constexpr int NumberOfColors = 16; - int r[NumberOfColors]; - int g[NumberOfColors]; - int b[NumberOfColors]; - ColorGenerator(); + ColorGenerator() = delete; + + static ColorDefault cDefault; + static ColorHSV15 cHSV15; public: - static QColor getColor(unsigned int i); - static QColor getAlphaColored(unsigned int i); + static QColor getColor(unsigned int i, ColorName color = ColorName::Default); + static QColor getAlphaColored(unsigned int i, ColorName color = ColorName::Default); }; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp new file mode 100644 index 00000000..9f708e98 --- /dev/null +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2015, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + * Iron Prando da Silva + */ + +#include "colorobject.h" + + +QColor ColorObject::getColor(unsigned int i) +{ + i = i % numberOfColors; + QColor result(r[i], g[i], b[i]); + result.setAlpha(130); + return result; +} + +QColor ColorObject::getAlphaColored(unsigned int i) +{ + const int minAlpha = 50; + const int alphaLevels = 20 - 255 / minAlpha; + + int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); + i = (i / alphaLevels) % numberOfColors; + QColor result(r[i], g[i], b[i]); + result.setAlpha(alpha); + + return result; +} + +ColorDefault::ColorDefault() +{ + numberOfColors = 16; + + r.resize(numberOfColors); + g.resize(numberOfColors); + b.resize(numberOfColors); + + r[0] = 0xFF; + r[1] = 0x00; + r[2] = 0x00; + r[3] = 0xFF; + g[0] = 0x00; + g[1] = 0xFF; + g[2] = 0x00; + g[3] = 0xFF; + b[0] = 0x00; + b[1] = 0x00; + b[2] = 0xFF; + b[3] = 0x00; + + r[4] = 0xFF; + r[5] = 0x00; + r[6] = 0xFF; + r[7] = 0x6B; + g[4] = 0x00; + g[5] = 0xFF; + g[6] = 0xA5; + g[7] = 0x8E; + b[4] = 0xFF; + b[5] = 0xFF; + b[6] = 0x00; + b[7] = 0x23; + + r[8] = 0x8A; + r[9] = 0xFF; + r[10] = 0x7C; + r[11] = 0x00; + g[8] = 0x2B; + g[9] = 0xD7; + g[10] = 0xFC; + g[11] = 0x00; + b[8] = 0xE2; + b[9] = 0x00; + b[10] = 0x00; + b[11] = 0x80; + + r[12] = 0x80; + r[13] = 0x00; + r[14] = 0xEE; + r[15] = 0xFF; + g[12] = 0x00; + g[13] = 0x80; + g[14] = 0x82; + g[15] = 0x45; + b[12] = 0x00; + b[13] = 0x00; + b[14] = 0xEE; + b[15] = 0x00; +} + +ColorHSV15::ColorHSV15() +{ + numberOfColors = 15; + + r.resize(numberOfColors); + g.resize(numberOfColors); + b.resize(numberOfColors); + + r[0] = 0XFF; + r[1] = 0XFF; + r[2] = 0XFF; + r[3] = 0XD1; + r[4] = 0X6C; + r[5] = 0X08; + r[6] = 0X00; + r[7] = 0X00; + r[8] = 0X00; + r[9] = 0X00; + r[10] = 0X00; + r[11] = 0X54; + r[12] = 0XB9; + r[13] = 0XFF; + r[14] = 0XFF; + + g[0] = 0X00; + g[1] = 0X64; + g[2] = 0XC9; + g[3] = 0XFF; + g[4] = 0XFF; + g[5] = 0XFF; + g[6] = 0XFF; + g[7] = 0XFF; + g[8] = 0XD9; + g[9] = 0X74; + g[10] = 0X10; + g[11] = 0X00; + g[12] = 0X00; + g[13] = 0X00; + g[14] = 0X00; + + b[0] = 0X00; + b[1] = 0X00; + b[2] = 0X00; + b[3] = 0X00; + b[4] = 0X00; + b[5] = 0X00; + b[6] = 0X5C; + b[7] = 0XC1; + b[8] = 0XFF; + b[9] = 0XFF; + b[10] = 0XFF; + b[11] = 0XFF; + b[12] = 0XFF; + b[13] = 0XE1; + b[14] = 0X7C; +} diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h new file mode 100644 index 00000000..f54ee8f4 --- /dev/null +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + * Iron Prando da Silva + */ + +#pragma once + +#include + +class ColorObject +{ +protected: + int numberOfColors = 0; + + std::vector r; + std::vector g; + std::vector b; + // std::vector a; + + ColorObject() {}; + +public: + + virtual QColor getColor(unsigned int i); + virtual QColor getAlphaColored(unsigned int i); +}; + +class ColorDefault : public ColorObject +{ +public: + ColorDefault(); +}; + +class ColorHSV15 : public ColorObject +{ +public: + ColorHSV15(); +}; From 176aedf72bd7e9bcfec6d1c8f79965f915b53a40 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 23 Nov 2021 13:22:09 +0100 Subject: [PATCH 016/121] Minor correction to alpha distribution equation. --- DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp index 9f708e98..a3e21ca8 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -51,8 +51,9 @@ QColor ColorObject::getAlphaColored(unsigned int i) { const int minAlpha = 50; const int alphaLevels = 20 - 255 / minAlpha; - - int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); + const int alphaStep = (255. - minAlpha) / alphaLevels; + + int alpha = minAlpha + (int)(alphaStep * (i % alphaLevels)); i = (i / alphaLevels) % numberOfColors; QColor result(r[i], g[i], b[i]); result.setAlpha(alpha); From 8fbe3a6fb47a1e0d82d6e634795e4b1bd9a4389a Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 25 Nov 2021 14:05:14 +0100 Subject: [PATCH 017/121] Renamed 'Alpha Colored' to 'Rainbow Colored'. --- .../businessObjects/phases/phase.cpp | 4 ++-- .../presentation/tracedrawingproperties.h | 2 +- DRAMSys/traceAnalyzer/presentation/traceplot.cpp | 16 ++++++++-------- DRAMSys/traceAnalyzer/presentation/traceplot.h | 4 ++-- .../presentation/util/colorgenerator.cpp | 6 +++--- .../presentation/util/colorgenerator.h | 2 +- .../presentation/util/colorobject.cpp | 2 +- .../presentation/util/colorobject.h | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 0e191fb9..c89bc35f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -184,8 +184,8 @@ QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const case ColorGrouping::Thread: return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); break; - case ColorGrouping::AlphaTransaction: - return ColorGenerator::getAlphaColored(transaction.lock()->id, ColorName::HSV15); + case ColorGrouping::RainbowTransaction: + return ColorGenerator::getRainbowColored(transaction.lock()->id, ColorName::HSV15); break; case ColorGrouping::Transaction: diff --git a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h index 6c437ad0..7b5dfc67 100644 --- a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h +++ b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h @@ -57,7 +57,7 @@ enum class ColorGrouping PhaseType, Transaction, Thread, - AlphaTransaction + RainbowTransaction }; class TracePlot; diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index 7c986afd..0234e14f 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -150,10 +150,10 @@ void TracePlot::setUpActions() QObject::connect(setColorGroupingTransaction, SIGNAL(triggered()), this, SLOT(on_colorGroupingTransaction())); - setColorGroupingAlphaTransaction = new QAction("Group by Transaction - Alpha Colored", this); - addAction(setColorGroupingAlphaTransaction); - QObject::connect(setColorGroupingAlphaTransaction, SIGNAL(triggered()), this, - SLOT(on_colorGroupingAlphaTransaction())); + setColorGroupingRainbowTransaction = new QAction("Group by Transaction - Rainbow Colored", this); + addAction(setColorGroupingRainbowTransaction); + QObject::connect(setColorGroupingRainbowTransaction, SIGNAL(triggered()), this, + SLOT(on_colorGroupingRainbowTransaction())); setColorGroupingThread = new QAction("Group by Thread", this); setColorGroupingThread->setCheckable(true); @@ -231,7 +231,7 @@ void TracePlot::setUpContextMenu() QMenu *colorGroupingSubMenu = new QMenu("Group by", contextMenu); colorGroupingSubMenu->addActions( - {setColorGroupingPhase, setColorGroupingTransaction, setColorGroupingThread, setColorGroupingAlphaTransaction}); + {setColorGroupingPhase, setColorGroupingTransaction, setColorGroupingRainbowTransaction, setColorGroupingThread}); contextMenu->addMenu(colorGroupingSubMenu); dependenciesSubMenu = new QMenu("Show dependencies", contextMenu); @@ -596,10 +596,10 @@ void TracePlot::on_colorGroupingTransaction() replot(); } -void TracePlot::on_colorGroupingAlphaTransaction() +void TracePlot::on_colorGroupingRainbowTransaction() { - drawingProperties.colorGrouping = ColorGrouping::AlphaTransaction; - Q_EMIT(colorGroupingChanged(ColorGrouping::AlphaTransaction)); + drawingProperties.colorGrouping = ColorGrouping::RainbowTransaction; + Q_EMIT(colorGroupingChanged(ColorGrouping::RainbowTransaction)); replot(); } diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.h b/DRAMSys/traceAnalyzer/presentation/traceplot.h index c3ec388c..560b819f 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.h +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.h @@ -108,7 +108,7 @@ private Q_SLOTS: void on_colorGroupingPhase(); void on_colorGroupingTransaction(); void on_colorGroupingThread(); - void on_colorGroupingAlphaTransaction(); + void on_colorGroupingRainbowTransaction(); void on_goToTransaction(); void on_goToPhase(); void on_deselectAll(); @@ -181,7 +181,7 @@ private: QAction *setColorGroupingPhase; QAction *setColorGroupingTransaction; QAction *setColorGroupingThread; - QAction *setColorGroupingAlphaTransaction; + QAction *setColorGroupingRainbowTransaction; QAction *exportToPdf; ToggleCollapsedAction *toggleCollapsedState; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index 11cf1023..c42339f5 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -51,13 +51,13 @@ QColor ColorGenerator::getColor(unsigned int i, ColorName color) return {0, 0, 0}; } -QColor ColorGenerator::getAlphaColored(unsigned int i, ColorName color) +QColor ColorGenerator::getRainbowColored(unsigned int i, ColorName color) { switch(color) { case ColorName::Default: - return cDefault.getAlphaColored(i); + return cDefault.getRainbowColored(i); case ColorName::HSV15: - return cHSV15.getAlphaColored(i); + return cHSV15.getRainbowColored(i); } return {0, 0, 0}; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h index 7897393d..e1e98ec0 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h @@ -60,7 +60,7 @@ private: public: static QColor getColor(unsigned int i, ColorName color = ColorName::Default); - static QColor getAlphaColored(unsigned int i, ColorName color = ColorName::Default); + static QColor getRainbowColored(unsigned int i, ColorName color = ColorName::Default); }; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp index a3e21ca8..a9a4e82b 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -47,7 +47,7 @@ QColor ColorObject::getColor(unsigned int i) return result; } -QColor ColorObject::getAlphaColored(unsigned int i) +QColor ColorObject::getRainbowColored(unsigned int i) { const int minAlpha = 50; const int alphaLevels = 20 - 255 / minAlpha; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h index f54ee8f4..d3ec584c 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h @@ -55,7 +55,7 @@ protected: public: virtual QColor getColor(unsigned int i); - virtual QColor getAlphaColored(unsigned int i); + virtual QColor getRainbowColored(unsigned int i); }; class ColorDefault : public ColorObject From 910fc0196290901230f668169c1cdeace8289e21 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 14:44:35 +0100 Subject: [PATCH 018/121] Began adding base algorithm for dependency calculations. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../phasedependenciestracker.cpp | 134 ++++++++++++++++++ .../phasedependenciestracker.h | 45 ++++++ .../businessObjects/phases/phasedependency.h | 4 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 12 +- DRAMSys/traceAnalyzer/data/tracedb.h | 3 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 39 +++-- DRAMSys/traceAnalyzer/tracefiletab.h | 1 + DRAMSys/traceAnalyzer/tracefiletab.ui | 9 ++ 9 files changed, 218 insertions(+), 30 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 07b15164..2bb5ebba 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -91,6 +91,7 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp + businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp new file mode 100644 index 00000000..715eed86 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -0,0 +1,134 @@ + +#include "phasedependenciestracker.h" + +void +PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector& commands) { + mDropTable(tdb); + mCreateTable(tdb); + + auto& phases = mGetAllPhases(tdb, commands); + + auto& entries = mCalculateDependencies(phases); + + mInsertIntoTable(tdb, entries); + +} + +void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { + QString command = "DROP TABLE DirectDependencies; "; + + auto query = mExecuteQuery(tdb, command); + query.finish(); +} + +void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { + QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID, DependencyPhaseName ); "; + + auto query = mExecuteQuery(tdb, command); + query.finish(); +} + +void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { + auto numberOfEntries = entries.size(); + size_t bulkInsertionSize = 1000; + + QString command; + size_t counter = 0; + for (auto& entry : entries) { + if (counter == 0) { + // TODO Reset command string and add first command + command = ""; + + } else if (counter == bulkInsertionSize) { + // TODO Write last command and submit + + counter = 0; + + } else { + // TODO + + counter++; + + } + + } + + if (counter != 0) { + // TODO Submit command string + } + +} + +const std::vector> +PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { + std::vector> phases; + + QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " + " FROM Phases " + " INNER JOIN Transactions " + " ON Phases.Transact=Transactions.ID " + " WHERE PhaseName IN ("; + + for (auto cmd : commands) { + queryStr += '\"' + QString::fromStdString(cmd + "\","); + } + queryStr.back() = ')'; + queryStr += " ORDER BY PhaseBegin "; + + auto query = mExecuteQuery(tdb, queryStr); + + if (!query.last()) { + throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" + "Could not retrieve number of rows\n").toStdString(), + tdb.pathToDB.toStdString()); + } + + size_t nrows = query.at() + 1; + + if (!query.first()) { + throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" + "Could not safely retrieve number of rows\n").toStdString(), + tdb.pathToDB.toStdString()); + } + + phases.resize(nrows); + + size_t rowIt = 0; + do { + DBPhaseEntry phase; + phase.id = query.value(0).toLongLong(); + phase.phaseName = query.value(1).toString(); + phase.phaseBegin = query.value(2).toLongLong(); + phase.phaseEnd = query.value(3).toLongLong(); + phase.transact = query.value(4).toLongLong(); + phase.tBank = query.value(5).toLongLong(); + phase.tRank = query.value(6).toLongLong(); + + phases[rowIt] = std::make_shared(phase); + ++rowIt; + } while (query.next()); + + if (rowIt != nrows) { + throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); + } + + return phases; +} + +const std::vector +PhaseDependenciesTracker::mCalculateDependencies(const std::vector>& transactions) { + std::vector entries; + + // TODO Get dependency object for specific trace + // TODO Main dependency calculation loop + + return entries; +} + +QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString queryStr) { + QSqlQuery query(tdb.getDatabase()); + query.prepare(queryStr); + tdb.executeQuery(query); + + return query; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h new file mode 100644 index 00000000..fcfe7021 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -0,0 +1,45 @@ + +#pragma once + +#include +#include +#include + +#include "data/tracedb.h" + +struct DBPhaseEntry { + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; + size_t tRank; +}; + +struct DBDependencyEntry { + size_t delayedPhaseID; + QString delayedPhaseName; + QString dependencyType; + QString timeDependency; + size_t dependencyPhaseID; + QString dependencyPhaseName; +}; + +class PhaseDependenciesTracker { +public: + static void calculateDependencies(TraceDB& tdb, const std::vector& commands); + +private: + static void mDropTable(TraceDB& tdb); + static void mCreateTable(TraceDB& tdb); + static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); + + static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::vector>& phases); + + static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); + + PhaseDependenciesTracker() = delete; + ~PhaseDependenciesTracker() = delete; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index 41be1c1e..fa203556 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -48,8 +48,8 @@ class Phase; enum DependencyType { - Bank, - Rank, + IntraBank, + IntraRank, InterRank }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 5564d843..1a3541b9 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -151,10 +151,12 @@ std::vector> TraceDB::getTransactionsInTimespan(con bool TraceDB::checkDependencyTableExists() { executeQuery(checkDependenciesExist); - if (checkDependenciesExist.next() && checkDependenciesExist.value(0).toInt() == 1) - return true; - return false; + bool exists = checkDependenciesExist.next() && checkDependenciesExist.value(0).toInt() == 1; + + checkDependenciesExist.finish(); + + return exists; } void TraceDB::updateDependenciesInTimespan(const Timespan &span) @@ -598,11 +600,11 @@ void TraceDB::mUpdateDependenciesFromQuery(QSqlQuery &query) QString dependencyTypeStr = query.value(2).toString(); if (dependencyTypeStr == "bank") { - type = DependencyType::Bank; + type = DependencyType::IntraBank; } else if (dependencyTypeStr == "rank") { - type = DependencyType::Rank; + type = DependencyType::IntraRank; } else if (dependencyTypeStr == "interRank") { diff --git a/DRAMSys/traceAnalyzer/data/tracedb.h b/DRAMSys/traceAnalyzer/data/tracedb.h index 8b759f24..4196f106 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.h +++ b/DRAMSys/traceAnalyzer/data/tracedb.h @@ -151,6 +151,9 @@ private: QVariant getParameterFromTable(const std::string& parameter, const std::string& table); std::map> _visiblePhases; // Updated at parseTransactionsFromQuery + + // At businessObjects/phasedependenciestracker.h + friend class PhaseDependenciesTracker; }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index bd6e72cb..ba09aa33 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -42,7 +42,7 @@ #include "businessObjects/commentmodel.h" #include "businessObjects/configmodels.h" #include "businessObjects/pythoncaller.h" -#include "businessObjects/tracetime.h" +#include "businessObjects/phasedependenciestracker.h" #include "presentation/traceselector.h" #include "qmessagebox.h" #include "queryeditor.h" @@ -310,30 +310,23 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } } -bool TraceFileTab::eventFilter(QObject *object, QEvent *event) -{ - if (auto canvas = qobject_cast(object)) - { - if (event->type() == QEvent::MouseButtonDblClick) - { - QMouseEvent *mouseEvent = static_cast(event); +void TraceFileTab::on_calculateDependencies_clicked() { + // TODO - anything else? Update view maybe? + // TODO - For now fixed, but must be selectable + std::vector commands = { + "ACT", + "PRE", + "RD", + "RDA", + "WR", + "WRA", + "PDE", + "PDX", + "PREA" + }; - if (mouseEvent->button() != Qt::LeftButton) - return false; + PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), commands); - QwtPlot *plot = canvas->plot(); - - double realTime = plot->invTransform(QwtPlot::xBottom, mouseEvent->x()); - - // Convert from seconds to picoseconds - traceTime time = realTime * 1000 * 1000 * 1000 * 1000; - - navigator->navigateToTime(time); - return true; - } - } - - return QWidget::eventFilter(object, event); } void TraceFileTab::on_startLatencyAnalysis_clicked() diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index a345bbc1..cd36887f 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -117,6 +117,7 @@ Q_SIGNALS: private Q_SLOTS: void on_latencyTreeView_doubleClicked(const QModelIndex &index); + void on_calculateDependencies_clicked(); void on_startLatencyAnalysis_clicked(); void on_startPowerAnalysis_clicked(); }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index 22a0a210..f2cac71d 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -208,6 +208,13 @@ Dependency Information + + + + Calculate Dependencies + + + @@ -247,6 +254,7 @@ + @@ -295,6 +303,7 @@ + true From e04fae1ab5798ae51eaf919da0bcd22f70e9e794 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 16:56:52 +0100 Subject: [PATCH 019/121] Began adding time dependencies interface for to be generated code. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../timedependenciesIF.cpp | 85 +++++++++++++++++++ .../dramTimeDependencies/timedependenciesIF.h | 44 ++++++++++ 3 files changed, 130 insertions(+) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 2bb5ebba..fcf4a5a2 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -95,6 +95,7 @@ add_executable(TraceAnalyzer businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp + businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp new file mode 100644 index 00000000..89cb4052 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -0,0 +1,85 @@ + +#include "timedependenciesIF.h" + +#include + +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { + mGetMemspec(tdb); + +} + +QMap +DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { + QMap dependenciesMap; + + dependenciesMap = mSpecializedGetDependencies(); + + mFilterDependencyMap(dependenciesMap, commands); + + auto it = dependenciesMap.begin(); + while (it != dependenciesMap.end()) { + mFilterDependencyList(it.value().dependencies, commands); + it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + } + + return dependenciesMap; +} + +void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT Memspec FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + QString memSpecJson = sqlQuery.value(0).toString(); + sqlQuery.finish(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + mMemspecJson = jsonDocument.object()["memspec"].toObject(); + +} + +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { + std::vector newDepList(dependencyList.size()); + + std::copy_if( + dependencyList.begin(), + dependencyList.end(), + newDepList.begin(), + [ commands ](const TimeDependency& dep) { + return dep.phaseDep == "NAW" + || ( + std::find_if( + commands.begin(), + commands.end(), + [ dep ](const QString& cmd) { + return dep.phaseDep == cmd; + } + ) != commands.end() ) + ; + } + ); + + newDepList.shrink_to_fit(); + + dependencyList = newDepList; + +} + +void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { + // TODO +} + +size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { + auto maxElement = std::max_element( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& dep1, const TimeDependency& dep2) { + return dep1.timeValue < dep2.timeValue; + } + ); + + if (maxElement == dependencyList.end()) return 0; + + return maxElement->timeValue; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h new file mode 100644 index 00000000..7234090d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -0,0 +1,44 @@ + +#pragma once + +#include +#include +#include +#include + +#include "data/tracedb.h" +#include "businessObjects/phases/phasedependency.h" + +struct TimeDependency { + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; +}; + +struct PhaseTimeDependencies { + QString phaseName; + std::vector dependencies; + size_t maxTime; +}; + +class DRAMTimeDependenciesIF { +public: + DRAMTimeDependenciesIF(const TraceDB& tdb); + virtual ~DRAMTimeDependenciesIF() = default; + + QMap getDependencies(const std::vector& commands) const; + +protected: + void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; + void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + size_t mFindVectorMaximum(const std::vector& dependencyList) const; + +protected: + QJsonObject mMemspecJson; + virtual void mInitializeValues() = 0; + virtual QMap mSpecializedGetDependencies() const = 0; + +private: + void mGetMemspec(const TraceDB& tdb); +}; From 98afd985631135da7a28f3b69305176a7119e8ef Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 12:43:19 +0100 Subject: [PATCH 020/121] Finished interface class for auto-generated time dependencies code. --- .../timedependenciesIF.cpp | 88 ++++++++++++++----- .../dramTimeDependencies/timedependenciesIF.h | 15 ++-- .../phasedependenciestracker.cpp | 5 +- DRAMSys/traceAnalyzer/tracefiletab.cpp | 7 +- 4 files changed, 84 insertions(+), 31 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 89cb4052..8f6c8c7f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,18 +8,26 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -QMap -DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { - QMap dependenciesMap; +std::map +DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { + std::map dependenciesMap; + + std::sort( + dependencyFilter.begin(), + dependencyFilter.end(), + [](const QString& s1, const QString& s2) { + return s1.compare(s2); + } + ); dependenciesMap = mSpecializedGetDependencies(); - mFilterDependencyMap(dependenciesMap, commands); + mFilterDependencyMap(dependenciesMap, dependencyFilter); auto it = dependenciesMap.begin(); while (it != dependenciesMap.end()) { - mFilterDependencyList(it.value().dependencies, commands); - it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + mFilterDependencyList(it->second.dependencies, dependencyFilter); + it->second.maxTime = mFindVectorMaximum(it->second.dependencies); } return dependenciesMap; @@ -39,24 +47,26 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); std::copy_if( dependencyList.begin(), dependencyList.end(), newDepList.begin(), - [ commands ](const TimeDependency& dep) { - return dep.phaseDep == "NAW" - || ( - std::find_if( - commands.begin(), - commands.end(), - [ dep ](const QString& cmd) { - return dep.phaseDep == cmd; - } - ) != commands.end() ) - ; + [ dependencyFilter ](const TimeDependency& dep) { + auto it = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dep.phaseDep, + [](const QString& cmd, const QString& value) { + return value.compare(cmd); + } + ); + + if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; + + return false; } ); @@ -66,8 +76,46 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { - // TODO +void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { + if (!dependencyMap.empty()) { + + auto itFilter = dependencyFilter.begin(); + auto itFilterLast = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dependencyMap.rbegin()->first + ); + + auto itDependencyMap = dependencyMap.begin(); + + while (true) { + + auto pair = std::mismatch( + itFilter, + itFilterLast, + itDependencyMap, + [](const QString& cmd, const std::pair& vpair) { + return cmd == vpair.first; + } + ); + + if (pair.first == dependencyFilter.end() || pair.second == dependencyMap.end()) { + dependencyMap.erase(pair.second, dependencyMap.end()); + break; + + } else if (pair.first->compare(pair.second->first) < 0) { + ++(pair.first); + + } else { + pair.second = dependencyMap.erase(pair.second); + + } + + itFilter = pair.first; + itDependencyMap = pair.second; + + } + } } size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 7234090d..2d0c657f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "data/tracedb.h" @@ -27,17 +27,20 @@ public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - QMap getDependencies(const std::vector& commands) const; + std::map getDependencies(std::vector& dependencyFilter) const; protected: - void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; - void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; - + protected: QJsonObject mMemspecJson; + +// To be implemented +protected: virtual void mInitializeValues() = 0; - virtual QMap mSpecializedGetDependencies() const = 0; + virtual std::map mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 715eed86..667a046d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -29,12 +29,13 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { + static const size_t bulkInsertionSize = 1000; + auto numberOfEntries = entries.size(); - size_t bulkInsertionSize = 1000; QString command; size_t counter = 0; - for (auto& entry : entries) { + for (const auto& entry : entries) { if (counter == 0) { // TODO Reset command string and add first command command = ""; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index ba09aa33..30fe32f2 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -313,7 +313,7 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) void TraceFileTab::on_calculateDependencies_clicked() { // TODO - anything else? Update view maybe? // TODO - For now fixed, but must be selectable - std::vector commands = { + std::vector dependencyFilter = { "ACT", "PRE", "RD", @@ -322,10 +322,11 @@ void TraceFileTab::on_calculateDependencies_clicked() { "WRA", "PDE", "PDX", - "PREA" + "PREA", + "NAW" }; - PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), commands); + PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); } From 199df97683c0650ae3de3516af68674bf9991a0c Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 13:29:06 +0100 Subject: [PATCH 021/121] Added stl map QString comparator. --- .../timedependenciesIF.cpp | 22 +++++++++++-------- .../dramTimeDependencies/timedependenciesIF.h | 16 +++++++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 8f6c8c7f..692c87c4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,16 +8,14 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -std::map +DependencyMap DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { - std::map dependenciesMap; + DependencyMap dependenciesMap; std::sort( dependencyFilter.begin(), dependencyFilter.end(), - [](const QString& s1, const QString& s2) { - return s1.compare(s2); - } + QStringsComparator::compareQStrings ); dependenciesMap = mSpecializedGetDependencies(); @@ -59,9 +57,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - [](const QString& cmd, const QString& value) { - return value.compare(cmd); - } + QStringsComparator::compareQStrings ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -76,7 +72,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -131,3 +127,11 @@ size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vectortimeValue; } + +bool QStringsComparator::operator()(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} + +bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 2d0c657f..a9bbde13 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -22,16 +22,24 @@ struct PhaseTimeDependencies { size_t maxTime; }; + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2); + static bool compareQStrings(const QString& s1, const QString& s2); +}; + +typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - std::map getDependencies(std::vector& dependencyFilter) const; + DependencyMap getDependencies(std::vector& dependencyFilter) const; protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; - void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; protected: @@ -40,8 +48,10 @@ protected: // To be implemented protected: virtual void mInitializeValues() = 0; - virtual std::map mSpecializedGetDependencies() const = 0; + virtual DependencyMap mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); + }; + From 527f7fb492ff53a676c4e768c683cdf30eeaae17 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 15:50:26 +0100 Subject: [PATCH 022/121] Started adding manual code for DDR3 time dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 7 +- .../DDR3TimeDependencies.cpp | 80 +++++++++++++++++++ .../DDR3TimeDependencies.h | 59 ++++++++++++++ ...nciesIF.cpp => dramtimedependenciesIF.cpp} | 21 +++-- ...endenciesIF.h => dramtimedependenciesIF.h} | 20 +++-- .../dramtimedependencyfactory.cpp | 17 ++++ .../dramtimedependencyfactory.h | 15 ++++ .../phasedependenciestracker.cpp | 6 +- .../phasedependenciestracker.h | 3 +- 9 files changed, 209 insertions(+), 19 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{timedependenciesIF.cpp => dramtimedependenciesIF.cpp} (85%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{timedependenciesIF.h => dramtimedependenciesIF.h} (72%) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index fcf4a5a2..70850304 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -91,11 +91,9 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp - businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp - businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp @@ -104,6 +102,11 @@ add_executable(TraceAnalyzer businessObjects/configmodels.cpp businessObjects/commentmodel.cpp + businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp + businessObjects/phasedependenciestracker.cpp + selectmetrics.ui preferences.ui evaluationtool.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp new file mode 100644 index 00000000..e1e375cf --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -0,0 +1,80 @@ + +#include "DDR3TimeDependencies.h" + +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTimeDependenciesIF(memspec) { + mInitializeValues(); +} + +void DDR3TimeDependencies::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toLongLong(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toLongLong(); + clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toLongLong(); + + nActivateWindow = 4; + + tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toLongLong(); + tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toLongLong(); + tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toLongLong(); + tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toLongLong(); + tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toLongLong(); + tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toLongLong(); + tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toLongLong(); + tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toLongLong(); + tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toLongLong(); + tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toLongLong(); + tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toLongLong(); + tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toLongLong(); + tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toLongLong(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toLongLong(); + tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toLongLong(); + tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toLongLong(); + tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toLongLong(); + tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toLongLong(); + tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toLongLong(); + tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toLongLong(); + tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toLongLong(); + tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toLongLong(); + tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toLongLong(); + tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toLongLong(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + + tPD = tCKE; + tBURST = (int) ((burstLength / dataRate) * clk); + tRDWR = tRL + tBURST + 2 * clk - tWL; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tBURST + tWTR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tWRPRE = tWL + tBURST + tWR; + tRDPDEN = tRL + tBURST + clk; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + clk; +} + +DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("ACT"), + std::forward_as_tuple( + std::initializer_list{ + TimeDependency{tRC, "ACT", DependencyType::IntraBank, "tRC"}, + TimeDependency{tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + TimeDependency{tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + TimeDependency{tRP, "PRE", DependencyType::IntraBank, "tRP"}, + TimeDependency{tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + TimeDependency{tRP, "PREA", DependencyType::IntraRank, "tRP"}, + TimeDependency{tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + TimeDependency{tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + TimeDependency{tRFC, "REFA", DependencyType::IntraRank, "tRFC"}, + TimeDependency{tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + TimeDependency{tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + } + ) + ); + + // TODO add all the rest + + return dmap; +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h new file mode 100644 index 00000000..793b50f1 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -0,0 +1,59 @@ + +#pragma once + +#include "dramtimedependenciesIF.h" + +class DDR3TimeDependencies : public DRAMTimeDependenciesIF { +public: + DDR3TimeDependencies(const QJsonObject& memspec); + +protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + +protected: + size_t burstLength; + size_t dataRate; + size_t clk; + + size_t nActivateWindow; + + size_t tRP; + size_t tRAS; + size_t tRC; + size_t tRTP; + size_t tRRD; + size_t tCCD; + size_t tRCD; + size_t tNAW; + size_t tRL; + size_t tWL; + size_t tWR; + size_t tWTR; + size_t tCKESR; + size_t tCKE; + size_t tXP; + size_t tXPDLL; + size_t tXS; + size_t tXSDLL; + size_t tAL; + size_t tRFC; + size_t tREFI; + size_t tRTRS; + + size_t tACTPDEN; + size_t tPRPDEN; + size_t tREFPDEN; + + size_t tPD; + size_t tBURST; + size_t tRDWR; + size_t tRDWR_R; + size_t tWRRD; + size_t tWRRD_R; + size_t tWRPRE; + size_t tRDPDEN; + size_t tWRPDEN; + size_t tWRAPDEN; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp similarity index 85% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 692c87c4..c740a801 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -1,10 +1,10 @@ -#include "timedependenciesIF.h" +#include "dramtimedependenciesIF.h" #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { - mGetMemspec(tdb); +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec) { + mMemspecJson = memspec; } @@ -31,7 +31,7 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); @@ -41,13 +41,16 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { sqlQuery.finish(); QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); - mMemspecJson = jsonDocument.object()["memspec"].toObject(); + return jsonDocument.object()["memspec"].toObject(); } void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); + // TODO - probably there is a smarter way to filter these values, + // although the lists are not to be greater than 20-50 elements + std::copy_if( dependencyList.begin(), dependencyList.end(), @@ -70,6 +73,14 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList = newDepList; + std::sort( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& v1, const TimeDependency& v2) { + return v1.timeValue < v2.timeValue; + } + ); + } void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h similarity index 72% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index a9bbde13..7071ef84 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -4,6 +4,10 @@ #include #include #include + +#include +#include +#include #include #include "data/tracedb.h" @@ -17,7 +21,8 @@ struct TimeDependency { }; struct PhaseTimeDependencies { - QString phaseName; + explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} + std::vector dependencies; size_t maxTime; }; @@ -32,11 +37,13 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const TraceDB& tdb); + DRAMTimeDependenciesIF(const QJsonObject& memspec); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; + static const QJsonObject getMemspec(const TraceDB& tdb); + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; @@ -45,13 +52,10 @@ protected: protected: QJsonObject mMemspecJson; -// To be implemented +// To be implemented by the specializing class protected: - virtual void mInitializeValues() = 0; - virtual DependencyMap mSpecializedGetDependencies() const = 0; - -private: - void mGetMemspec(const TraceDB& tdb); + virtual void mInitializeValues() {} ; + virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp new file mode 100644 index 00000000..f9c72c91 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -0,0 +1,17 @@ + +#include "dramtimedependencyfactory.h" + +DRAMTimeDependenciesIF DRAMTimeDependencyFactory::make(const TraceDB& tdb) { + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); + QString deviceType = memspec["memspec"]["memoryType"].toString(); + + if (deviceType == "DDR3") { + return DDR3TimeDependencies(memspec); + + } else { + // TODO maybe throw? + return DRAMTimeDependenciesIF(memspec); + + } + +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h new file mode 100644 index 00000000..d6232ffe --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -0,0 +1,15 @@ + +#pragma once + +#include "dramtimedependenciesIF.h" +#include "DDR3TimeDependencies.h" +#include "data/tracedb.h" + +class DRAMTimeDependencyFactory { +public: + static DRAMTimeDependenciesIF make(const TraceDB& tdb); + +private: + DRAMTimeDependencyFactory() = delete; + ~DRAMTimeDependencyFactory() = delete; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 667a046d..984a8886 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -8,7 +8,7 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector< auto& phases = mGetAllPhases(tdb, commands); - auto& entries = mCalculateDependencies(phases); + auto& entries = mCalculateDependencies(tdb, phases); mInsertIntoTable(tdb, entries); @@ -117,10 +117,10 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const std::vector>& transactions) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& transactions) { std::vector entries; - // TODO Get dependency object for specific trace + DRAMTimeDependenciesIF deviceDependencies = DRAMTimeDependencyFactory::make(tdb); // TODO Main dependency calculation loop return entries; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index fcfe7021..a46d6c05 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -6,6 +6,7 @@ #include #include "data/tracedb.h" +#include "dramTimeDependencies/dramtimedependencyfactory.h" struct DBPhaseEntry { size_t id; @@ -36,7 +37,7 @@ private: static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const std::vector>& phases); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); From da46440f2f382d096f032e6c8ffd244adb0c8cc7 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 11:07:21 +0100 Subject: [PATCH 023/121] Added DDR3 time dependencies code manually. --- .../DDR3TimeDependencies.cpp | 210 ++++++++++++++++-- 1 file changed, 197 insertions(+), 13 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index e1e375cf..237939d3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -59,22 +59,206 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { std::forward_as_tuple("ACT"), std::forward_as_tuple( std::initializer_list{ - TimeDependency{tRC, "ACT", DependencyType::IntraBank, "tRC"}, - TimeDependency{tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, - TimeDependency{tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, - TimeDependency{tRP, "PRE", DependencyType::IntraBank, "tRP"}, - TimeDependency{tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, - TimeDependency{tRP, "PREA", DependencyType::IntraRank, "tRP"}, - TimeDependency{tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - TimeDependency{tXP, "PDXP", DependencyType::IntraRank, "tXP"}, - TimeDependency{tRFC, "REFA", DependencyType::IntraRank, "tRFC"}, - TimeDependency{tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - TimeDependency{tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tNAW, "NAW", DependencyType::IntraRank, "tNAW"} } ) ); - // TODO add all the rest + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("RD"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("RDA"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tWRPRE - tRTP, "WR", DependencyType::IntraBank, "tWRPRE - tRTP"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("WR"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PREPB"), + std::forward_as_tuple( + std::initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PREAB"), + std::forward_as_tuple( + std::initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("REFAB"), + std::forward_as_tuple( + std::initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("REFAB"), + std::forward_as_tuple( + std::initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDXA"), + std::forward_as_tuple( + std::initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDEP"), + std::forward_as_tuple( + std::initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDXP"), + std::forward_as_tuple( + std::initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("SREFEN"), + std::forward_as_tuple( + std::initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {std::max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {std::max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("SREFEX"), + std::forward_as_tuple( + std::initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} + } + ) + ); return dmap; -} \ No newline at end of file +} From 95d4014d2da463b034e8d8cef9c6c6d3b057e174 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 15:14:39 +0100 Subject: [PATCH 024/121] Added main calculation loop and other modifications and corrections. Still missing table data storing and test. --- .../DDR3TimeDependencies.cpp | 83 ++++++++----- .../DDR3TimeDependencies.h | 79 ++++++------- .../dramtimedependenciesIF.cpp | 14 ++- .../dramtimedependenciesIF.h | 9 +- .../dramtimedependencyfactory.cpp | 8 +- .../dramtimedependencyfactory.h | 4 +- .../phasedependenciestracker.cpp | 109 ++++++++++++++++-- .../phasedependenciestracker.h | 6 +- .../phases/phasedependency.cpp | 20 +++- .../businessObjects/phases/phasedependency.h | 2 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 7 +- 11 files changed, 244 insertions(+), 97 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 237939d3..5b494732 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -6,41 +6,41 @@ DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTim } void DDR3TimeDependencies::mInitializeValues() { - burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toLongLong(); - dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toLongLong(); - clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toLongLong(); + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toInt(); + clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toInt(); nActivateWindow = 4; - tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toLongLong(); - tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toLongLong(); - tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toLongLong(); - tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toLongLong(); - tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toLongLong(); - tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toLongLong(); - tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toLongLong(); - tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toLongLong(); - tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toLongLong(); - tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toLongLong(); - tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toLongLong(); - tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toLongLong(); - tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toLongLong(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); - tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toLongLong(); - tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toLongLong(); - tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toLongLong(); - tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toLongLong(); - tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toLongLong(); - tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toLongLong(); - tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toLongLong(); - tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toLongLong(); - tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toLongLong(); - tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toLongLong(); - tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toLongLong(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toInt(); + tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toInt(); + tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toInt(); + tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toInt(); + tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toInt(); + tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toInt(); + tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toInt(); + tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toInt(); + tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toInt(); + tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toInt(); + tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toInt(); + tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toInt(); + tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toInt(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); + tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toInt(); + tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toInt(); + tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toInt(); + tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toInt(); + tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toInt(); + tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toInt(); + tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toInt(); + tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toInt(); + tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toInt(); + tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toInt(); + tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toInt(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); tPD = tCKE; - tBURST = (int) ((burstLength / dataRate) * clk); + tBURST = (uint) ((burstLength / (float) dataRate) * clk); tRDWR = tRL + tBURST + 2 * clk - tWL; tRDWR_R = tRL + tBURST + tRTRS - tWL; tWRRD = tWL + tBURST + tWTR; @@ -49,6 +49,7 @@ void DDR3TimeDependencies::mInitializeValues() { tRDPDEN = tRL + tBURST + clk; tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + clk; + } DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { @@ -135,6 +136,26 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ) ); + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("WRA"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + } + ) + ); + dmap.emplace( std::piecewise_construct, std::forward_as_tuple("PREPB"), @@ -182,7 +203,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { dmap.emplace( std::piecewise_construct, - std::forward_as_tuple("REFAB"), + std::forward_as_tuple("PDEA"), std::forward_as_tuple( std::initializer_list{ {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 793b50f1..53568c34 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -10,50 +10,47 @@ public: protected: void mInitializeValues() override; DependencyMap mSpecializedGetDependencies() const override; - + protected: - size_t burstLength; - size_t dataRate; - size_t clk; + uint burstLength; + uint dataRate; - size_t nActivateWindow; + uint tRP; + uint tRAS; + uint tRC; + uint tRTP; + uint tRRD; + uint tCCD; + uint tRCD; + uint tNAW; + uint tRL; + uint tWL; + uint tWR; + uint tWTR; + uint tCKESR; + uint tCKE; + uint tXP; + uint tXPDLL; + uint tXS; + uint tXSDLL; + uint tAL; + uint tRFC; + uint tREFI; + uint tRTRS; - size_t tRP; - size_t tRAS; - size_t tRC; - size_t tRTP; - size_t tRRD; - size_t tCCD; - size_t tRCD; - size_t tNAW; - size_t tRL; - size_t tWL; - size_t tWR; - size_t tWTR; - size_t tCKESR; - size_t tCKE; - size_t tXP; - size_t tXPDLL; - size_t tXS; - size_t tXSDLL; - size_t tAL; - size_t tRFC; - size_t tREFI; - size_t tRTRS; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; - size_t tACTPDEN; - size_t tPRPDEN; - size_t tREFPDEN; - - size_t tPD; - size_t tBURST; - size_t tRDWR; - size_t tRDWR_R; - size_t tWRRD; - size_t tWRRD_R; - size_t tWRPRE; - size_t tRDPDEN; - size_t tWRPDEN; - size_t tWRAPDEN; + uint tPD; + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRRD_R; + uint tWRPRE; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index c740a801..0960d646 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -26,8 +26,11 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) while (it != dependenciesMap.end()) { mFilterDependencyList(it->second.dependencies, dependencyFilter); it->second.maxTime = mFindVectorMaximum(it->second.dependencies); + + ++it; } + return dependenciesMap; } @@ -60,7 +63,9 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - QStringsComparator::compareQStrings + [](const QString& cmd, const QString& depName){ + return cmd == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + } ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -102,7 +107,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, itFilterLast, itDependencyMap, [](const QString& cmd, const std::pair& vpair) { - return cmd == vpair.first; + return cmd.compare(vpair.first) == 0; } ); @@ -113,6 +118,8 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } else if (pair.first->compare(pair.second->first) < 0) { ++(pair.first); + } else if (pair.first->compare(pair.second->first) == 0) { + ++(pair.second); } else { pair.second = dependencyMap.erase(pair.second); @@ -123,9 +130,10 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } } + } -size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { +uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { auto maxElement = std::max_element( dependencyList.begin(), dependencyList.end(), diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index 7071ef84..cc818162 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -35,6 +35,7 @@ struct QStringsComparator { typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const QJsonObject& memspec); @@ -44,10 +45,13 @@ public: static const QJsonObject getMemspec(const TraceDB& tdb); + const uint getClk() const { return clk; } + const uint getNAW() const { return nActivateWindow; }; + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; - size_t mFindVectorMaximum(const std::vector& dependencyList) const; + uint mFindVectorMaximum(const std::vector& dependencyList) const; protected: QJsonObject mMemspecJson; @@ -56,6 +60,9 @@ protected: protected: virtual void mInitializeValues() {} ; virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; + + uint clk = 0; + uint nActivateWindow = 0; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index f9c72c91..65f41cc7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -1,16 +1,16 @@ #include "dramtimedependencyfactory.h" -DRAMTimeDependenciesIF DRAMTimeDependencyFactory::make(const TraceDB& tdb) { +std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); - QString deviceType = memspec["memspec"]["memoryType"].toString(); + QString deviceType = memspec["memoryType"].toString(); if (deviceType == "DDR3") { - return DDR3TimeDependencies(memspec); + return std::make_shared(memspec); } else { // TODO maybe throw? - return DRAMTimeDependenciesIF(memspec); + throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index d6232ffe..748c5ab1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -1,13 +1,15 @@ #pragma once +#include + #include "dramtimedependenciesIF.h" #include "DDR3TimeDependencies.h" #include "data/tracedb.h" class DRAMTimeDependencyFactory { public: - static DRAMTimeDependenciesIF make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); private: DRAMTimeDependencyFactory() = delete; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 984a8886..7a18e978 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -2,13 +2,13 @@ #include "phasedependenciestracker.h" void -PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { mDropTable(tdb); mCreateTable(tdb); auto& phases = mGetAllPhases(tdb, commands); - auto& entries = mCalculateDependencies(tdb, phases); + auto& entries = mCalculateDependencies(tdb, phases, commands); mInsertIntoTable(tdb, entries); @@ -61,7 +61,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " @@ -70,8 +70,8 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& transactions) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; - DRAMTimeDependenciesIF deviceDependencies = DRAMTimeDependencyFactory::make(tdb); - // TODO Main dependency calculation loop + // Get dependencies for tdb device + auto device = DRAMTimeDependencyFactory::make(tdb); + DependencyMap deviceDependencies = device->getDependencies(commands); + + // Tries to find all timing dependencies for each phase on the trace + std::vector tmpPotentialNAW; + tmpPotentialNAW.reserve(16); + for (size_t i = 1; i < phases.size(); i++) { + // NAW dependencies variables reset + tmpPotentialNAW.clear(); + size_t nawCount = 0; + + // Auxiliary variables + const auto& phase = phases[i]; + const size_t cmdBank = phase->tBank; + const size_t cmdRank = phase->tRank; + + // Get time dependency descriptions for the current phase + const auto& deps = deviceDependencies.at(phase->phaseName); + + // Loop all previous phases until there cannot be any more time dependencies + for (int j = i-1; j >= 0; j--) { + // Get next phase to analyse + const auto& otherPhase = phases[j]; + // Calculates the time difference in nanoseconds + const auto timeDiff = phase->phaseBegin - otherPhase->phaseBegin; + + // Time difference begin greater than the maximum possible dependency time ends the internal loop + if (timeDiff > deps.maxTime) break; + + // For each possible dependency for the current phase, + // checks if otherPhase would match as a dependency + for (const auto& dep : deps.dependencies) { + if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; + + if ( + dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank + || dep.depType == DependencyType::IntraRank && cmdBank != otherPhase->tRank + || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? + ) { + continue; + } + + if (dep.phaseDep == "NAW") { + if (otherPhase->phaseName == "ACT") { + if (timeDiff == dep.timeValue) { + // Captures only the first (or exactly matching time) ACT in + // the ACT window as a dependency + tmpPotentialNAW.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName + }); + } + nawCount++; + + } + + continue; // TODO should this continue here or should it be removed for potentially more time dependencies to be captured? + } + + if (timeDiff == dep.timeValue) { + entries.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName + }); + } + + } + + if (timeDiff == device->getClk()) { + entries.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(DependencyType::IntraRank), + "CommandBus", + otherPhase->id, + otherPhase->phaseName + }); + } + + } + + if (nawCount >= device->getNAW()) { + entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); + } + + } return entries; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index a46d6c05..a01c537a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -29,15 +29,15 @@ struct DBDependencyEntry { class PhaseDependenciesTracker { public: - static void calculateDependencies(TraceDB& tdb, const std::vector& commands); + static void calculateDependencies(TraceDB& tdb, std::vector& dependencyFilter); private: static void mDropTable(TraceDB& tdb); static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases); + static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index e76d0f8e..de6c65ff 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -129,4 +129,22 @@ void PhaseDependency::mDraw(QPoint &end, double depY, const TraceDrawingProperti drawText(painter, mTimeDependency, textPosition, alignment); } -} \ No newline at end of file +} + +QString PhaseDependency::dependencyTypeName(DependencyType dtype) { + switch(dtype) { + case IntraBank: + return "IntraBank"; + + case IntraRank: + return "IntraRank"; + + case InterRank: + return "InterRank"; + + default: + // TODO - maybe throw? + return ""; + + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index fa203556..439f973c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -68,6 +68,8 @@ public: bool draw(QPoint &end, const TraceDrawingProperties &drawingProperties, QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap); + static QString dependencyTypeName(DependencyType); + protected: DependencyType mType; QString mTimeDependency; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 30fe32f2..c5e9df52 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -313,17 +313,16 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) void TraceFileTab::on_calculateDependencies_clicked() { // TODO - anything else? Update view maybe? // TODO - For now fixed, but must be selectable - std::vector dependencyFilter = { + std::vector dependencyFilter = { "ACT", - "PRE", + "PREPB", "RD", "RDA", "WR", "WRA", "PDE", "PDX", - "PREA", - "NAW" + "PREAB" }; PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); From b3df8d237c87f580355c0abad1b24abf6408ba56 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 13:31:15 +0100 Subject: [PATCH 025/121] Added dependency calculations. Still missing tests and interface. --- .../DDR3TimeDependencies.cpp | 60 ++++++++------- .../DDR3TimeDependencies.h | 2 +- .../dramtimedependenciesIF.cpp | 11 ++- .../dramtimedependenciesIF.h | 4 +- .../dramtimedependencyfactory.cpp | 5 +- .../phasedependenciestracker.cpp | 73 ++++++++++++++++--- .../phasedependenciestracker.h | 9 +++ DRAMSys/traceAnalyzer/tracefiletab.cpp | 2 +- 8 files changed, 114 insertions(+), 52 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 5b494732..1b59a3eb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -1,43 +1,41 @@ #include "DDR3TimeDependencies.h" -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTimeDependenciesIF(memspec) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint clk) : DRAMTimeDependenciesIF(memspec, clk) { mInitializeValues(); } void DDR3TimeDependencies::mInitializeValues() { - burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toInt(); - dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toInt(); - clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toInt(); + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; - - tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toInt(); - tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toInt(); - tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toInt(); - tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toInt(); - tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toInt(); - tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toInt(); - tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toInt(); - tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toInt(); - tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toInt(); - tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toInt(); - tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toInt(); - tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toInt(); - tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toInt(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); - tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toInt(); - tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toInt(); - tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toInt(); - tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toInt(); - tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toInt(); - tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toInt(); - tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toInt(); - tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toInt(); - tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toInt(); - tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toInt(); - tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toInt(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); + tRP = clk * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = clk * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = clk * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRTP = clk * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRD = clk * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tCCD = clk * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = clk * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tNAW = clk * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRL = clk * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = clk * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = clk * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = clk * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tCKESR = clk * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = clk * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXPDLL = clk * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); + tXS = clk * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = clk * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tAL = clk * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRFC = clk * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tREFI = clk * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tRTRS = clk * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + tACTPDEN = clk * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = clk * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = clk * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); tPD = tCKE; tBURST = (uint) ((burstLength / (float) dataRate) * clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 53568c34..7c8a30f4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -5,7 +5,7 @@ class DDR3TimeDependencies : public DRAMTimeDependenciesIF { public: - DDR3TimeDependencies(const QJsonObject& memspec); + DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); protected: void mInitializeValues() override; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 0960d646..40f43b6a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -3,8 +3,9 @@ #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec) { +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inClk) { mMemspecJson = memspec; + clk = inClk; } @@ -34,16 +35,18 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& clk) { QSqlDatabase db = tdb.getDatabase(); - QString query = "SELECT Memspec FROM GeneralInfo"; + QString query = "SELECT clk, Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); sqlQuery.next(); - QString memSpecJson = sqlQuery.value(0).toString(); + clk = sqlQuery.value(0).toInt(); + QString memSpecJson = sqlQuery.value(1).toString(); sqlQuery.finish(); QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + return jsonDocument.object()["memspec"].toObject(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index cc818162..bd495583 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -38,12 +38,12 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec); + DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint clk); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb); + static const QJsonObject getMemspec(const TraceDB& tdb, uint& clk); const uint getClk() const { return clk; } const uint getNAW() const { return nActivateWindow; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index 65f41cc7..1586406f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -2,11 +2,12 @@ #include "dramtimedependencyfactory.h" std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); + uint clk = 0; + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); QString deviceType = memspec["memoryType"].toString(); if (deviceType == "DDR3") { - return std::make_shared(memspec); + return std::make_shared(memspec, clk); } else { // TODO maybe throw? diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 7a18e978..2f0a8e45 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -3,15 +3,22 @@ void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { + mBeginTransaction(tdb); + mDropTable(tdb); mCreateTable(tdb); auto& phases = mGetAllPhases(tdb, commands); + if (phases.size() == 0) { + mRollbackChanges(tdb); + } + auto& entries = mCalculateDependencies(tdb, phases, commands); mInsertIntoTable(tdb, entries); + mCommitTransaction(tdb); } void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { @@ -29,7 +36,7 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { - static const size_t bulkInsertionSize = 1000; + static const size_t bulkInsertionSize = 200; auto numberOfEntries = entries.size(); @@ -37,25 +44,33 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< size_t counter = 0; for (const auto& entry : entries) { if (counter == 0) { - // TODO Reset command string and add first command - command = ""; + // Reset command string and add first entry + command = "INSERT INTO 'DirectDependencies' ('DelayedPhaseID', 'DelayedPhaseName', 'DependencyType', 'TimeDependency', 'DependencyPhaseID', 'DependencyPhaseName') "; + mAddFirstEntryCommandString(command, entry); + + counter++; - } else if (counter == bulkInsertionSize) { - // TODO Write last command and submit + } else if (counter == bulkInsertionSize-1) { + // Write last entry and submit + mAddEntryCommandString(command, entry); + + mExecuteQuery(tdb, command); counter = 0; } else { - // TODO + // Write entry + mAddEntryCommandString(command, entry); counter++; + } } if (counter != 0) { - // TODO Submit command string + mExecuteQuery(tdb, command); } } @@ -74,7 +89,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector queryStr = queryStr + '\"' + cmd + "\","; } queryStr.back() = ')'; - queryStr += " ORDER BY PhaseBegin "; + queryStr += " ORDER BY PhaseBegin; "; auto query = mExecuteQuery(tdb, queryStr); @@ -119,6 +134,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector const std::vector PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; + entries.reserve((size_t) (0.4 * phases.size())); // Get dependencies for tdb device auto device = DRAMTimeDependencyFactory::make(tdb); @@ -146,7 +162,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: const auto& otherPhase = phases[j]; // Calculates the time difference in nanoseconds const auto timeDiff = phase->phaseBegin - otherPhase->phaseBegin; - // Time difference begin greater than the maximum possible dependency time ends the internal loop if (timeDiff > deps.maxTime) break; @@ -157,12 +172,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: if ( dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank - || dep.depType == DependencyType::IntraRank && cmdBank != otherPhase->tRank + || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? ) { continue; } - if (dep.phaseDep == "NAW") { if (otherPhase->phaseName == "ACT") { if (timeDiff == dep.timeValue) { @@ -226,3 +240,40 @@ QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString qu return query; } + +void PhaseDependenciesTracker::mBeginTransaction(TraceDB& tdb) { + const QString queryStr = "BEGIN TRANSACTION;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mRollbackChanges(TraceDB& tdb) { + const QString queryStr = "ROLLBACK;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mCommitTransaction(TraceDB& tdb) { + const QString queryStr = "COMMIT;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry) { + command = command + " SELECT '" + QString::number(entry.delayedPhaseID) + "' AS 'DelayedPhaseID', '" + + entry.delayedPhaseName + "' AS 'DelayedPhaseName', '" + + entry.dependencyType + "' AS 'DependencyType', '" + + entry.timeDependency + "' AS 'TimeDependency', '" + + QString::number(entry.dependencyPhaseID) + "' AS 'DependencyPhaseID', '" + + entry.dependencyPhaseName + "' AS 'DependencyPhaseName' "; + +} + +void PhaseDependenciesTracker::mAddEntryCommandString(QString& command, const DBDependencyEntry& entry) { + command = command + " UNION ALL SELECT '" + QString::number(entry.delayedPhaseID) + "', '" + + entry.delayedPhaseName + "', '" + + entry.dependencyType + "', '" + + entry.timeDependency + "', '" + + QString::number(entry.dependencyPhaseID) + "', '" + + entry.dependencyPhaseName + "' "; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index a01c537a..17d5ecda 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -43,4 +43,13 @@ private: PhaseDependenciesTracker() = delete; ~PhaseDependenciesTracker() = delete; + +private: + static void mBeginTransaction(TraceDB& tdb); + static void mRollbackChanges(TraceDB& tdb); + static void mCommitTransaction(TraceDB& tdb); + + static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); + static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); + }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index c5e9df52..c922b299 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -315,7 +315,7 @@ void TraceFileTab::on_calculateDependencies_clicked() { // TODO - For now fixed, but must be selectable std::vector dependencyFilter = { "ACT", - "PREPB", + "PREPB", "RD", "RDA", "WR", From 5ffd10744f6c12fc0911de15dd0f04d07979a312 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:30:45 +0100 Subject: [PATCH 026/121] Added interface for dependency calculation. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../businessObjects/configmodels.cpp | 139 ----------------- .../businessObjects/configmodels.h | 56 ------- .../businessObjects/dependencymodels.cpp | 141 ++++++++++++++++++ .../businessObjects/dependencymodels.h | 65 ++++++++ .../DDR3TimeDependencies.cpp | 18 +++ .../DDR3TimeDependencies.h | 2 + .../dramtimedependencyfactory.cpp | 29 ++++ .../dramtimedependencyfactory.h | 4 + .../phasedependenciestracker.cpp | 50 ++++--- DRAMSys/traceAnalyzer/data/QueryTexts.h | 10 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 9 +- .../traceAnalyzer/presentation/traceplot.cpp | 3 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 36 +++-- DRAMSys/traceAnalyzer/tracefiletab.h | 3 + DRAMSys/traceAnalyzer/tracefiletab.ui | 16 +- 16 files changed, 343 insertions(+), 239 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 70850304..4862fc40 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -101,6 +101,7 @@ add_executable(TraceAnalyzer presentation/traceselector.cpp businessObjects/configmodels.cpp businessObjects/commentmodel.cpp + businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp index 149ccf8d..439f85f1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp @@ -283,142 +283,3 @@ QModelIndex MemSpecModel::parent(const QModelIndex &index) const return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); } - -DependencyInfosModel::DependencyInfosModel(TraceDB &traceFile, QObject *parent) : QAbstractItemModel(parent) -{ - mDepInfosDepType = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyType); - mDepInfosTimeDep = traceFile.getDependencyInfos(DependencyInfos::Type::TimeDependency); - mDepInfosDelPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DelayedPhase); - mDepInfosDepPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyPhase); - - if (traceFile.checkDependencyTableExists()) - { - parseInfos(); - } -} - -int DependencyInfosModel::Node::getRow() const -{ - if (!parent) - return 0; - - const auto &siblings = parent->children; - const auto siblingsIt = std::find_if(siblings.begin(), siblings.end(), - [this](const std::unique_ptr &node) { return node.get() == this; }); - - Q_ASSERT(siblingsIt != siblings.end()); - - return std::distance(siblings.begin(), siblingsIt); -} - -void DependencyInfosModel::parseInfos() -{ - - std::vector> infos = {{"Dependency Granularity", mDepInfosDepType}, - {"Time Dependencies", mDepInfosTimeDep}, - {"Delayed Phases", mDepInfosDelPhase}, - {"Dependency Phases", mDepInfosDepPhase}}; - - for (auto pair : infos) - { - std::unique_ptr node = std::unique_ptr(new Node({pair.first, ""}, rootNode.get())); - - for (auto v : pair.second.getInfos()) - { - QString value = QString::number(v.value) + " %"; - node->children.push_back(std::move(std::unique_ptr(new Node({v.id, value}, node.get())))); - } - - rootNode->children.push_back(std::move(node)); - } -} - -int DependencyInfosModel::rowCount(const QModelIndex &parent) const -{ - if (parent.column() > 0) - return 0; - - const Node *parentNode; - - if (!parent.isValid()) - parentNode = rootNode.get(); - else - parentNode = static_cast(parent.internalPointer()); - - return parentNode->childCount(); -} - -int DependencyInfosModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent) - - return 2; -} - -QVariant DependencyInfosModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) - return QVariant(); - - if (role != Qt::DisplayRole && role != Qt::ToolTipRole) - return QVariant(); - - auto *node = static_cast(index.internalPointer()); - - if (index.column() == 0) - return QVariant(node->data.first); - else - return QVariant(node->data.second); -} - -QVariant DependencyInfosModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if (role != Qt::DisplayRole) - return QVariant(); - - if (orientation == Qt::Horizontal) - { - switch (section) - { - case 0: - return "Field"; - case 1: - return "Percentage"; - default: - break; - } - } - - return QVariant(); -} - -QModelIndex DependencyInfosModel::index(int row, int column, const QModelIndex &parent) const -{ - if (!hasIndex(row, column, parent)) - return QModelIndex(); - - const Node *parentNode; - - if (!parent.isValid()) - parentNode = rootNode.get(); - else - parentNode = static_cast(parent.internalPointer()); - - const Node *node = parentNode->children[row].get(); - - return createIndex(row, column, const_cast(node)); -} - -QModelIndex DependencyInfosModel::parent(const QModelIndex &index) const -{ - if (!index.isValid()) - return QModelIndex(); - - const Node *childNode = static_cast(index.internalPointer()); - const Node *parentNode = childNode->parent; - - if (!parentNode) - return QModelIndex(); - - return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h index 7408db5c..9b5731db 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h @@ -31,7 +31,6 @@ * * Authors: * Derek Christ - * Iron Prando da Silva */ #ifndef CONFIGMODELS_H @@ -124,59 +123,4 @@ private: std::unique_ptr rootNode = std::unique_ptr(new Node); }; -class DependencyInfosModel : public QAbstractItemModel -{ - Q_OBJECT -public: - explicit DependencyInfosModel(TraceDB &traceFile, QObject *parent = nullptr); - ~DependencyInfosModel() - { - } - -protected: - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - - QModelIndex index(int row, int column, const QModelIndex &parent) const override; - QModelIndex parent(const QModelIndex &index) const override; - -private: - DependencyInfos mDepInfosDepType; - DependencyInfos mDepInfosTimeDep; - DependencyInfos mDepInfosDelPhase; - DependencyInfos mDepInfosDepPhase; - - void parseInfos(); - struct Node - { - using NodeData = std::pair; - - Node() - { - } - Node(NodeData data, const Node *parent) : data(data), parent(parent) - { - } - - /** - * Gets the row relative to its parent. - */ - int getRow() const; - int childCount() const - { - return children.size(); - } - - NodeData data; - - const Node *parent = nullptr; - std::vector> children; - }; - - std::unique_ptr rootNode = std::unique_ptr(new Node); -}; - #endif // CONFIGMODELS_H diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp new file mode 100644 index 00000000..cbc39b65 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp @@ -0,0 +1,141 @@ + +#include "dependencymodels.h" + +DependencyInfosModel::DependencyInfosModel(TraceDB &traceFile, QObject *parent) : QAbstractItemModel(parent) +{ + mDepInfosDepType = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyType); + mDepInfosTimeDep = traceFile.getDependencyInfos(DependencyInfos::Type::TimeDependency); + mDepInfosDelPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DelayedPhase); + mDepInfosDepPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyPhase); + + if (traceFile.checkDependencyTableExists()) + { + parseInfos(); + } +} + +int DependencyInfosModel::Node::getRow() const +{ + if (!parent) + return 0; + + const auto &siblings = parent->children; + const auto siblingsIt = std::find_if(siblings.begin(), siblings.end(), + [this](const std::unique_ptr &node) { return node.get() == this; }); + + Q_ASSERT(siblingsIt != siblings.end()); + + return std::distance(siblings.begin(), siblingsIt); +} + +void DependencyInfosModel::parseInfos() +{ + + std::vector> infos = {{"Dependency Granularity", mDepInfosDepType}, + {"Time Dependencies", mDepInfosTimeDep}, + {"Delayed Phases", mDepInfosDelPhase}, + {"Dependency Phases", mDepInfosDepPhase}}; + + for (auto pair : infos) + { + std::unique_ptr node = std::unique_ptr(new Node({pair.first, ""}, rootNode.get())); + + for (auto v : pair.second.getInfos()) + { + QString value = QString::number(v.value) + " %"; + node->children.push_back(std::move(std::unique_ptr(new Node({v.id, value}, node.get())))); + } + + rootNode->children.push_back(std::move(node)); + } +} + +int DependencyInfosModel::rowCount(const QModelIndex &parent) const +{ + if (parent.column() > 0) + return 0; + + const Node *parentNode; + + if (!parent.isValid()) + parentNode = rootNode.get(); + else + parentNode = static_cast(parent.internalPointer()); + + return parentNode->childCount(); +} + +int DependencyInfosModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + + return 2; +} + +QVariant DependencyInfosModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + if (role != Qt::DisplayRole && role != Qt::ToolTipRole) + return QVariant(); + + auto *node = static_cast(index.internalPointer()); + + if (index.column() == 0) + return QVariant(node->data.first); + else + return QVariant(node->data.second); +} + +QVariant DependencyInfosModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (orientation == Qt::Horizontal) + { + switch (section) + { + case 0: + return "Field"; + case 1: + return "Percentage"; + default: + break; + } + } + + return QVariant(); +} + +QModelIndex DependencyInfosModel::index(int row, int column, const QModelIndex &parent) const +{ + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + const Node *parentNode; + + if (!parent.isValid()) + parentNode = rootNode.get(); + else + parentNode = static_cast(parent.internalPointer()); + + const Node *node = parentNode->children[row].get(); + + return createIndex(row, column, const_cast(node)); +} + +QModelIndex DependencyInfosModel::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + const Node *childNode = static_cast(index.internalPointer()); + const Node *parentNode = childNode->parent; + + if (!parentNode) + return QModelIndex(); + + return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h new file mode 100644 index 00000000..02736e13 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h @@ -0,0 +1,65 @@ + +#pragma once + +#include "../data/tracedb.h" +#include "phases/dependencyinfos.h" + +#include +#include +#include +#include + +class DependencyInfosModel : public QAbstractItemModel +{ + Q_OBJECT +public: + explicit DependencyInfosModel(TraceDB &traceFile, QObject *parent = nullptr); + ~DependencyInfosModel() + { + } + +protected: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + QModelIndex index(int row, int column, const QModelIndex &parent) const override; + QModelIndex parent(const QModelIndex &index) const override; + +private: + DependencyInfos mDepInfosDepType; + DependencyInfos mDepInfosTimeDep; + DependencyInfos mDepInfosDelPhase; + DependencyInfos mDepInfosDepPhase; + + void parseInfos(); + struct Node + { + using NodeData = std::pair; + + Node() + { + } + Node(NodeData data, const Node *parent) : data(data), parent(parent) + { + } + + /** + * Gets the row relative to its parent. + */ + int getRow() const; + int childCount() const + { + return children.size(); + } + + NodeData data; + + const Node *parent = nullptr; + std::vector> children; + }; + + std::unique_ptr rootNode = std::unique_ptr(new Node); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 1b59a3eb..fca581e0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -50,6 +50,24 @@ void DDR3TimeDependencies::mInitializeValues() { } +const std::vector DDR3TimeDependencies::getPossiblePhases() { + return {"ACT", + "RD", + "RDA", + "WR", + "WRA", + "PREPB", + "PREAB", + "REFAB", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX" + }; +} + DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { DependencyMap dmap; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 7c8a30f4..47d15f9a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -7,6 +7,8 @@ class DDR3TimeDependencies : public DRAMTimeDependenciesIF { public: DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); + static const std::vector getPossiblePhases(); + protected: void mInitializeValues() override; DependencyMap mSpecializedGetDependencies() const override; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index 1586406f..a71e0eed 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -16,3 +16,32 @@ std::shared_ptr DRAMTimeDependencyFactory::make(const Tr } } + +const std::vector DRAMTimeDependencyFactory::possiblePhases(const TraceDB& tdb) { + uint clk; // Not used + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); + QString deviceType = memspec["memoryType"].toString(); + + if (deviceType == "DDR3") { + return DDR3TimeDependencies::getPossiblePhases(); + + } else { + // TODO maybe throw? + throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + + } + +} + +bool DRAMTimeDependencyFactory::deviceSupported(const TraceDB& tdb) { + uint clk; // Not used + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); + QString deviceType = memspec["memoryType"].toString(); + + if (deviceType == "DDR3") { + return true; + + } else { + return false; + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index 748c5ab1..7a30dec4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -11,6 +11,10 @@ class DRAMTimeDependencyFactory { public: static std::shared_ptr make(const TraceDB& tdb); + static const std::vector possiblePhases(const TraceDB& tdb); + + static bool deviceSupported(const TraceDB& tdb); + private: DRAMTimeDependencyFactory() = delete; ~DRAMTimeDependencyFactory() = delete; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 2f0a8e45..0c2c6450 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -6,23 +6,28 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector 0) { + mCreateTable(tdb); + + auto& phases = mGetAllPhases(tdb, commands); + + if (phases.size() != 0) { + auto& entries = mCalculateDependencies(tdb, phases, commands); + mInsertIntoTable(tdb, entries); + + } else { + // mRollbackChanges(tdb); + // return; + } + } - auto& entries = mCalculateDependencies(tdb, phases, commands); - - mInsertIntoTable(tdb, entries); - mCommitTransaction(tdb); } void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { - QString command = "DROP TABLE DirectDependencies; "; + QString command = "DROP TABLE IF EXISTS DirectDependencies; "; auto query = mExecuteQuery(tdb, command); query.finish(); @@ -54,7 +59,8 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< // Write last entry and submit mAddEntryCommandString(command, entry); - mExecuteQuery(tdb, command); + auto query = mExecuteQuery(tdb, command); + query.finish(); counter = 0; @@ -70,7 +76,8 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } if (counter != 0) { - mExecuteQuery(tdb, command); + auto query = mExecuteQuery(tdb, command); + query.finish(); } } @@ -93,6 +100,9 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector auto query = mExecuteQuery(tdb, queryStr); + if (!query.next()) + return phases; + if (!query.last()) { throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" "Could not retrieve number of rows\n").toStdString(), @@ -128,6 +138,8 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); } + query.finish(); + return phases; } @@ -243,20 +255,20 @@ QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString qu void PhaseDependenciesTracker::mBeginTransaction(TraceDB& tdb) { const QString queryStr = "BEGIN TRANSACTION;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mRollbackChanges(TraceDB& tdb) { const QString queryStr = "ROLLBACK;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mCommitTransaction(TraceDB& tdb) { const QString queryStr = "COMMIT;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry) { diff --git a/DRAMSys/traceAnalyzer/data/QueryTexts.h b/DRAMSys/traceAnalyzer/data/QueryTexts.h index 361ec855..0b877a5d 100644 --- a/DRAMSys/traceAnalyzer/data/QueryTexts.h +++ b/DRAMSys/traceAnalyzer/data/QueryTexts.h @@ -63,7 +63,7 @@ struct TransactionQueryTexts { "WITH timespanTransactions AS (" + selectTransactionsByTimespan + ") SELECT * from DirectDependencies WHERE DelayedPhaseID IN (" " SELECT DirectDependencies.DelayedPhaseID FROM DirectDependencies JOIN timespanTransactions " - " ON DirectDependencies.DelayedPhaseID = timespanTransactions.PhaseID )"; + " ON DirectDependencies.DelayedPhaseID = timespanTransactions.PhaseID ) "; // For some reason I could not use a parameter for these below selectDependencyTypePercentages = @@ -79,7 +79,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectTimeDependencyPercentages = "WITH TotalDeps (total) AS ( " @@ -94,7 +94,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectDelayedPhasePercentages = "WITH TotalDeps (total) AS ( " @@ -109,7 +109,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectDependencyPhasePercentages = "WITH TotalDeps (total) AS ( " @@ -124,7 +124,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; } }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 1a3541b9..0171cd1e 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -66,7 +66,10 @@ TraceDB::TraceDB(QString path, bool openExisting) database = QSqlDatabase::addDatabase("QSQLITE", path); database.setDatabaseName(path); - database.open(); + if (!database.open()) + { + qDebug() << database.lastError().text(); + } if (!openExisting) dropAndCreateTables(); prepareQueries(); @@ -492,6 +495,7 @@ DependencyInfos TraceDB::getDependencyInfos(DependencyInfos::Type infoType) executeQuery(checkDependenciesExist); if (!checkDependenciesExist.next() || checkDependenciesExist.value(0).toInt() != 1) { + checkDependenciesExist.finish(); return dummy; } @@ -656,6 +660,8 @@ DependencyInfos TraceDB::parseDependencyInfos(QSqlQuery &query, const Dependency infos.addInfo({query.value(0).toString(), query.value(1).toFloat()}); } + query.finish(); + return infos; } @@ -670,6 +676,7 @@ void TraceDB::executeQuery(QSqlQuery query) } else { + query.finish(); throw sqlException( ("Query:\n " + queryToString(query) + "\n failed. Error: \n" + query.lastError().text()).toStdString(), this->pathToDB.toStdString()); diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index 0234e14f..eef8a6aa 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -523,6 +523,9 @@ void TracePlot::currentTraceTimeChanged() } setAxisScale(xBottom, GetCurrentTimespan().Begin(), GetCurrentTimespan().End()); + + dependenciesSubMenu->setEnabled(navigator->TraceFile().checkDependencyTableExists()); + replot(); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index c922b299..66b2c401 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -87,6 +87,8 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path) setUpTraceSelector(); setUpCommentView(); + setUpPossiblePhases(); + ui->mcConfigView->setModel(mcConfigModel); ui->mcConfigView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); @@ -190,6 +192,18 @@ void TraceFileTab::setUpCommentView() commentModel, &CommentModel::rowDoubleClicked); } +void TraceFileTab::setUpPossiblePhases() { + const auto possiblePhases = DRAMTimeDependencyFactory::possiblePhases(navigator->TraceFile()); + for (auto p : possiblePhases) { + auto item = new QListWidgetItem(p, ui->depTabPossiblePhases); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag + item->setCheckState(Qt::Unchecked); // AND initialize check state + + } + + ui->calculateDependencies->setEnabled(DRAMTimeDependencyFactory::deviceSupported(navigator->TraceFile())); +} + void TraceFileTab::tracefileChanged() { if (savingChangesToDB == true) { @@ -311,21 +325,17 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } void TraceFileTab::on_calculateDependencies_clicked() { - // TODO - anything else? Update view maybe? - // TODO - For now fixed, but must be selectable - std::vector dependencyFilter = { - "ACT", - "PREPB", - "RD", - "RDA", - "WR", - "WRA", - "PDE", - "PDX", - "PREAB" - }; + std::vector dependencyFilter; + for (int row = 0; row < ui->depTabPossiblePhases->count(); row++) { + auto item = ui->depTabPossiblePhases->item(row); + if (item->checkState() == Qt::Checked) + dependencyFilter.push_back(item->text()); + } PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); + depInfosView = new DependencyInfosModel(navigator->TraceFile(), this); + ui->depInfosView->setModel(depInfosView); + ui->depInfosView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index cd36887f..64e02158 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -47,6 +47,7 @@ #include "presentation/traceplot.h" #include "presentation/tracescroller.h" #include "businessObjects/configmodels.h" +#include "businessObjects/dependencymodels.h" class CommentModel; @@ -66,6 +67,8 @@ public: void setUpTraceplotScrollbar(); void setUpTraceSelector(); void setUpCommentView(); + void setUpPossiblePhases(); + void initNavigatorAndItsDependentWidgets(QString path); QString getPathToTraceFile() { diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index f2cac71d..31e8134a 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -209,16 +209,20 @@ - - - Calculate Dependencies + + + true - - - true + + + + + + + Calculate Dependencies From 860d0742553cff2da9e6a0fcb271994f7f7885b4 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:42:47 +0100 Subject: [PATCH 027/121] Closing database before removal. --- DRAMSys/traceAnalyzer/data/tracedb.cpp | 40 ++++++++++++++++++-------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 0171cd1e..73117e19 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -60,8 +60,8 @@ TraceDB::TraceDB(QString path, bool openExisting) if (database.isValid() && database.isOpen()) { // Close the database connection if it exists and was not closed yet. - database.removeDatabase(path); database.close(); + QSqlDatabase::removeDatabase(path); } database = QSqlDatabase::addDatabase("QSQLITE", path); @@ -80,28 +80,44 @@ TraceDB::TraceDB(QString path, bool openExisting) void TraceDB::prepareQueries() { selectTransactionsByTimespan = QSqlQuery(database); - selectTransactionsByTimespan.prepare(queryTexts.selectTransactionsByTimespan); - selectTransactionById = QSqlQuery(database); + if (!selectTransactionsByTimespan.prepare(queryTexts.selectTransactionsByTimespan)) + qDebug() << database.lastError().text(); + + selectTransactionById = QSqlQuery(database); + if (!selectTransactionById.prepare(queryTexts.selectTransactionById)) + qDebug() << database.lastError().text(); - selectTransactionById.prepare(queryTexts.selectTransactionById); selectDebugMessagesByTimespan = QSqlQuery(database); - selectDebugMessagesByTimespan.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end "); + if (!selectDebugMessagesByTimespan.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end ")) + qDebug() << database.lastError().text(); + selectDebugMessagesByTimespanWithLimit = QSqlQuery(database); - selectDebugMessagesByTimespanWithLimit.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end LIMIT :limit"); + if (!selectDebugMessagesByTimespanWithLimit.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end LIMIT :limit")) + qDebug() << database.lastError().text(); checkDependenciesExist = QSqlQuery(database); - checkDependenciesExist.prepare(queryTexts.checkDependenciesExist); + if (!checkDependenciesExist.prepare(queryTexts.checkDependenciesExist)) + qDebug() << database.lastError().text(); + selectDependenciesByTimespan = QSqlQuery(database); - selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan); + if (!selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan)) + qDebug() << database.lastError().text(); selectDependencyTypePercentages = QSqlQuery(database); - selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages); + if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) + qDebug() << database.lastError().text(); + selectTimeDependencyPercentages = QSqlQuery(database); - selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages); + if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) + qDebug() << database.lastError().text(); + selectDelayedPhasePercentages = QSqlQuery(database); - selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages); + if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) + qDebug() << database.lastError().text(); + selectDependencyPhasePercentages = QSqlQuery(database); - selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages); + if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) + qDebug() << database.lastError().text(); } void TraceDB::updateComments(const std::vector &comments) From 54393fe0cae8756eaeb9528bbfbd217511e22ea2 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 15 Dec 2021 11:33:05 +0100 Subject: [PATCH 028/121] Added INT types to ID columns in DirectDependencies table creation. --- .../traceAnalyzer/businessObjects/phasedependenciestracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 0c2c6450..ccd0665c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -34,7 +34,7 @@ void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { - QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID, DependencyPhaseName ); "; + QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID INT, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID INT, DependencyPhaseName ); "; auto query = mExecuteQuery(tdb, command); query.finish(); From 70c65b6c47b0e4f4ec21f87211bf54642436f0fb Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 15 Dec 2021 12:31:11 +0100 Subject: [PATCH 029/121] Corrected dependency calculation algorithm. All good. --- .../dramtimedependenciesIF.cpp | 5 ++-- .../phasedependenciestracker.cpp | 8 +++++- DRAMSys/traceAnalyzer/tracefiletab.cpp | 26 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 40f43b6a..dd01353d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -67,11 +67,12 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.end(), dep.phaseDep, [](const QString& cmd, const QString& depName){ - return cmd == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + return depName == "NAW" || QStringsComparator::compareQStrings(cmd, depName); } ); - if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; + if (dep.phaseDep == "NAW" || it != dependencyFilter.end() && *it == dep.phaseDep) + return true; return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index ccd0665c..aaf0e285 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -17,6 +17,7 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vectorphaseName == "ACT") { if (timeDiff == dep.timeValue) { @@ -202,8 +204,12 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: otherPhase->id, otherPhase->phaseName }); + } + + if (timeDiff <= dep.timeValue) { + nawCount++; + } - nawCount++; } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 66b2c401..fcd287d2 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -324,6 +324,32 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } } +bool TraceFileTab::eventFilter(QObject *object, QEvent *event) +{ + if (auto canvas = qobject_cast(object)) + { + if (event->type() == QEvent::MouseButtonDblClick) + { + QMouseEvent *mouseEvent = static_cast(event); + + if (mouseEvent->button() != Qt::LeftButton) + return false; + + QwtPlot *plot = canvas->plot(); + + double realTime = plot->invTransform(QwtPlot::xBottom, mouseEvent->x()); + + // Convert from seconds to picoseconds + traceTime time = realTime * 1000 * 1000 * 1000 * 1000; + + navigator->navigateToTime(time); + return true; + } + } + + return QWidget::eventFilter(object, event); +} + void TraceFileTab::on_calculateDependencies_clicked() { std::vector dependencyFilter; for (int row = 0; row < ui->depTabPossiblePhases->count(); row++) { From 01287484192f13d7eddf3efdfe3f9df06403b25d Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 16 Dec 2021 13:58:10 +0100 Subject: [PATCH 030/121] Changed command bus dependencies to Inter-Rank. --- .../businessObjects/phasedependenciestracker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 47c5bef4..66f36feb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -186,7 +186,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: if ( dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank - || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? + || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? Check if this holds on all devices ) { continue; } @@ -232,7 +232,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: entries.emplace_back(DBDependencyEntry{ phase->id, phase->phaseName, - PhaseDependency::dependencyTypeName(DependencyType::IntraRank), + PhaseDependency::dependencyTypeName(DependencyType::InterRank), "CommandBus", otherPhase->id, otherPhase->phaseName @@ -241,6 +241,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } + if (nawCount >= device->getNAW()) { entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); } From 319f88316c71370e38dabacbe1f9ee5894a5304d Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 10 Jan 2022 11:38:00 +0100 Subject: [PATCH 031/121] Added copyright message to files. --- .../businessObjects/configmodels.cpp | 1 - .../businessObjects/dependencymodels.cpp | 34 +++++++++++++++++++ .../businessObjects/dependencymodels.h | 34 +++++++++++++++++++ .../DDR3TimeDependencies.cpp | 34 +++++++++++++++++++ .../DDR3TimeDependencies.h | 34 +++++++++++++++++++ .../dramtimedependenciesIF.cpp | 34 +++++++++++++++++++ .../dramtimedependenciesIF.h | 34 +++++++++++++++++++ .../dramtimedependencyfactory.cpp | 34 +++++++++++++++++++ .../dramtimedependencyfactory.h | 34 +++++++++++++++++++ .../phasedependenciestracker.cpp | 34 +++++++++++++++++++ .../phasedependenciestracker.h | 34 +++++++++++++++++++ 11 files changed, 340 insertions(+), 1 deletion(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp index 439f85f1..94fe6ddd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp @@ -31,7 +31,6 @@ * * Authors: * Derek Christ - * Iron Prando da Silva */ #include "configmodels.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp index cbc39b65..3f398928 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "dependencymodels.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h index 02736e13..65c364c2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index fca581e0..790f5d4a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR3TimeDependencies.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 47d15f9a..15f746a3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index dd01353d..ae3521d4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "dramtimedependenciesIF.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index bd495583..73ba89e9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index a71e0eed..0377fe3b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "dramtimedependencyfactory.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index 7a30dec4..566d378b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 66f36feb..64156f7c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "phasedependenciestracker.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index 17d5ecda..caf1acbd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once From 273fb4aa300a5cf6a753fed53a945b3404320081 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 10 Jan 2022 12:42:46 +0100 Subject: [PATCH 032/121] Corrected 'unable to fetch row' exception after removing dependencies database, reopening file and calculating new dependencies. --- .../DDR3TimeDependencies.cpp | 16 ++--- .../phasedependenciestracker.cpp | 21 +++--- .../phasedependenciestracker.h | 2 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 68 +++++++++++-------- DRAMSys/traceAnalyzer/tracefiletab.cpp | 3 +- 5 files changed, 61 insertions(+), 49 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 790f5d4a..83b45c18 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -282,14 +282,14 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { std::forward_as_tuple("PDEP"), std::forward_as_tuple( std::initializer_list{ - {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, - {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, - {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, - {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, - {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, - {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, - {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 64156f7c..7bf7265f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -41,17 +41,20 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector 0) { - mCreateTable(tdb); - - auto& phases = mGetAllPhases(tdb, commands); + if (commands.size() > 0) { + auto& phases = mGetFilteredPhases(tdb, commands); if (phases.size() != 0) { auto& entries = mCalculateDependencies(tdb, phases, commands); + + if (entries.size() > 0) { + mCreateTable(tdb); + } + mInsertIntoTable(tdb, entries); } else { - // TODO - not sure if necessary. Still here as a possibility + // TODO - not sure if necessary. Still, a possibility // mRollbackChanges(tdb); // return; } @@ -118,7 +121,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " @@ -148,7 +151,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector if (!query.first()) { throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" - "Could not safely retrieve number of rows\n").toStdString(), + "Could not retrieve number of rows safely\n").toStdString(), tdb.pathToDB.toStdString()); } @@ -170,7 +173,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector } while (query.next()); if (rowIt != nrows) { - throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); + throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetFilteredPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); } query.finish(); @@ -286,7 +289,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString queryStr) { - QSqlQuery query(tdb.getDatabase()); + QSqlQuery query(tdb.database); query.prepare(queryStr); tdb.executeQuery(query); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index caf1acbd..5726a6fb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -70,7 +70,7 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 73117e19..54ef660e 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -103,21 +103,6 @@ void TraceDB::prepareQueries() if (!selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan)) qDebug() << database.lastError().text(); - selectDependencyTypePercentages = QSqlQuery(database); - if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) - qDebug() << database.lastError().text(); - - selectTimeDependencyPercentages = QSqlQuery(database); - if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) - qDebug() << database.lastError().text(); - - selectDelayedPhasePercentages = QSqlQuery(database); - if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) - qDebug() << database.lastError().text(); - - selectDependencyPhasePercentages = QSqlQuery(database); - if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) - qDebug() << database.lastError().text(); } void TraceDB::updateComments(const std::vector &comments) @@ -508,30 +493,53 @@ std::vector TraceDB::getDebugMessagesInTimespan(const Tim DependencyInfos TraceDB::getDependencyInfos(DependencyInfos::Type infoType) { DependencyInfos dummy; - executeQuery(checkDependenciesExist); - if (!checkDependenciesExist.next() || checkDependenciesExist.value(0).toInt() != 1) + if (!checkDependencyTableExists()) { - checkDependenciesExist.finish(); return dummy; } switch (infoType) { - case DependencyInfos::Type::DependencyType: - executeQuery(selectDependencyTypePercentages); - return parseDependencyInfos(selectDependencyTypePercentages, infoType); + case DependencyInfos::Type::DependencyType: + { + selectDependencyTypePercentages = QSqlQuery(database); + if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) + qDebug() << database.lastError().text(); - case DependencyInfos::Type::TimeDependency: - executeQuery(selectTimeDependencyPercentages); - return parseDependencyInfos(selectTimeDependencyPercentages, infoType); + executeQuery(selectDependencyTypePercentages); + return parseDependencyInfos(selectDependencyTypePercentages, infoType); + } - case DependencyInfos::Type::DelayedPhase: - executeQuery(selectDelayedPhasePercentages); - return parseDependencyInfos(selectDelayedPhasePercentages, infoType); + case DependencyInfos::Type::TimeDependency: + { + selectTimeDependencyPercentages = QSqlQuery(database); + if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) + qDebug() << database.lastError().text(); + + executeQuery(selectTimeDependencyPercentages); + return parseDependencyInfos(selectTimeDependencyPercentages, infoType); + } + + case DependencyInfos::Type::DelayedPhase: + { + selectDelayedPhasePercentages = QSqlQuery(database); + if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) + qDebug() << database.lastError().text(); + + executeQuery(selectDelayedPhasePercentages); + return parseDependencyInfos(selectDelayedPhasePercentages, infoType); + } + + case DependencyInfos::Type::DependencyPhase: + { + selectDependencyPhasePercentages = QSqlQuery(database); + if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) + qDebug() << database.lastError().text(); + + executeQuery(selectDependencyPhasePercentages); + return parseDependencyInfos(selectDependencyPhasePercentages, infoType); + } - case DependencyInfos::Type::DependencyPhase: - executeQuery(selectDependencyPhasePercentages); - return parseDependencyInfos(selectDependencyPhasePercentages, infoType); } return dummy; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index fcd287d2..52ddf73b 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -357,7 +357,8 @@ void TraceFileTab::on_calculateDependencies_clicked() { if (item->checkState() == Qt::Checked) dependencyFilter.push_back(item->text()); } - + + savingChangesToDB = true; PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); depInfosView = new DependencyInfosModel(navigator->TraceFile(), this); ui->depInfosView->setModel(depInfosView); From 81916dca024b2814eafcb21c01d84c5f0d69412d Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 11 Jan 2022 11:36:48 +0100 Subject: [PATCH 033/121] Added InterRank variable for skip checking when phases are within the same rank. --- .../dramtimedependenciesIF.h | 11 +++++++++- .../phasedependenciestracker.cpp | 21 ++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index 73ba89e9..a31b3d20 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -47,11 +47,20 @@ #include "data/tracedb.h" #include "businessObjects/phases/phasedependency.h" -struct TimeDependency { +class TimeDependency { +public: + TimeDependency() = default; + TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, + QString timeDepName, bool considerIntraRank = false) + : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, + timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + size_t timeValue; QString phaseDep; DependencyType depType; QString timeDepName; + bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + }; struct PhaseTimeDependencies { diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 7bf7265f..dba1523d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -220,13 +220,24 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: for (const auto& dep : deps.dependencies) { if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; - if ( - dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank - || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank - || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? Check if this holds on all devices - ) { + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && cmdBank != otherPhase->tBank + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && cmdRank != otherPhase->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && cmdRank == otherPhase->tRank + && !dep.considerIntraRank + }; + + if (skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank) { continue; } + if (dep.phaseDep == "NAW") { if (otherPhase->phaseName == "ACT") { if (timeDiff == dep.timeValue) { From 7fdc4c1fd4d2a5b062511ab9026642361e59ddae Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 13 Jan 2022 13:45:32 +0100 Subject: [PATCH 034/121] Corrected rainbow transaction color selection indicator. --- DRAMSys/traceAnalyzer/presentation/traceplot.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index eef8a6aa..0f05458e 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -151,6 +151,7 @@ void TracePlot::setUpActions() SLOT(on_colorGroupingTransaction())); setColorGroupingRainbowTransaction = new QAction("Group by Transaction - Rainbow Colored", this); + setColorGroupingRainbowTransaction->setCheckable(true); addAction(setColorGroupingRainbowTransaction); QObject::connect(setColorGroupingRainbowTransaction, SIGNAL(triggered()), this, SLOT(on_colorGroupingRainbowTransaction())); @@ -164,6 +165,7 @@ void TracePlot::setUpActions() QActionGroup *colorGroupingGroup = new QActionGroup(this); colorGroupingGroup->addAction(setColorGroupingPhase); colorGroupingGroup->addAction(setColorGroupingTransaction); + colorGroupingGroup->addAction(setColorGroupingRainbowTransaction); colorGroupingGroup->addAction(setColorGroupingThread); exportToPdf = new QAction("Export to SVG", this); From be150e03f2ef6bd37e9b33e666038d6ddf1a34b5 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 17 Jan 2022 14:00:35 +0100 Subject: [PATCH 035/121] Renamed variable clk to tCk. --- .../DDR3TimeDependencies.cpp | 62 +++++++++---------- .../DDR3TimeDependencies.h | 4 +- .../dramtimedependenciesIF.cpp | 8 +-- .../dramtimedependenciesIF.h | 8 +-- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 83b45c18..f09f3cfc 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -35,7 +35,7 @@ #include "DDR3TimeDependencies.h" -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint clk) : DRAMTimeDependenciesIF(memspec, clk) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { mInitializeValues(); } @@ -44,43 +44,43 @@ void DDR3TimeDependencies::mInitializeValues() { dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; - tRP = clk * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); - tRAS = clk * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); - tRC = clk * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); - tRTP = clk * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); - tRRD = clk * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); - tCCD = clk * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); - tRCD = clk * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); - tNAW = clk * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); - tRL = clk * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); - tWL = clk * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); - tWR = clk * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); - tWTR = clk * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); - tCKESR = clk * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); - tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); - tXP = clk * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); - tXPDLL = clk * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); - tXS = clk * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); - tXSDLL = clk * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); - tAL = clk * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); - tRFC = clk * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); - tREFI = clk * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); - tRTRS = clk * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); - tACTPDEN = clk * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); - tPRPDEN = clk * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); - tREFPDEN = clk * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); - tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tNAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = tCK * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXPDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRFC = tCK * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); tPD = tCKE; - tBURST = (uint) ((burstLength / (float) dataRate) * clk); - tRDWR = tRL + tBURST + 2 * clk - tWL; + tBURST = (uint) ((burstLength / (float) dataRate) * tCK); + tRDWR = tRL + tBURST + 2 * tCK - tWL; tRDWR_R = tRL + tBURST + tRTRS - tWL; tWRRD = tWL + tBURST + tWTR; tWRRD_R = tWL + tBURST + tRTRS - tRL; tWRPRE = tWL + tBURST + tWR; - tRDPDEN = tRL + tBURST + clk; + tRDPDEN = tRL + tBURST + tCK; tWRPDEN = tWL + tBURST + tWR; - tWRAPDEN = tWL + tBURST + tWR + clk; + tWRAPDEN = tWL + tBURST + tWR + tCK; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 15f746a3..98daf4f6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -37,9 +37,9 @@ #include "dramtimedependenciesIF.h" -class DDR3TimeDependencies : public DRAMTimeDependenciesIF { +class DDR3TimeDependencies final : public DRAMTimeDependenciesIF { public: - DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); + DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK); static const std::vector getPossiblePhases(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index ae3521d4..16132ec3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -37,9 +37,9 @@ #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inClk) { +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inTCK) { mMemspecJson = memspec; - clk = inClk; + tCK = inTCK; } @@ -69,13 +69,13 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& clk) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& tCK) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT clk, Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); sqlQuery.next(); - clk = sqlQuery.value(0).toInt(); + tCK = sqlQuery.value(0).toInt(); QString memSpecJson = sqlQuery.value(1).toString(); sqlQuery.finish(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index a31b3d20..c9516622 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -81,14 +81,14 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint clk); + DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint tCK); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb, uint& clk); + static const QJsonObject getMemspec(const TraceDB& tdb, uint& tCK); - const uint getClk() const { return clk; } + const uint getClk() const { return tCK; } const uint getNAW() const { return nActivateWindow; }; protected: @@ -104,7 +104,7 @@ protected: virtual void mInitializeValues() {} ; virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; - uint clk = 0; + uint tCK = 0; uint nActivateWindow = 0; }; From c4de59da95dcb8e71788fc64849f80f32bd88e3a Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 19 Jan 2022 12:32:03 +0100 Subject: [PATCH 036/121] Added auxiliar class for multiple activate window pool capturing. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 3 +- .../DDR3TimeDependencies.cpp | 7 +- .../DDR3TimeDependencies.h | 2 +- .../activatewindowpoolcontroller.cpp | 84 ++++++++++++++++ .../activatewindowpoolcontroller.h | 56 +++++++++++ .../dramTimeDependencies/commonstructures.h | 97 +++++++++++++++++++ .../dramtimedependenciesIF.cpp | 8 +- .../dramtimedependenciesIF.h | 48 ++------- .../phasedependenciestracker.cpp | 27 +++--- .../phasedependenciestracker.h | 22 +---- DRAMSys/traceAnalyzer/tracefiletab.cpp | 2 +- 11 files changed, 273 insertions(+), 83 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h rename DRAMSys/traceAnalyzer/businessObjects/{ => dramTimeDependencies}/phasedependenciestracker.cpp (93%) rename DRAMSys/traceAnalyzer/businessObjects/{ => dramTimeDependencies}/phasedependenciestracker.h (87%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 4862fc40..76534297 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -103,10 +103,11 @@ add_executable(TraceAnalyzer businessObjects/commentmodel.cpp businessObjects/dependencymodels.cpp + businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp - businessObjects/phasedependenciestracker.cpp + businessObjects/dramTimeDependencies/phasedependenciestracker.cpp selectmetrics.ui preferences.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index f09f3cfc..b2d1174a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -44,6 +44,9 @@ void DDR3TimeDependencies::mInitializeValues() { dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; + + mPoolSizes.insert({"FAW", 4}); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); @@ -51,7 +54,7 @@ void DDR3TimeDependencies::mInitializeValues() { tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); - tNAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); @@ -120,7 +123,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + {tFAW, "FAW_POOL", DependencyType::IntraRank, "tFAW"} } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 98daf4f6..8aff95e9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -58,7 +58,7 @@ protected: uint tRRD; uint tCCD; uint tRCD; - uint tNAW; + uint tFAW; uint tRL; uint tWL; uint tWR; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp new file mode 100644 index 00000000..e8961b4a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#include "activatewindowpoolcontroller.h" + +ActivateWindowPoolController::ActivateWindowPoolController(const std::map& poolSizes) { + mPoolSizes = poolSizes; + + for (const auto& p : poolSizes) { + mPools.insert({p.first, {}}); + mCounts.insert({p.first, 0}); + mPools[p.first].reserve(32); + } + +} + +void ActivateWindowPoolController::clear() { + for (auto& p : mPools) { + p.second.clear(); + mCounts[p.first] = 0; + } + +} + +void ActivateWindowPoolController::push(const QString& poolName, DBDependencyEntry dep) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + pool->second.push_back(dep); + mCounts[poolName]++; + + } else { + // TODO throw? + } +} + +void ActivateWindowPoolController::increment(const QString& poolName) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + mCounts[poolName]++; + + } else { + // TODO throw? + } +} + +void ActivateWindowPoolController::merge(std::vector& depEntries) { + for (const auto& p : mPools) { + if(mCounts[p.first] >= mPoolSizes[p.first]) { + depEntries.insert( depEntries.end(), p.second.begin(), p.second.end() ); + } + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h new file mode 100644 index 00000000..1fb349a7 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#pragma once + +#include "commonstructures.h" + +// TODO +class ActivateWindowPoolController { +public: + ActivateWindowPoolController(const std::map& poolSizes); + ~ActivateWindowPoolController() = default; + + void clear(); + void push(const QString& poolName, DBDependencyEntry); + void increment(const QString& poolName); + void merge(std::vector& depEntries); + +protected: + std::map, QStringsComparator> mPools; + std::map mCounts; + std::map mPoolSizes; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h new file mode 100644 index 00000000..768b49c0 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +#include "businessObjects/phases/phasedependency.h" + +class TimeDependency { +public: + TimeDependency() = default; + TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, + QString timeDepName, bool considerIntraRank = false) + : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, + timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; + bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + +}; + +struct PhaseTimeDependencies { + explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} + + std::vector dependencies; + size_t maxTime; +}; + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2); + static bool compareQStrings(const QString& s1, const QString& s2); +}; + +typedef std::map DependencyMap; + + +struct DBPhaseEntry { + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; + size_t tRank; +}; + +struct DBDependencyEntry { + size_t delayedPhaseID; + QString delayedPhaseName; + QString dependencyType; + QString timeDependency; + size_t dependencyPhaseID; + QString dependencyPhaseName; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 16132ec3..c101f468 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -69,6 +69,10 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } +ActivateWindowPoolController DRAMTimeDependenciesIF::getAWPools() const { + return ActivateWindowPoolController(mPoolSizes); +} + const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& tCK) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT clk, Memspec FROM GeneralInfo"; @@ -101,11 +105,11 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.end(), dep.phaseDep, [](const QString& cmd, const QString& depName){ - return depName == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + return depName.indexOf("_POOL", 3) != -1 || QStringsComparator::compareQStrings(cmd, depName); } ); - if (dep.phaseDep == "NAW" || it != dependencyFilter.end() && *it == dep.phaseDep) + if (dep.phaseDep.indexOf("_POOL", 3) != -1 || it != dependencyFilter.end() && *it == dep.phaseDep) return true; return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index c9516622..dd7b2119 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -35,49 +35,9 @@ #pragma once -#include -#include -#include - -#include -#include -#include -#include - #include "data/tracedb.h" -#include "businessObjects/phases/phasedependency.h" - -class TimeDependency { -public: - TimeDependency() = default; - TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, - QString timeDepName, bool considerIntraRank = false) - : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, - timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} - - size_t timeValue; - QString phaseDep; - DependencyType depType; - QString timeDepName; - bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies - -}; - -struct PhaseTimeDependencies { - explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} - - std::vector dependencies; - size_t maxTime; -}; - - -struct QStringsComparator { - bool operator()(const QString& s1, const QString& s2); - static bool compareQStrings(const QString& s1, const QString& s2); -}; - -typedef std::map DependencyMap; - +#include "commonstructures.h" +#include "activatewindowpoolcontroller.h" class DRAMTimeDependenciesIF { public: @@ -91,6 +51,8 @@ public: const uint getClk() const { return tCK; } const uint getNAW() const { return nActivateWindow; }; + ActivateWindowPoolController getAWPools() const; + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; @@ -107,5 +69,7 @@ protected: uint tCK = 0; uint nActivateWindow = 0; + std::map mPoolSizes; + }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp similarity index 93% rename from DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index dba1523d..f9cbb420 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -191,12 +191,10 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: DependencyMap deviceDependencies = device->getDependencies(commands); // Tries to find all timing dependencies for each phase on the trace - std::vector tmpPotentialNAW; - tmpPotentialNAW.reserve(16); + ActivateWindowPoolController poolController = device->getAWPools(); for (size_t i = 1; i < phases.size(); i++) { // NAW dependencies variables reset - tmpPotentialNAW.clear(); - size_t nawCount = 0; + poolController.clear(); // Auxiliary variables const auto& phase = phases[i]; @@ -218,7 +216,8 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: // For each possible dependency for the current phase, // checks if otherPhase would match as a dependency for (const auto& dep : deps.dependencies) { - if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; + int poolSubstrPos = dep.phaseDep.indexOf("_POOL", 3); + if (poolSubstrPos == -1 && dep.phaseDep != otherPhase->phaseName) continue; bool const skipOnIntraBankAndDifferentBanks = { dep.depType == DependencyType::IntraBank @@ -238,12 +237,15 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: continue; } - if (dep.phaseDep == "NAW") { + // Captures activate window dependencies + if (poolSubstrPos != -1) { if (otherPhase->phaseName == "ACT") { + QString poolName = dep.phaseDep.left(poolSubstrPos); + if (timeDiff == dep.timeValue) { - // Captures only the first (or exactly matching time) ACT in + // Captures only the first (exactly matching time) ACT in // the ACT window as a dependency - tmpPotentialNAW.emplace_back(DBDependencyEntry{ + poolController.push(poolName, DBDependencyEntry{ phase->id, phase->phaseName, PhaseDependency::dependencyTypeName(dep.depType), @@ -253,8 +255,8 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: }); } - if (timeDiff <= dep.timeValue) { - nawCount++; + if (timeDiff < dep.timeValue) { + poolController.increment(poolName); } @@ -289,10 +291,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } - - if (nawCount >= device->getNAW()) { - entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); - } + poolController.merge(entries); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h similarity index 87% rename from DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 5726a6fb..9edfebf0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -40,26 +40,8 @@ #include #include "data/tracedb.h" -#include "dramTimeDependencies/dramtimedependencyfactory.h" - -struct DBPhaseEntry { - size_t id; - QString phaseName; - size_t phaseBegin; - size_t phaseEnd; - size_t transact; - size_t tBank; - size_t tRank; -}; - -struct DBDependencyEntry { - size_t delayedPhaseID; - QString delayedPhaseName; - QString dependencyType; - QString timeDependency; - size_t dependencyPhaseID; - QString dependencyPhaseName; -}; +#include "dramtimedependencyfactory.h" +#include "commonstructures.h" class PhaseDependenciesTracker { public: diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 52ddf73b..0aa87b3e 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -42,7 +42,7 @@ #include "businessObjects/commentmodel.h" #include "businessObjects/configmodels.h" #include "businessObjects/pythoncaller.h" -#include "businessObjects/phasedependenciestracker.h" +#include "businessObjects/dramTimeDependencies/phasedependenciestracker.h" #include "presentation/traceselector.h" #include "qmessagebox.h" #include "queryeditor.h" From e88d2e100dbe8ddb62a37fa7d3f45527c02b0cb8 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 20 Jan 2022 11:59:11 +0100 Subject: [PATCH 037/121] Removed unused variables. --- .../dramTimeDependencies/DDR3TimeDependencies.cpp | 2 -- .../dramTimeDependencies/dramtimedependenciesIF.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index b2d1174a..b1076ae5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -43,8 +43,6 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - nActivateWindow = 4; - mPoolSizes.insert({"FAW", 4}); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index dd7b2119..7b2624f4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -49,7 +49,6 @@ public: static const QJsonObject getMemspec(const TraceDB& tdb, uint& tCK); const uint getClk() const { return tCK; } - const uint getNAW() const { return nActivateWindow; }; ActivateWindowPoolController getAWPools() const; @@ -67,7 +66,6 @@ protected: virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; uint tCK = 0; - uint nActivateWindow = 0; std::map mPoolSizes; From bae67387683e2b4e50043dbcf9a744b9c7850052 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 24 Jan 2022 10:41:34 +0100 Subject: [PATCH 038/121] Added using namespace std to dependency source file. --- .../DDR3TimeDependencies.cpp | 120 +++++++++--------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index b1076ae5..a30f6d2c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -35,6 +35,8 @@ #include "DDR3TimeDependencies.h" +using namespace std; + DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { mInitializeValues(); } @@ -85,7 +87,7 @@ void DDR3TimeDependencies::mInitializeValues() { } -const std::vector DDR3TimeDependencies::getPossiblePhases() { +const vector DDR3TimeDependencies::getPossiblePhases() { return {"ACT", "RD", "RDA", @@ -107,10 +109,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { DependencyMap dmap; dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("ACT"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ {tRC, "ACT", DependencyType::IntraBank, "tRC"}, {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, @@ -127,10 +129,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("RD"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, @@ -147,10 +149,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("RDA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tWRPRE - tRTP, "WR", DependencyType::IntraBank, "tWRPRE - tRTP"}, {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, @@ -168,10 +170,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("WR"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, @@ -188,10 +190,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("WRA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, @@ -208,10 +210,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PREPB"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, @@ -221,10 +223,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PREAB"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, @@ -236,10 +238,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("REFAB"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ {tRC, "ACT", DependencyType::IntraRank, "tRC"}, {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, @@ -253,10 +255,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDEA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, @@ -269,20 +271,20 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDXA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ {tPD, "PDEA", DependencyType::IntraRank, "tPD"} } ) ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDEP"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, @@ -296,23 +298,23 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDXP"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ {tPD, "PDEP", DependencyType::IntraRank, "tPD"} } ) ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("SREFEN"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ {tRC, "ACT", DependencyType::IntraRank, "tRC"}, - {std::max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, - {std::max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, @@ -323,10 +325,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("SREFEX"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} } ) From 7c1392ebd9b8ef523671b5be9323e8bac8c26a08 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 2 Feb 2022 10:36:37 +0100 Subject: [PATCH 039/121] Started refactoring for dependency calculation skipping. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../activatewindowpoolcontroller.h | 1 - .../dramTimeDependencies/commonstructures.h | 29 +-------------- .../dbEntries/DDR3dbphaseentry.cpp | 33 +++++++++++++++++ .../dbEntries/DDR3dbphaseentry.h | 14 +++++++ .../dbEntries/dbphaseentryIF.h | 22 +++++++++++ .../dramTimeDependencies/dbEntries/includes.h | 5 +++ .../phasedependenciestracker.cpp | 37 ++++--------------- .../phasedependenciestracker.h | 4 +- .../dramTimeDependencies/timedependency.h | 23 ++++++++++++ 10 files changed, 109 insertions(+), 60 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 76534297..8ef9a7d8 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -105,6 +105,7 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h index 1fb349a7..778f1af3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h @@ -37,7 +37,6 @@ #include "commonstructures.h" -// TODO class ActivateWindowPoolController { public: ActivateWindowPoolController(const std::map& poolSizes); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h index 768b49c0..42365aa5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h @@ -45,22 +45,8 @@ #include #include "businessObjects/phases/phasedependency.h" - -class TimeDependency { -public: - TimeDependency() = default; - TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, - QString timeDepName, bool considerIntraRank = false) - : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, - timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} - - size_t timeValue; - QString phaseDep; - DependencyType depType; - QString timeDepName; - bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies - -}; +#include "timedependency.h" +#include "businessObjects/dramTimeDependencies/dbEntries/includes.h" struct PhaseTimeDependencies { explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} @@ -76,17 +62,6 @@ struct QStringsComparator { typedef std::map DependencyMap; - -struct DBPhaseEntry { - size_t id; - QString phaseName; - size_t phaseBegin; - size_t phaseEnd; - size_t transact; - size_t tBank; - size_t tRank; -}; - struct DBDependencyEntry { size_t delayedPhaseID; QString delayedPhaseName; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp new file mode 100644 index 00000000..c58a336e --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp @@ -0,0 +1,33 @@ + +#include "DDR3dbphaseentry.h" + +DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = query.value(1).toString(); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + // tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + }; + + return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h new file mode 100644 index 00000000..fd7b6b99 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "dbphaseentryIF.h" + +class DDR3DBPhaseEntry : public DBPhaseEntryIF { + public: + DDR3DBPhaseEntry(const QSqlQuery&); + + // size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h new file mode 100644 index 00000000..3711cd28 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -0,0 +1,22 @@ + +#pragma once + +#include + +#include "businessObjects/phases/phasedependency.h" +#include "businessObjects/dramTimeDependencies/timedependency.h" + +class DBPhaseEntryIF { + public: + DBPhaseEntryIF() = default; + ~DBPhaseEntryIF() = default; + + virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } + + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h new file mode 100644 index 00000000..0fe63cf4 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h @@ -0,0 +1,5 @@ + +#pragma once + +#include "dbphaseentryIF.h" +#include "DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index f9cbb420..1ca19c6b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -120,11 +120,11 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } -const std::vector> +const std::vector> PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector& commands) { - std::vector> phases; + std::vector> phases; - QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " + QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TBankgroup, Transactions.TRank " " FROM Phases " " INNER JOIN Transactions " " ON Phases.Transact=Transactions.ID " @@ -159,16 +159,9 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector(query); - phases[rowIt] = std::make_shared(phase); ++rowIt; } while (query.next()); @@ -182,7 +175,7 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; entries.reserve((size_t) (0.4 * phases.size())); @@ -198,8 +191,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: // Auxiliary variables const auto& phase = phases[i]; - const size_t cmdBank = phase->tBank; - const size_t cmdRank = phase->tRank; // Get time dependency descriptions for the current phase const auto& deps = deviceDependencies.at(phase->phaseName); @@ -219,21 +210,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: int poolSubstrPos = dep.phaseDep.indexOf("_POOL", 3); if (poolSubstrPos == -1 && dep.phaseDep != otherPhase->phaseName) continue; - bool const skipOnIntraBankAndDifferentBanks = { - dep.depType == DependencyType::IntraBank - && cmdBank != otherPhase->tBank - }; - bool const skipOnIntraRankAndDifferentRanks = { - dep.depType == DependencyType::IntraRank - && cmdRank != otherPhase->tRank - }; - bool const skipOnInterRankAndSameRank = { - dep.depType == DependencyType::InterRank - && cmdRank == otherPhase->tRank - && !dep.considerIntraRank - }; - - if (skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank) { + if (!phase->potentialDependency(dep, otherPhase)) { continue; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 9edfebf0..074c5503 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -52,8 +52,8 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); + static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h new file mode 100644 index 00000000..f012353f --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h @@ -0,0 +1,23 @@ + +#pragma once + +#include + +#include "businessObjects/phases/phasedependency.h" + +class TimeDependency { +public: + TimeDependency() = default; + TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, + QString timeDepName, bool considerIntraRank = false) + : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, + timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; + bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + +}; + From 749c6300c54ab2fcb39cc2f1f987f8216696be29 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 2 Feb 2022 11:51:10 +0100 Subject: [PATCH 040/121] Organizing files. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 8 ++++---- .../{commonstructures.h => common/common.h} | 4 ++-- .../dramTimeDependencies/{ => common}/timedependency.h | 5 +---- .../dramTimeDependencies/dbEntries/dbphaseentryIF.h | 2 +- .../dbEntries/{includes.h => dbphaseentryTypes.h} | 0 .../{ => devices}/DDR3TimeDependencies.cpp | 0 .../{ => devices}/DDR3TimeDependencies.h | 0 .../{ => devices}/activatewindowpoolcontroller.cpp | 0 .../{ => devices}/activatewindowpoolcontroller.h | 2 +- .../{ => devices}/dramtimedependenciesIF.cpp | 0 .../{ => devices}/dramtimedependenciesIF.h | 2 +- .../{ => devices}/dramtimedependencyfactory.cpp | 0 .../{ => devices}/dramtimedependencyfactory.h | 0 .../dramTimeDependencies/phasedependenciestracker.cpp | 3 ++- .../dramTimeDependencies/phasedependenciestracker.h | 4 ++-- 15 files changed, 14 insertions(+), 16 deletions(-) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{commonstructures.h => common/common.h} (96%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => common}/timedependency.h (91%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{includes.h => dbphaseentryTypes.h} (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/DDR3TimeDependencies.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/DDR3TimeDependencies.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/activatewindowpoolcontroller.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/activatewindowpoolcontroller.h (97%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependenciesIF.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependenciesIF.h (97%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependencyfactory.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependencyfactory.h (100%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 8ef9a7d8..c78fa08b 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -103,11 +103,11 @@ add_executable(TraceAnalyzer businessObjects/commentmodel.cpp businessObjects/dependencymodels.cpp - businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp - businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp - businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp + businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp + businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp selectmetrics.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h similarity index 96% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index 42365aa5..e0edd71d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -46,7 +46,7 @@ #include "businessObjects/phases/phasedependency.h" #include "timedependency.h" -#include "businessObjects/dramTimeDependencies/dbEntries/includes.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h" struct PhaseTimeDependencies { explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} @@ -69,4 +69,4 @@ struct DBDependencyEntry { QString timeDependency; size_t dependencyPhaseID; QString dependencyPhaseName; -}; +}; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h similarity index 91% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h index f012353f..85de5e7b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h @@ -3,8 +3,6 @@ #include -#include "businessObjects/phases/phasedependency.h" - class TimeDependency { public: TimeDependency() = default; @@ -19,5 +17,4 @@ public: QString timeDepName; bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies -}; - +}; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index 3711cd28..4b342b09 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -4,7 +4,7 @@ #include #include "businessObjects/phases/phasedependency.h" -#include "businessObjects/dramTimeDependencies/timedependency.h" +#include "businessObjects/dramTimeDependencies/common/common.h" class DBPhaseEntryIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h similarity index 97% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h index 778f1af3..1c2aced7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h @@ -35,7 +35,7 @@ #pragma once -#include "commonstructures.h" +#include "businessObjects/dramTimeDependencies/common/common.h" class ActivateWindowPoolController { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h similarity index 97% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h index 7b2624f4..aae43e0b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h @@ -36,7 +36,7 @@ #pragma once #include "data/tracedb.h" -#include "commonstructures.h" +#include "businessObjects/dramTimeDependencies/common/common.h" #include "activatewindowpoolcontroller.h" class DRAMTimeDependenciesIF { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 1ca19c6b..58f2a650 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -215,7 +215,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } // Captures activate window dependencies - if (poolSubstrPos != -1) { + if (poolSubstrPos != -1) { if (otherPhase->phaseName == "ACT") { QString poolName = dep.phaseDep.left(poolSubstrPos); @@ -255,6 +255,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } + // Capture command bus dependencies if (timeDiff == device->getClk()) { entries.emplace_back(DBDependencyEntry{ phase->id, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 074c5503..0a552abe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -40,8 +40,8 @@ #include #include "data/tracedb.h" -#include "dramtimedependencyfactory.h" -#include "commonstructures.h" +#include "devices/dramtimedependencyfactory.h" +#include "common/common.h" class PhaseDependenciesTracker { public: From 0873fbaee59a9be21e0486fdc1701988df247163 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 4 Feb 2022 09:36:47 +0100 Subject: [PATCH 041/121] Finished refactoring. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 10 ++-- .../configurations/DDR3Configuration.cpp | 11 ++++ .../configurations/DDR3Configuration.h | 14 +++++ .../configurations/configurationIF.cpp | 53 +++++++++++++++++++ .../configurations/configurationIF.h | 29 ++++++++++ .../configurationfactory.cpp} | 31 +++++------ .../configurationfactory.h} | 12 ++--- .../dbEntries/dbphaseentryIF.h | 2 +- .../DDR3TimeDependencies.cpp | 0 .../DDR3TimeDependencies.h | 0 .../activatewindowpoolcontroller.cpp | 0 .../activatewindowpoolcontroller.h | 0 .../dramtimedependenciesIF.cpp | 16 ------ .../dramtimedependenciesIF.h | 2 - .../phasedependenciestracker.cpp | 26 ++++----- .../phasedependenciestracker.h | 6 +-- DRAMSys/traceAnalyzer/tracefiletab.cpp | 4 +- 17 files changed, 152 insertions(+), 64 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices/dramtimedependencyfactory.cpp => configurations/configurationfactory.cpp} (67%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices/dramtimedependencyfactory.h => configurations/configurationfactory.h} (87%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/DDR3TimeDependencies.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/DDR3TimeDependencies.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/activatewindowpoolcontroller.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/activatewindowpoolcontroller.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/dramtimedependenciesIF.cpp (92%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/dramtimedependenciesIF.h (97%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index c78fa08b..fdff7577 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -104,10 +104,12 @@ add_executable(TraceAnalyzer businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp - businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp - businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp + businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp + businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp + businessObjects/dramTimeDependencies/configurations/configurationIF.cpp + businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp selectmetrics.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp new file mode 100644 index 00000000..d9ab5d36 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp @@ -0,0 +1,11 @@ + +#include "DDR3Configuration.h" + +DDR3Configuration::DDR3Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr DDR3Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h new file mode 100644 index 00000000..f1e64fa2 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h" +#include "businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h" + +class DDR3Configuration : public ConfigurationIF { + public: + DDR3Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp new file mode 100644 index 00000000..a2fb31e5 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp @@ -0,0 +1,53 @@ + +#include "configurationIF.h" + +const uint ConfigurationIF::getClk() const { + if (!mDeviceDeps) + throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getClk'."); + + return mDeviceDeps->getClk(); +} + +DependencyMap ConfigurationIF::getDependencies(std::vector& commands) const { + if (!mDeviceDeps) + throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getDependencies'."); + + return mDeviceDeps->getDependencies(commands); +} + +ActivateWindowPoolController ConfigurationIF::getAWPools() const { + if (!mDeviceDeps) + throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getAWPools'."); + + return mDeviceDeps->getAWPools(); +} + +const QString ConfigurationIF::getDeviceName(const TraceDB& tdb) { + return mGetMemspec(tdb)["memoryType"].toString(); +} + +const uint ConfigurationIF::mGetClk(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT clk FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + uint clock = sqlQuery.value(0).toLongLong(); + sqlQuery.finish(); + + return clock; +} + +const QJsonObject ConfigurationIF::mGetMemspec(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT Memspec FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + QString memSpecJson = sqlQuery.value(0).toString(); + sqlQuery.finish(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + + return jsonDocument.object()["memspec"].toObject(); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h new file mode 100644 index 00000000..26563123 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h @@ -0,0 +1,29 @@ + +#pragma once + +#include + +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class ConfigurationIF { + public: + ConfigurationIF() {}; + virtual ~ConfigurationIF() = default; + + virtual std::shared_ptr makePhaseEntry(const QSqlQuery&) const { return nullptr; } + + // Delegated methods + const uint getClk() const; + DependencyMap getDependencies(std::vector& commands) const; + ActivateWindowPoolController getAWPools() const; + + static const QString getDeviceName(const TraceDB& tdb); + + protected: + std::shared_ptr mDeviceDeps = nullptr; + + static const uint mGetClk(const TraceDB& tdb); + static const QJsonObject mGetMemspec(const TraceDB& tdb); + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp similarity index 67% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 0377fe3b..154e18e0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -33,46 +33,41 @@ * Iron Prando da Silva */ -#include "dramtimedependencyfactory.h" +#include "configurationfactory.h" -std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { - uint clk = 0; - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); - QString deviceType = memspec["memoryType"].toString(); +std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) { + const QString deviceName = ConfigurationIF::getDeviceName(tdb); - if (deviceType == "DDR3") { - return std::make_shared(memspec, clk); + if (deviceName == "DDR3") { + return std::make_shared(tdb); } else { // TODO maybe throw? - throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); } } -const std::vector DRAMTimeDependencyFactory::possiblePhases(const TraceDB& tdb) { - uint clk; // Not used - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); - QString deviceType = memspec["memoryType"].toString(); +const std::vector ConfigurationFactory::possiblePhases(const TraceDB& tdb) { + const QString deviceName = ConfigurationIF::getDeviceName(tdb); - if (deviceType == "DDR3") { + if (deviceName == "DDR3") { return DDR3TimeDependencies::getPossiblePhases(); } else { // TODO maybe throw? - throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); } } -bool DRAMTimeDependencyFactory::deviceSupported(const TraceDB& tdb) { +bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { uint clk; // Not used - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); - QString deviceType = memspec["memoryType"].toString(); + const QString deviceName = ConfigurationIF::getDeviceName(tdb); - if (deviceType == "DDR3") { + if (deviceName == "DDR3") { return true; } else { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h similarity index 87% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index 566d378b..f732e83b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -37,19 +37,19 @@ #include -#include "dramtimedependenciesIF.h" -#include "DDR3TimeDependencies.h" +#include "configurationIF.h" +#include "DDR3Configuration.h" #include "data/tracedb.h" -class DRAMTimeDependencyFactory { +class ConfigurationFactory { public: - static std::shared_ptr make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); static const std::vector possiblePhases(const TraceDB& tdb); static bool deviceSupported(const TraceDB& tdb); private: - DRAMTimeDependencyFactory() = delete; - ~DRAMTimeDependencyFactory() = delete; + ConfigurationFactory() = delete; + ~ConfigurationFactory() = delete; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index 4b342b09..d86593c1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -9,7 +9,7 @@ class DBPhaseEntryIF { public: DBPhaseEntryIF() = default; - ~DBPhaseEntryIF() = default; + virtual ~DBPhaseEntryIF() = default; virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp similarity index 92% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index c101f468..133b5655 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -73,22 +73,6 @@ ActivateWindowPoolController DRAMTimeDependenciesIF::getAWPools() const { return ActivateWindowPoolController(mPoolSizes); } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& tCK) { - QSqlDatabase db = tdb.getDatabase(); - QString query = "SELECT clk, Memspec FROM GeneralInfo"; - QSqlQuery sqlQuery = db.exec(query); - - sqlQuery.next(); - tCK = sqlQuery.value(0).toInt(); - QString memSpecJson = sqlQuery.value(1).toString(); - sqlQuery.finish(); - - QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); - - return jsonDocument.object()["memspec"].toObject(); - -} - void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h similarity index 97% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h index aae43e0b..512000b9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h @@ -46,8 +46,6 @@ public: DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb, uint& tCK); - const uint getClk() const { return tCK; } ActivateWindowPoolController getAWPools() const; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 58f2a650..5272d774 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -37,15 +37,17 @@ void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { + auto deviceConfig = ConfigurationFactory::make(tdb); + mBeginTransaction(tdb); mDropTable(tdb); - if (commands.size() > 0) { - auto& phases = mGetFilteredPhases(tdb, commands); + if (commands.size() > 0) { + auto& phases = mGetFilteredPhases(deviceConfig, tdb, commands); if (phases.size() != 0) { - auto& entries = mCalculateDependencies(tdb, phases, commands); + auto& entries = mCalculateDependencies(deviceConfig, phases, commands); if (entries.size() > 0) { mCreateTable(tdb); @@ -121,7 +123,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr deviceConfig, TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TBankgroup, Transactions.TRank " @@ -160,7 +162,7 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector(query); + phases[rowIt] = deviceConfig->makePhaseEntry(query); ++rowIt; } while (query.next()); @@ -175,22 +177,22 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { +PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr deviceConfig, const std::vector>& phases, std::vector& commands) { std::vector entries; entries.reserve((size_t) (0.4 * phases.size())); - // Get dependencies for tdb device - auto device = DRAMTimeDependencyFactory::make(tdb); - DependencyMap deviceDependencies = device->getDependencies(commands); + // Get dependencies for device + DependencyMap deviceDependencies = deviceConfig->getDependencies(commands); // Tries to find all timing dependencies for each phase on the trace - ActivateWindowPoolController poolController = device->getAWPools(); + ActivateWindowPoolController poolController = deviceConfig->getAWPools(); for (size_t i = 1; i < phases.size(); i++) { // NAW dependencies variables reset poolController.clear(); // Auxiliary variables - const auto& phase = phases[i]; + const auto phase = phases[i]; + if (phase == nullptr) continue; // Get time dependency descriptions for the current phase const auto& deps = deviceDependencies.at(phase->phaseName); @@ -256,7 +258,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } // Capture command bus dependencies - if (timeDiff == device->getClk()) { + if (timeDiff == deviceConfig->getClk()) { entries.emplace_back(DBDependencyEntry{ phase->id, phase->phaseName, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 0a552abe..b4ce10bf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -40,7 +40,7 @@ #include #include "data/tracedb.h" -#include "devices/dramtimedependencyfactory.h" +#include "configurations/configurationfactory.h" #include "common/common.h" class PhaseDependenciesTracker { @@ -52,8 +52,8 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); + static const std::vector> mGetFilteredPhases(const std::shared_ptr, TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::shared_ptr, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 0aa87b3e..23e61f20 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -193,7 +193,7 @@ void TraceFileTab::setUpCommentView() } void TraceFileTab::setUpPossiblePhases() { - const auto possiblePhases = DRAMTimeDependencyFactory::possiblePhases(navigator->TraceFile()); + const auto possiblePhases = ConfigurationFactory::possiblePhases(navigator->TraceFile()); for (auto p : possiblePhases) { auto item = new QListWidgetItem(p, ui->depTabPossiblePhases); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag @@ -201,7 +201,7 @@ void TraceFileTab::setUpPossiblePhases() { } - ui->calculateDependencies->setEnabled(DRAMTimeDependencyFactory::deviceSupported(navigator->TraceFile())); + ui->calculateDependencies->setEnabled(ConfigurationFactory::deviceSupported(navigator->TraceFile())); } void TraceFileTab::tracefileChanged() From f024f00c141bcd9d2c098e76cf1db10eb2a77732 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 15 Feb 2022 09:51:21 +0100 Subject: [PATCH 042/121] Added more DependencyType enumerators. --- .../phasedependenciestracker.cpp | 10 ++++++---- .../businessObjects/phases/phasedependency.cpp | 15 +++++++++++++++ .../businessObjects/phases/phasedependency.h | 7 ++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 5272d774..6f99fab5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -216,11 +216,13 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName)) { if (otherPhase->phaseName == "ACT") { - QString poolName = dep.phaseDep.left(poolSubstrPos); - if (timeDiff == dep.timeValue) { // Captures only the first (exactly matching time) ACT in // the ACT window as a dependency diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index de6c65ff..0cd7ec0e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -136,12 +136,27 @@ QString PhaseDependency::dependencyTypeName(DependencyType dtype) { case IntraBank: return "IntraBank"; + case IntraBankGroup: + return "IntraBankGroup"; + case IntraRank: return "IntraRank"; + case IntraLogicalRank: + return "IntraLogicalRank"; + + case IntraPhysicalRank: + return "IntraPhysicalRank"; + + case IntraDIMMRank: + return "IntraDIMMRank"; + case InterRank: return "InterRank"; + case InterDIMMRank: + return "InterDIMMRank"; + default: // TODO - maybe throw? return ""; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index 439f973c..a29a67dd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -49,8 +49,13 @@ class Phase; enum DependencyType { IntraBank, + IntraBankGroup, IntraRank, - InterRank + IntraLogicalRank, + IntraPhysicalRank, + IntraDIMMRank, + InterRank, + InterDIMMRank, }; class PhaseDependency From 8347ead0a98511c7fe14d112d6d38416f4e06024 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 15 Feb 2022 10:45:54 +0100 Subject: [PATCH 043/121] Refactored PoolControllerMap. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 +- .../dramTimeDependencies/common/common.cpp | 10 ++++ .../dramTimeDependencies/common/common.h | 1 + .../configurations/configurationIF.cpp | 4 +- .../configurations/configurationIF.h | 2 +- .../DDR3TimeDependencies.cpp | 2 +- .../dramtimedependenciesIF.cpp | 12 +---- .../dramtimedependenciesIF.h | 6 +-- .../deviceDependencies/poolcontroller.cpp | 47 +++++++++++++++++++ .../deviceDependencies/poolcontroller.h | 26 ++++++++++ ...olcontroller.cpp => poolcontrollermap.cpp} | 45 +++++++++--------- ...owpoolcontroller.h => poolcontrollermap.h} | 14 +++--- .../phasedependenciestracker.cpp | 11 ++--- 13 files changed, 131 insertions(+), 53 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{activatewindowpoolcontroller.cpp => poolcontrollermap.cpp} (67%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{activatewindowpoolcontroller.h => poolcontrollermap.h} (80%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index fdff7577..5f00b471 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -103,8 +103,10 @@ add_executable(TraceAnalyzer businessObjects/commentmodel.cpp businessObjects/dependencymodels.cpp + businessObjects/dramTimeDependencies/common/common.cpp businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp + businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp + businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp new file mode 100644 index 00000000..856ca631 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp @@ -0,0 +1,10 @@ + +#include "common.h" + +bool QStringsComparator::operator()(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} + +bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index e0edd71d..689da366 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -39,6 +39,7 @@ #include #include +#include #include #include #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp index a2fb31e5..35c96028 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp @@ -15,11 +15,11 @@ DependencyMap ConfigurationIF::getDependencies(std::vector& commands) c return mDeviceDeps->getDependencies(commands); } -ActivateWindowPoolController ConfigurationIF::getAWPools() const { +PoolControllerMap ConfigurationIF::getPools() const { if (!mDeviceDeps) throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getAWPools'."); - return mDeviceDeps->getAWPools(); + return mDeviceDeps->getPools(); } const QString ConfigurationIF::getDeviceName(const TraceDB& tdb) { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h index 26563123..38595563 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h @@ -16,7 +16,7 @@ class ConfigurationIF { // Delegated methods const uint getClk() const; DependencyMap getDependencies(std::vector& commands) const; - ActivateWindowPoolController getAWPools() const; + PoolControllerMap getPools() const; static const QString getDeviceName(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp index a30f6d2c..143ce25f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp @@ -45,7 +45,7 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPoolSizes.insert({"FAW", 4}); + mPools.insert({"FAW", {4, {"ACT"}}}); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index 133b5655..0528d8d6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -69,8 +69,8 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -ActivateWindowPoolController DRAMTimeDependenciesIF::getAWPools() const { - return ActivateWindowPoolController(mPoolSizes); +PoolControllerMap DRAMTimeDependenciesIF::getPools() const { + return PoolControllerMap(mPools); } void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { @@ -172,11 +172,3 @@ uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vectortimeValue; } - -bool QStringsComparator::operator()(const QString& s1, const QString& s2) { - return s1.compare(s2) < 0; -} - -bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { - return s1.compare(s2) < 0; -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h index 512000b9..40709f7d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h @@ -37,7 +37,7 @@ #include "data/tracedb.h" #include "businessObjects/dramTimeDependencies/common/common.h" -#include "activatewindowpoolcontroller.h" +#include "poolcontrollermap.h" class DRAMTimeDependenciesIF { public: @@ -48,7 +48,7 @@ public: const uint getClk() const { return tCK; } - ActivateWindowPoolController getAWPools() const; + PoolControllerMap getPools() const; protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; @@ -65,7 +65,7 @@ protected: uint tCK = 0; - std::map mPoolSizes; + std::map mPools; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp new file mode 100644 index 00000000..b86d5aef --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -0,0 +1,47 @@ + +#include "poolcontroller.h" +#include + +PoolController::PoolController(const uint poolSize, const std::vector& dependencies) +: mDependencies(mAuxSortInput(dependencies)) +{ + mPoolSize = poolSize; + +} + +void PoolController::clear() { + mPool.clear(); + mCount = 0; + +} + +void PoolController::push(DBDependencyEntry dep) { + mPool.push_back(dep); + mCount++; + +} + +void PoolController::increment() { + mCount++; +} + +void PoolController::merge(std::vector& depEntries) { + if(mCount >= mPoolSize) { + depEntries.insert( depEntries.end(), mPool.begin(), mPool.end() ); + } +} + +bool PoolController::isDependency(const QString& phaseName) { + return std::binary_search( + mDependencies.begin(), + mDependencies.end(), + phaseName, + QStringsComparator::compareQStrings + ); +} + +std::vector PoolController::mAuxSortInput(std::vector vec) { + std::sort(vec.begin(), vec.end(), QStringsComparator::compareQStrings); + + return vec; +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h new file mode 100644 index 00000000..7a6cf713 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -0,0 +1,26 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/common/common.h" + +class PoolController { +public: + PoolController(const uint poolSize, const std::vector& dependencies); + ~PoolController() = default; + + void clear(); + void push(DBDependencyEntry); + void increment(); + void merge(std::vector& depEntries); + + bool isDependency(const QString& phaseName); + +protected: + const std::vector mDependencies; + std::vector mPool; + uint mCount = 0; + uint mPoolSize = 0; + +protected: + static std::vector mAuxSortInput(std::vector vec); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp similarity index 67% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index e8961b4a..a16dd6c6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -33,52 +33,53 @@ * Iron Prando da Silva */ -#include "activatewindowpoolcontroller.h" - -ActivateWindowPoolController::ActivateWindowPoolController(const std::map& poolSizes) { - mPoolSizes = poolSizes; - - for (const auto& p : poolSizes) { - mPools.insert({p.first, {}}); - mCounts.insert({p.first, 0}); - mPools[p.first].reserve(32); - } +#include "poolcontrollermap.h" +PoolControllerMap::PoolControllerMap(const std::map& pools) { + mPools = pools; } -void ActivateWindowPoolController::clear() { +void PoolControllerMap::clear() { for (auto& p : mPools) { p.second.clear(); - mCounts[p.first] = 0; } } -void ActivateWindowPoolController::push(const QString& poolName, DBDependencyEntry dep) { +void PoolControllerMap::push(const QString& poolName, DBDependencyEntry dep) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { - pool->second.push_back(dep); - mCounts[poolName]++; + pool->second.push(dep); } else { // TODO throw? } } -void ActivateWindowPoolController::increment(const QString& poolName) { +void PoolControllerMap::increment(const QString& poolName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { - mCounts[poolName]++; + pool->second.increment(); } else { // TODO throw? } } -void ActivateWindowPoolController::merge(std::vector& depEntries) { - for (const auto& p : mPools) { - if(mCounts[p.first] >= mPoolSizes[p.first]) { - depEntries.insert( depEntries.end(), p.second.begin(), p.second.end() ); - } +void PoolControllerMap::merge(std::vector& depEntries) { + for (auto& p : mPools) { + p.second.merge(depEntries); + } +} + +bool PoolControllerMap::isDependency(const QString& poolName, const QString& phaseName) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + return pool->second.isDependency(phaseName); + + } else { + // TODO throw? + return false; + } } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h similarity index 80% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index 1c2aced7..0de8d5f9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -35,21 +35,21 @@ #pragma once -#include "businessObjects/dramTimeDependencies/common/common.h" +#include "poolcontroller.h" -class ActivateWindowPoolController { +class PoolControllerMap { public: - ActivateWindowPoolController(const std::map& poolSizes); - ~ActivateWindowPoolController() = default; + PoolControllerMap(const std::map& pools); + ~PoolControllerMap() = default; void clear(); void push(const QString& poolName, DBDependencyEntry); void increment(const QString& poolName); void merge(std::vector& depEntries); + bool isDependency(const QString& poolName, const QString& phaseName); + protected: - std::map, QStringsComparator> mPools; - std::map mCounts; - std::map mPoolSizes; + std::map mPools; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 6f99fab5..2590518b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -185,7 +185,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetDependencies(commands); // Tries to find all timing dependencies for each phase on the trace - ActivateWindowPoolController poolController = deviceConfig->getAWPools(); + PoolControllerMap poolController = deviceConfig->getPools(); for (size_t i = 1; i < phases.size(); i++) { // NAW dependencies variables reset poolController.clear(); @@ -220,12 +220,10 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName)) { - if (otherPhase->phaseName == "ACT") { + if (poolController.isDependency(poolName, otherPhase->phaseName)) { if (timeDiff == dep.timeValue) { - // Captures only the first (exactly matching time) ACT in - // the ACT window as a dependency + // Captures only the first (exactly matching time) phase in + // the pool window as a dependency poolController.push(poolName, DBDependencyEntry{ phase->id, phase->phaseName, @@ -259,6 +257,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetClk()) { entries.emplace_back(DBDependencyEntry{ From ea9660cf8d602a9a263585a18b0c7c9928047b1a Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 16 Feb 2022 10:55:57 +0100 Subject: [PATCH 044/121] Refactoring and command bus pooling. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 8 ++- .../configurations/configurationfactory.h | 2 +- .../{ => specialized}/DDR3Configuration.cpp | 0 .../{ => specialized}/DDR3Configuration.h | 6 +- .../dbEntries/dbphaseentryTypes.h | 2 +- .../{ => specialized}/DDR3dbphaseentry.cpp | 3 + .../{ => specialized}/DDR3dbphaseentry.h | 2 +- .../DDR3TimeDependencies.cpp | 64 ++++++++++++++----- .../{ => specialized}/DDR3TimeDependencies.h | 2 +- .../phasedependenciestracker.cpp | 15 +---- 10 files changed, 65 insertions(+), 39 deletions(-) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{ => specialized}/DDR3Configuration.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{ => specialized}/DDR3Configuration.h (56%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{ => specialized}/DDR3dbphaseentry.cpp (94%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{ => specialized}/DDR3dbphaseentry.h (79%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{ => specialized}/DDR3TimeDependencies.cpp (88%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{ => specialized}/DDR3TimeDependencies.h (96%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 5f00b471..13072b03 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -104,14 +104,16 @@ add_executable(TraceAnalyzer businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/common/common.cpp - businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/configurations/configurationIF.cpp - businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp + + businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp + businessObjects/dramTimeDependencies/phasedependenciestracker.cpp selectmetrics.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index f732e83b..d3d4fb08 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -38,7 +38,7 @@ #include #include "configurationIF.h" -#include "DDR3Configuration.h" +#include "specialized/DDR3Configuration.h" #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h similarity index 56% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index f1e64fa2..c25dd87b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -1,9 +1,9 @@ #pragma once -#include "configurationIF.h" -#include "businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h" -#include "businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" class DDR3Configuration : public ConfigurationIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h index 0fe63cf4..1a809fa7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h @@ -2,4 +2,4 @@ #pragma once #include "dbphaseentryIF.h" -#include "DDR3dbphaseentry.h" +#include "specialized/DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp similarity index 94% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index c58a336e..c2ef1dde 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -16,6 +16,8 @@ bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; + bool isCmdPool = dep.phaseDep == "CMD_BUS_POOL"; + bool const skipOnIntraBankAndDifferentBanks = { dep.depType == DependencyType::IntraBank && tBank != other->tBank @@ -27,6 +29,7 @@ bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: bool const skipOnInterRankAndSameRank = { dep.depType == DependencyType::InterRank && tRank == other->tRank + && !isCmdPool }; return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h similarity index 79% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h index fd7b6b99..b312e59f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h @@ -1,7 +1,7 @@ #pragma once -#include "dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" class DDR3DBPhaseEntry : public DBPhaseEntryIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp similarity index 88% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index 143ce25f..eb9d0638 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -45,7 +45,27 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({"FAW", {4, {"ACT"}}}); + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + } + } + }); + mPools.insert({"NAW", {4, {"ACT"}}}); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); @@ -123,7 +143,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tFAW, "FAW_POOL", DependencyType::IntraRank, "tFAW"} + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tFAW, "NAW_POOL", DependencyType::IntraRank, "tFAW"}, } ) ); @@ -143,7 +164,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, - {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -164,7 +186,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, - {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -184,7 +207,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, - {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -204,7 +228,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, - {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -217,7 +242,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, - {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -232,7 +258,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, - {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -249,7 +276,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -265,7 +293,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, - {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"} + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -275,7 +304,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple("PDXA"), forward_as_tuple( initializer_list{ - {tPD, "PDEA", DependencyType::IntraRank, "tPD"} + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -292,7 +322,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -302,7 +333,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple("PDXP"), forward_as_tuple( initializer_list{ - {tPD, "PDEP", DependencyType::IntraRank, "tPD"} + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -319,7 +351,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -329,7 +362,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple("SREFEX"), forward_as_tuple( initializer_list{ - {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h similarity index 96% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h index 8aff95e9..1d7f777e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h @@ -35,7 +35,7 @@ #pragma once -#include "dramtimedependenciesIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" class DDR3TimeDependencies final : public DRAMTimeDependenciesIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 2590518b..7d05ae65 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -187,7 +187,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetPools(); for (size_t i = 1; i < phases.size(); i++) { - // NAW dependencies variables reset + // Pool dependencies variables reset poolController.clear(); // Auxiliary variables @@ -257,19 +257,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetClk()) { - entries.emplace_back(DBDependencyEntry{ - phase->id, - phase->phaseName, - PhaseDependency::dependencyTypeName(DependencyType::InterRank), - "CommandBus", - otherPhase->id, - otherPhase->phaseName - }); - } - } poolController.merge(entries); From aeed9fcbd03690187414c93b58efbc58475af262 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 16 Feb 2022 11:27:49 +0100 Subject: [PATCH 045/121] Corrected dependency drawing of PREAB and REFA. --- .../traceAnalyzer/businessObjects/phases/phase.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index c89bc35f..bd9d8efe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -71,16 +71,12 @@ void Phase::draw(QPainter *painter, const QwtScaleMap &xMap, drawPhaseSymbol(span.Begin(), span.End(), line->getYVal(), drawingProperties.drawText, getPhaseSymbol(), painter, xMap, yMap); - if (getGranularity() == Granularity::Bankwise) + DependencyOptions drawDependenciesOptions = drawingProperties.drawDependenciesOption; + if (drawDependenciesOptions.draw == DependencyOption::All || + (drawDependenciesOptions.draw == DependencyOption::Selected && highlight)) { - - DependencyOptions drawDependenciesOptions = drawingProperties.drawDependenciesOption; - if (drawDependenciesOptions.draw == DependencyOption::All || - (drawDependenciesOptions.draw == DependencyOption::Selected && highlight)) - { - drawPhaseDependencies(span.Begin(), span.End(), line->getYVal(), drawingProperties, painter, xMap, - yMap); - } + drawPhaseDependencies(span.Begin(), span.End(), line->getYVal(), drawingProperties, painter, xMap, + yMap); } } } From 600c6d183a6751f6f86d58bcd3dafdd9caf4c916 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 1 Mar 2022 11:57:23 +0100 Subject: [PATCH 046/121] Refactored string comparisons out of the main loop. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 3 +- .../{common.cpp => QStringComparator.cpp} | 6 +- .../common/QStringComparator.h | 9 ++ .../common/StringMapper.cpp | 109 ++++++++++++++++++ .../common/StringMapper.h | 66 +++++++++++ .../dramTimeDependencies/common/common.h | 7 +- .../common/timedependency.h | 7 +- .../dbEntries/dbphaseentryIF.h | 2 +- .../specialized/DDR3dbphaseentry.cpp | 4 +- .../dramtimedependenciesIF.cpp | 29 ++--- .../dramtimedependenciesIF.h | 6 +- .../deviceDependencies/poolcontroller.cpp | 12 +- .../deviceDependencies/poolcontroller.h | 8 +- .../deviceDependencies/poolcontrollermap.cpp | 8 +- .../deviceDependencies/poolcontrollermap.h | 10 +- .../specialized/DDR3TimeDependencies.cpp | 30 ++--- .../phasedependenciestracker.cpp | 23 ++-- 17 files changed, 260 insertions(+), 79 deletions(-) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/{common.cpp => QStringComparator.cpp} (80%) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 13072b03..080bdb8a 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -103,7 +103,8 @@ add_executable(TraceAnalyzer businessObjects/commentmodel.cpp businessObjects/dependencymodels.cpp - businessObjects/dramTimeDependencies/common/common.cpp + businessObjects/dramTimeDependencies/common/QStringComparator.cpp + businessObjects/dramTimeDependencies/common/StringMapper.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp similarity index 80% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp index 856ca631..a56a891c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp @@ -1,10 +1,10 @@ -#include "common.h" +#include "QStringComparator.h" -bool QStringsComparator::operator()(const QString& s1, const QString& s2) { +bool QStringsComparator::operator()(const QString& s1, const QString& s2) const { return s1.compare(s2) < 0; } bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { return s1.compare(s2) < 0; -} +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h new file mode 100644 index 00000000..4f6fc913 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h @@ -0,0 +1,9 @@ + +#pragma once + +#include + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2) const; + static bool compareQStrings(const QString& s1, const QString& s2); +}; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp new file mode 100644 index 00000000..ddc0cfe3 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -0,0 +1,109 @@ + +#include "StringMapper.h" + +StringMapper::StringMapper(const QString& name) { + mIDEnum = getIDEnum(name); + mIDStr = name; + mIsPool = mAuxIsPool(mIDEnum); + +} + +QString StringMapper::getIDStr(StringMapper::Identifier id) { + static const std::map enumToStr { + {StringMapper::Identifier::CMD_BUS, "CMD_BUS"}, + {StringMapper::Identifier::NAW, "NAW"}, + {StringMapper::Identifier::FAW, "FAW"}, + {StringMapper::Identifier::_32AW, "32AW"}, + {StringMapper::Identifier::FAW_LOGICAL, "FAW_LOGICAL"}, + {StringMapper::Identifier::FAW_PHYSICAL, "FAW_PHYSICAL"}, + {StringMapper::Identifier::REFAB, "REFAB"}, + {StringMapper::Identifier::PREAB, "PREAB"}, + {StringMapper::Identifier::PDEP, "PDEP"}, + {StringMapper::Identifier::PDXP, "PDXP"}, + {StringMapper::Identifier::SREFEN, "SREFEN"}, + {StringMapper::Identifier::SREFEX, "SREFEX"}, + {StringMapper::Identifier::PDEA, "PDEA"}, + {StringMapper::Identifier::PDXA, "PDXA"}, + {StringMapper::Identifier::SRPDEN, "SRPDEN"}, + {StringMapper::Identifier::SRPDEX, "SRPDEX"}, + {StringMapper::Identifier::ACT, "ACT"}, + {StringMapper::Identifier::RD, "RD"}, + {StringMapper::Identifier::WR, "WR"}, + {StringMapper::Identifier::PREPB, "PREPB"}, + {StringMapper::Identifier::RDA, "RDA"}, + {StringMapper::Identifier::WRA, "WRA"}, + {StringMapper::Identifier::REFPB, "REFPB"}, + }; + + auto it = enumToStr.find(id); + if (it != enumToStr.end()) return it->second; + else throw std::invalid_argument("The provided StringMapper::StringMapper::Identifier is not valid."); + +} + +StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { + static const std::map strToEnum { + {"CMD_BUS", StringMapper::Identifier::CMD_BUS}, + {"NAW", StringMapper::Identifier::NAW}, + {"FAW", StringMapper::Identifier::FAW}, + {"32AW", StringMapper::Identifier::_32AW}, + {"FAW_LOGICAL", StringMapper::Identifier::FAW_LOGICAL}, + {"FAW_PHYSICAL", StringMapper::Identifier::FAW_PHYSICAL}, + {"REFAB", StringMapper::Identifier::REFAB}, + {"PREAB", StringMapper::Identifier::PREAB}, + {"PDEP", StringMapper::Identifier::PDEP}, + {"PDXP", StringMapper::Identifier::PDXP}, + {"SREFEN", StringMapper::Identifier::SREFEN}, + {"SREFEX", StringMapper::Identifier::SREFEX}, + {"PDEA", StringMapper::Identifier::PDEA}, + {"PDXA", StringMapper::Identifier::PDXA}, + {"SRPDEN", StringMapper::Identifier::SRPDEN}, + {"SRPDEX", StringMapper::Identifier::SRPDEX}, + {"ACT", StringMapper::Identifier::ACT}, + {"RD", StringMapper::Identifier::RD}, + {"WR", StringMapper::Identifier::WR}, + {"PREPB", StringMapper::Identifier::PREPB}, + {"RDA", StringMapper::Identifier::RDA}, + {"WRA", StringMapper::Identifier::WRA}, + {"REFPB", StringMapper::Identifier::REFPB}, + }; + + auto it = strToEnum.find(id); + if (it != strToEnum.end()) return it->second; + else throw std::invalid_argument("The provided StringMapper::Identifier '" + id.toStdString() + "' is not valid."); + +} + +bool StringMapper::mAuxIsPool(StringMapper::Identifier id) { + return id == StringMapper::Identifier::CMD_BUS + || id == StringMapper::Identifier::NAW + || id == StringMapper::Identifier::FAW + || id == StringMapper::Identifier::_32AW + || id == StringMapper::Identifier::FAW_LOGICAL + || id == StringMapper::Identifier::FAW_PHYSICAL; + +} + +bool StringMapper::operator==(const StringMapper& str2) const { + return mIDEnum == str2.mIDEnum; +} + +bool StringMapper::operator!=(const StringMapper& str2) const { + return mIDEnum != str2.mIDEnum; +} + +bool StringMapper::operator<(const StringMapper& str2) const { + return mIDEnum < str2.mIDEnum; +} + +bool StringMapper::compare(const StringMapper& str1, const StringMapper& str2) { + return str1.getIDEnum() < str2.getIDEnum(); +} + +bool StringMapper::operator==(const StringMapper::Identifier& id) const { + return mIDEnum == id; +} + +bool StringMapper::operator!=(const StringMapper::Identifier& id) const { + return mIDEnum != id; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h new file mode 100644 index 00000000..aaaa5968 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -0,0 +1,66 @@ + +#pragma once + +#include +#include "QStringComparator.h" + +class StringMapper { + public: + enum Identifier { + None, + CMD_BUS, + NAW, + FAW, + _32AW, + FAW_LOGICAL, + FAW_PHYSICAL, + REFAB, + PREAB, + PDEP, + PDXP, + SREFEN, + SREFEX, + PDEA, + PDXA, + SRPDEN, + SRPDEX, + ACT, + RD, + WR, + PREPB, + RDA, + WRA, + REFPB + }; + + public: + StringMapper() = default; + StringMapper(const QString& id); + StringMapper(const char* str) : StringMapper(std::forward(str)) {} + ~StringMapper() = default; + + Identifier getIDEnum() const { return mIDEnum; } + const QString getIDStr() const { return mIDStr; } + + bool isPool() const { return mIsPool; } + + static QString getIDStr(Identifier); + static Identifier getIDEnum(const QString&); + + bool operator==(const StringMapper&) const; + bool operator!=(const StringMapper&) const; + bool operator<(const StringMapper&) const; + + bool operator==(const Identifier&) const; + bool operator!=(const Identifier&) const; + + static bool compare(const StringMapper&, const StringMapper&); + + protected: + Identifier mIDEnum = None; + QString mIDStr = ""; + bool mIsPool = false; + + protected: + static bool mAuxIsPool(Identifier); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index 689da366..687073af 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -56,12 +56,7 @@ struct PhaseTimeDependencies { size_t maxTime; }; -struct QStringsComparator { - bool operator()(const QString& s1, const QString& s2); - static bool compareQStrings(const QString& s1, const QString& s2); -}; - -typedef std::map DependencyMap; +typedef std::map DependencyMap; struct DBDependencyEntry { size_t delayedPhaseID; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h index 85de5e7b..06a4750f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h @@ -2,6 +2,7 @@ #pragma once #include +#include "StringMapper.h" class TimeDependency { public: @@ -9,12 +10,12 @@ public: TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, QString timeDepName, bool considerIntraRank = false) : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, - timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + timeDepName{timeDepName} {} size_t timeValue; - QString phaseDep; + StringMapper phaseDep; DependencyType depType; QString timeDepName; - bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + bool isPool() { return phaseDep.isPool(); } }; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index d86593c1..3d61939e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -14,7 +14,7 @@ class DBPhaseEntryIF { virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } size_t id; - QString phaseName; + StringMapper phaseName; size_t phaseBegin; size_t phaseEnd; size_t transact; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index c2ef1dde..61a22bb9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -3,7 +3,7 @@ DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query) { id = query.value(0).toLongLong(); - phaseName = query.value(1).toString(); + phaseName = StringMapper(query.value(1).toString()); phaseBegin = query.value(2).toLongLong(); phaseEnd = query.value(3).toLongLong(); transact = query.value(4).toLongLong(); @@ -16,7 +16,7 @@ bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; - bool isCmdPool = dep.phaseDep == "CMD_BUS_POOL"; + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; bool const skipOnIntraBankAndDifferentBanks = { dep.depType == DependencyType::IntraBank diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index 0528d8d6..420fdde3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -47,19 +47,19 @@ DependencyMap DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { DependencyMap dependenciesMap; + std::vector dependencyFilterStrMapper(dependencyFilter.begin(), dependencyFilter.end()); std::sort( - dependencyFilter.begin(), - dependencyFilter.end(), - QStringsComparator::compareQStrings + dependencyFilterStrMapper.begin(), + dependencyFilterStrMapper.end() ); dependenciesMap = mSpecializedGetDependencies(); - mFilterDependencyMap(dependenciesMap, dependencyFilter); + mFilterDependencyMap(dependenciesMap, dependencyFilterStrMapper); auto it = dependenciesMap.begin(); while (it != dependenciesMap.end()) { - mFilterDependencyList(it->second.dependencies, dependencyFilter); + mFilterDependencyList(it->second.dependencies, dependencyFilterStrMapper); it->second.maxTime = mFindVectorMaximum(it->second.dependencies); ++it; @@ -73,7 +73,7 @@ PoolControllerMap DRAMTimeDependenciesIF::getPools() const { return PoolControllerMap(mPools); } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); // TODO - probably there is a smarter way to filter these values, @@ -88,12 +88,12 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - [](const QString& cmd, const QString& depName){ - return depName.indexOf("_POOL", 3) != -1 || QStringsComparator::compareQStrings(cmd, depName); + [](const StringMapper& cmd, const StringMapper& depName){ + return depName.isPool() || cmd < depName; } ); - if (dep.phaseDep.indexOf("_POOL", 3) != -1 || it != dependencyFilter.end() && *it == dep.phaseDep) + if (dep.phaseDep.isPool() || it != dependencyFilter.end() && *it == dep.phaseDep) return true; return false; @@ -114,7 +114,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -132,8 +132,8 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, itFilter, itFilterLast, itDependencyMap, - [](const QString& cmd, const std::pair& vpair) { - return cmd.compare(vpair.first) == 0; + [](const StringMapper& cmd, const std::pair& vpair) { + return cmd == vpair.first; } ); @@ -141,11 +141,12 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, dependencyMap.erase(pair.second, dependencyMap.end()); break; - } else if (pair.first->compare(pair.second->first) < 0) { + } else if (*(pair.first) < pair.second->first < 0) { ++(pair.first); - } else if (pair.first->compare(pair.second->first) == 0) { + } else if (*(pair.first) == pair.second->first == 0) { ++(pair.second); + } else { pair.second = dependencyMap.erase(pair.second); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h index 40709f7d..bfdeb033 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h @@ -51,8 +51,8 @@ public: PoolControllerMap getPools() const; protected: - void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; - void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; + void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; uint mFindVectorMaximum(const std::vector& dependencyList) const; protected: @@ -65,7 +65,7 @@ protected: uint tCK = 0; - std::map mPools; + std::map mPools; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp index b86d5aef..813fc687 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -2,7 +2,7 @@ #include "poolcontroller.h" #include -PoolController::PoolController(const uint poolSize, const std::vector& dependencies) +PoolController::PoolController(const uint poolSize, const std::vector& dependencies) : mDependencies(mAuxSortInput(dependencies)) { mPoolSize = poolSize; @@ -31,17 +31,17 @@ void PoolController::merge(std::vector& depEntries) { } } -bool PoolController::isDependency(const QString& phaseName) { +bool PoolController::isDependency(const StringMapper& phaseName) { return std::binary_search( mDependencies.begin(), mDependencies.end(), - phaseName, - QStringsComparator::compareQStrings + phaseName, + StringMapper::compare ); } -std::vector PoolController::mAuxSortInput(std::vector vec) { - std::sort(vec.begin(), vec.end(), QStringsComparator::compareQStrings); +std::vector PoolController::mAuxSortInput(std::vector vec) { + std::sort(vec.begin(), vec.end()); return vec; } \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index 7a6cf713..262d4997 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -5,7 +5,7 @@ class PoolController { public: - PoolController(const uint poolSize, const std::vector& dependencies); + PoolController(const uint poolSize, const std::vector& dependencies); ~PoolController() = default; void clear(); @@ -13,14 +13,14 @@ public: void increment(); void merge(std::vector& depEntries); - bool isDependency(const QString& phaseName); + bool isDependency(const StringMapper& phaseName); protected: - const std::vector mDependencies; + const std::vector mDependencies; std::vector mPool; uint mCount = 0; uint mPoolSize = 0; protected: - static std::vector mAuxSortInput(std::vector vec); + static std::vector mAuxSortInput(std::vector vec); }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index a16dd6c6..95ba8ebe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -35,7 +35,7 @@ #include "poolcontrollermap.h" -PoolControllerMap::PoolControllerMap(const std::map& pools) { +PoolControllerMap::PoolControllerMap(const std::map& pools) { mPools = pools; } @@ -46,7 +46,7 @@ void PoolControllerMap::clear() { } -void PoolControllerMap::push(const QString& poolName, DBDependencyEntry dep) { +void PoolControllerMap::push(const StringMapper& poolName, DBDependencyEntry dep) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { pool->second.push(dep); @@ -56,7 +56,7 @@ void PoolControllerMap::push(const QString& poolName, DBDependencyEntry dep) { } } -void PoolControllerMap::increment(const QString& poolName) { +void PoolControllerMap::increment(const StringMapper& poolName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { pool->second.increment(); @@ -72,7 +72,7 @@ void PoolControllerMap::merge(std::vector& depEntries) { } } -bool PoolControllerMap::isDependency(const QString& poolName, const QString& phaseName) { +bool PoolControllerMap::isDependency(const StringMapper& poolName, const StringMapper& phaseName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { return pool->second.isDependency(phaseName); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index 0de8d5f9..b7d247f1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -39,17 +39,17 @@ class PoolControllerMap { public: - PoolControllerMap(const std::map& pools); + PoolControllerMap(const std::map& pools); ~PoolControllerMap() = default; void clear(); - void push(const QString& poolName, DBDependencyEntry); - void increment(const QString& poolName); + void push(const StringMapper& poolName, DBDependencyEntry); + void increment(const StringMapper& poolName); void merge(std::vector& depEntries); - bool isDependency(const QString& poolName, const QString& phaseName); + bool isDependency(const StringMapper& poolName, const StringMapper& phaseName); protected: - std::map mPools; + std::map mPools; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index eb9d0638..4cdf2562 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -143,8 +143,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, - {tFAW, "NAW_POOL", DependencyType::IntraRank, "tFAW"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, } ) ); @@ -165,7 +165,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -187,7 +187,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -208,7 +208,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -229,7 +229,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -243,7 +243,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -259,7 +259,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -277,7 +277,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -294,7 +294,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -305,7 +305,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -323,7 +323,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -334,7 +334,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -352,7 +352,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -363,7 +363,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 7d05ae65..62a18aae 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -209,33 +209,32 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName) continue; - + bool isPoolDep = dep.phaseDep.isPool(); + if (!isPoolDep && dep.phaseDep != otherPhase->phaseName) continue; + if (!phase->potentialDependency(dep, otherPhase)) { continue; } - if (poolSubstrPos != -1) { + if (isPoolDep) { // Captures activate window dependencies - QString poolName = dep.phaseDep.left(poolSubstrPos); - if (poolController.isDependency(poolName, otherPhase->phaseName)) { + if (poolController.isDependency(dep.phaseDep, otherPhase->phaseName)) { if (timeDiff == dep.timeValue) { // Captures only the first (exactly matching time) phase in // the pool window as a dependency - poolController.push(poolName, DBDependencyEntry{ + poolController.push(dep.phaseDep, DBDependencyEntry{ phase->id, - phase->phaseName, + phase->phaseName.getIDStr(), PhaseDependency::dependencyTypeName(dep.depType), dep.timeDepName, otherPhase->id, - otherPhase->phaseName + otherPhase->phaseName.getIDStr() }); } if (timeDiff < dep.timeValue) { - poolController.increment(poolName); + poolController.increment(dep.phaseDep); } @@ -247,11 +246,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrid, - phase->phaseName, + phase->phaseName.getIDStr(), PhaseDependency::dependencyTypeName(dep.depType), dep.timeDepName, otherPhase->id, - otherPhase->phaseName + otherPhase->phaseName.getIDStr() }); } From 2799991f363a35cadc582978d88735dee42e59e3 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 3 Mar 2022 10:26:47 +0100 Subject: [PATCH 047/121] Added DDR3 generated dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../specialized/DDR3Configuration.cpp | 3 +- .../specialized/DDR3Configuration.h | 1 + .../specialized/TimeDependenciesInfoDDR3.cpp | 354 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR3.h | 58 +++ 5 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 080bdb8a..7b600c76 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -113,6 +113,7 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp index d9ab5d36..abe11bf8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp @@ -2,7 +2,8 @@ #include "DDR3Configuration.h" DDR3Configuration::DDR3Configuration(const TraceDB& tdb) { - mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + // mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index c25dd87b..84f59974 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -3,6 +3,7 @@ #include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" class DDR3Configuration : public ConfigurationIF { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp new file mode 100644 index 00000000..0bc82412 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -0,0 +1,354 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoDDR3.h" + +using namespace std; + +TimeDependenciesInfoDDR3::TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoDDR3::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + } + } + }); + + tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tCL = tCK * mMemspecJson["memtimingspec"].toObject()["CL"].toInt(); + tCWL = tCK * mMemspecJson["memtimingspec"].toObject()["CWL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWTR = tCK * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRFC = tCK * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + + tPD = tCKE; + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDWR = tRL + tBURST + 2 * tCK - tWL; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tBURST + tWTR - tAL; + tWRPRE = tWL + tBURST + tWR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tRDPDEN = tRL + tBURST + tCK; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + tCK; + +} + +const std::vector TimeDependenciesInfoDDR3::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoDDR3::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD, "WR", DependencyType::IntraBank, "tWRRD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {max({tWRRD, tWRPRE - tRTP - tAL}), "WR", DependencyType::IntraBank, "max(tWRRD, tWRPRE - tRTP - tAL)"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h new file mode 100644 index 00000000..28d36a87 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h @@ -0,0 +1,58 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoDDR3 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tCCD; + uint tRCD; + uint tRP; + uint tRAS; + uint tCL; + uint tCWL; + uint tAL; + uint tRL; + uint tWL; + uint tRTP; + uint tWTR; + uint tRRD; + uint tWR; + uint tFAW; + uint tRFC; + uint tRC; + uint tXP; + uint tXS; + uint tXSDLL; + uint tCKE; + uint tCKESR; + uint tPD; + uint tREFPDEN; + uint tACTPDEN; + uint tPRPDEN; + uint tRTRS; + + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRPRE; + uint tWRRD_R; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + +}; From 1ec6acbb38b83bea4a7ca67b7b0dd34b8845cfa8 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 3 Mar 2022 13:55:47 +0100 Subject: [PATCH 048/121] Corrected time dependency filtering with StringMapper. Added DDR4 dependency tracking. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 9 +- .../common/StringMapper.h | 2 +- .../dramTimeDependencies/common/common.h | 1 - .../configurations/configurationfactory.cpp | 12 +- .../configurations/configurationfactory.h | 1 + .../specialized/DDR4Configuration.cpp | 11 + .../specialized/DDR4Configuration.h | 14 + .../dbEntries/dbphaseentryTypes.h | 5 - .../specialized/DDR4dbphaseentry.cpp | 45 ++ .../dbEntries/specialized/DDR4dbphaseentry.h | 14 + .../dramtimedependenciesIF.cpp | 5 +- .../specialized/TimeDependenciesInfoDDR4.cpp | 387 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR4.h | 66 +++ 13 files changed, 559 insertions(+), 13 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h delete mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 7b600c76..9cf7dc56 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -108,14 +108,19 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/configurations/configurationIF.cpp businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp + # businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp + + businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp + businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp + + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp selectmetrics.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index aaaa5968..2ecf89c3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -27,7 +27,7 @@ class StringMapper { ACT, RD, WR, - PREPB, + PREPB, RDA, WRA, REFPB diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index 687073af..6b673bbf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -47,7 +47,6 @@ #include "businessObjects/phases/phasedependency.h" #include "timedependency.h" -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h" struct PhaseTimeDependencies { explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 154e18e0..0c5036ef 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -41,6 +41,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) if (deviceName == "DDR3") { return std::make_shared(tdb); + } else if (deviceName == "DDR4") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -53,7 +56,11 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t const QString deviceName = ConfigurationIF::getDeviceName(tdb); if (deviceName == "DDR3") { - return DDR3TimeDependencies::getPossiblePhases(); + // return DDR3TimeDependencies::getPossiblePhases(); + return TimeDependenciesInfoDDR3::getPossiblePhases(); + + } else if (deviceName == "DDR4") { + return TimeDependenciesInfoDDR4::getPossiblePhases(); } else { // TODO maybe throw? @@ -70,6 +77,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { if (deviceName == "DDR3") { return true; + } else if (deviceName == "DDR4") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index d3d4fb08..c38877f5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -39,6 +39,7 @@ #include "configurationIF.h" #include "specialized/DDR3Configuration.h" +#include "specialized/DDR4Configuration.h" #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp new file mode 100644 index 00000000..ce696152 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp @@ -0,0 +1,11 @@ + +#include "DDR4Configuration.h" + +DDR4Configuration::DDR4Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr DDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h new file mode 100644 index 00000000..992e8df2 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h" + +class DDR4Configuration : public ConfigurationIF { + public: + DDR4Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h deleted file mode 100644 index 1a809fa7..00000000 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h +++ /dev/null @@ -1,5 +0,0 @@ - -#pragma once - -#include "dbphaseentryIF.h" -#include "specialized/DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp new file mode 100644 index 00000000..611ac9b7 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp @@ -0,0 +1,45 @@ + +#include "DDR4dbphaseentry.h" + +DDR4DBPhaseEntry::DDR4DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool DDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraRankAndDifferentRanks + || skipOnInterRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h new file mode 100644 index 00000000..7f53fe6c --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class DDR4DBPhaseEntry : public DBPhaseEntryIF { + public: + DDR4DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index 420fdde3..df67097c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -65,7 +65,6 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) ++it; } - return dependenciesMap; } @@ -141,10 +140,10 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, dependencyMap.erase(pair.second, dependencyMap.end()); break; - } else if (*(pair.first) < pair.second->first < 0) { + } else if (*(pair.first) < pair.second->first) { ++(pair.first); - } else if (*(pair.first) == pair.second->first == 0) { + } else if (*(pair.first) == pair.second->first) { ++(pair.second); } else { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp new file mode 100644 index 00000000..287239af --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -0,0 +1,387 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoDDR4.h" + +using namespace std; + +TimeDependenciesInfoDDR4::TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoDDR4::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + } + } + }); + + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tCL = tCK * mMemspecJson["memtimingspec"].toObject()["CL"].toInt(); + tCWL = tCK * mMemspecJson["memtimingspec"].toObject()["CWL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tRPRE = tCK * mMemspecJson["memtimingspec"].toObject()["RPRE"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tCCD_S = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S"].toInt(); + tCCD_L = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L"].toInt(); + tRRD_S = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_S"].toInt(); + tRRD_L = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_L"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tWTR_S = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_S"].toInt(); + tWTR_L = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_L"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + + tPD = tCKE; + tRFC = tCK * ( + (mMemspecJson["memtimingspec"].toObject()["REFM"].toInt() == 4) ? + (mMemspecJson["memtimingspec"].toObject()["RFC4"].toInt(1)) : + ( + (mMemspecJson["memtimingspec"].toObject()["REFM"].toInt() == 2) ? + (mMemspecJson["memtimingspec"].toObject()["RFC2"].toInt(1)) : + (mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(1)) + ) + ); + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDWR = tRL + tBURST + tCK - tWL + tWPRE; + tRDWR_R = tRL + tBURST + tRTRS - tWL + tWPRE; + tWRRD_S = tWL + tBURST + tWTR_S - tAL; + tWRRD_L = tWL + tBURST + tWTR_L - tAL; + tWRRD_R = tWL + tBURST + tRTRS - tRL + tRPRE; + tRDAACT = tAL + tRTP + tRP; + tWRPRE = tWL + tBURST + tWR; + tWRAACT = tWRPRE + tRP; + tRDPDEN = tRL + tBURST + tCK; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + tCK; + +} + +const std::vector TimeDependenciesInfoDDR4::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoDDR4::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRD_L, "ACT", DependencyType::IntraBankGroup, "tRRD_L"}, + {tRRD_S, "ACT", DependencyType::IntraRank, "tRRD_S"}, + {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, + {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD_L, "RD", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "RD", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RD", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "RDA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RDA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_L, "WR", DependencyType::IntraBank, "tWRRD_L"}, + {tWRRD_L, "WR", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WR", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_L, "WRA", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WRA", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD_L, "WR", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "WR", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WR", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "WRA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WRA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD_L, "RD", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "RD", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RD", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "RDA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RDA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {max({tWRRD_L, tWRPRE - tRTP - tAL}), "WR", DependencyType::IntraBank, "max(tWRRD_L, tWRPRE - tRTP - tAL)"}, + {tWRRD_L, "WR", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WR", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_L, "WRA", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WRA", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD_L, "WR", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "WR", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WR", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "WRA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WRA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tRDAACT, "RDA", DependencyType::IntraRank, "tRDAACT"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h new file mode 100644 index 00000000..5b89e31a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h @@ -0,0 +1,66 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoDDR4 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tRCD; + uint tRP; + uint tRAS; + uint tRC; + uint tCL; + uint tCWL; + uint tAL; + uint tRL; + uint tRPRE; + uint tWPRE; + uint tWL; + uint tCCD_S; + uint tCCD_L; + uint tRRD_S; + uint tRRD_L; + uint tFAW; + uint tWTR_S; + uint tWTR_L; + uint tRTP; + uint tWR; + uint tRFC; + uint tXS; + uint tXSDLL; + uint tXP; + uint tCKE; + uint tCKESR; + uint tPD; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; + uint tRTRS; + + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD_S; + uint tWRRD_L; + uint tWRRD_R; + uint tRDAACT; + uint tWRPRE; + uint tWRAACT; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + +}; From 566c27821aa15ae49f89df6b551547bc013643f9 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 08:07:17 +0100 Subject: [PATCH 049/121] Adding time keeping for dependencies tracker. --- .../phasedependenciestracker.cpp | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 62a18aae..58936c95 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -35,26 +35,49 @@ #include "phasedependenciestracker.h" +#include +#include + void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { - auto deviceConfig = ConfigurationFactory::make(tdb); + using std::chrono::high_resolution_clock; + using std::chrono::duration_cast; + using std::chrono::duration; + using std::chrono::microseconds; + + + auto deviceInstantiationTimeStart = high_resolution_clock::now(); + auto deviceConfig = ConfigurationFactory::make(tdb); + auto deviceInstantiationTimeEnd = high_resolution_clock::now(); + auto deviceInstantiationTimeDuration = duration_cast(deviceInstantiationTimeEnd - deviceInstantiationTimeStart); mBeginTransaction(tdb); mDropTable(tdb); if (commands.size() > 0) { - auto& phases = mGetFilteredPhases(deviceConfig, tdb, commands); - + auto phasesLoadingTimeStart = high_resolution_clock::now(); + auto& phases = mGetFilteredPhases(deviceConfig, tdb, commands); + auto phasesLoadingTimeEnd = high_resolution_clock::now(); + auto phasesLoadingTimeDuration = duration_cast(phasesLoadingTimeEnd - phasesLoadingTimeStart); + if (phases.size() != 0) { - auto& entries = mCalculateDependencies(deviceConfig, phases, commands); - + auto dependenciesCalcTimeStart = high_resolution_clock::now(); + auto& entries = mCalculateDependencies(deviceConfig, phases, commands); + auto dependenciesCalcTimeEnd = high_resolution_clock::now(); + auto dependenciesCalcTimeDuration = duration_cast(dependenciesCalcTimeEnd - dependenciesCalcTimeStart); + if (entries.size() > 0) { mCreateTable(tdb); } mInsertIntoTable(tdb, entries); + std::cout << "PhaseDependenciesTracker times (us):" << std::endl + << "\tDevice instantiation: " << deviceInstantiationTimeDuration.count() << std::endl + << "\tPhase loading: " << phasesLoadingTimeDuration.count() << std::endl + << "\tDependencies calculation: " << dependenciesCalcTimeDuration.count() << std::endl; + } else { // TODO - not sure if necessary. Still, a possibility // mRollbackChanges(tdb); From cff60060b01beab24046514a9bf9f7fc542eb6db Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 09:17:15 +0100 Subject: [PATCH 050/121] Added re-prepare of queries to eliminate 'parameter mismatch' exception. --- .../phasedependenciestracker.cpp | 15 +++++++++++---- .../phasedependenciestracker.h | 4 ++-- DRAMSys/traceAnalyzer/data/tracedb.cpp | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 58936c95..9c0fb5fe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -45,7 +45,6 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector(tableInsertionTimeEnd - tableInsertionTimeStart); + + auto totalTime = deviceInstantiationTimeDuration + phasesLoadingTimeDuration + dependenciesCalcTimeDuration + tableInsertionTimeDuration; + std::cout << "PhaseDependenciesTracker times (us):" << std::endl << "\tDevice instantiation: " << deviceInstantiationTimeDuration.count() << std::endl << "\tPhase loading: " << phasesLoadingTimeDuration.count() << std::endl - << "\tDependencies calculation: " << dependenciesCalcTimeDuration.count() << std::endl; + << "\tDependencies calculation: " << dependenciesCalcTimeDuration.count() << std::endl + << "\tDB table population: " << tableInsertionTimeDuration.count() << std::endl + << " - Total time: " << totalTime.count() << std::endl; } else { // TODO - not sure if necessary. Still, a possibility @@ -104,7 +111,7 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { - static const size_t bulkInsertionSize = 200; + static const size_t bulkInsertionSize = 30; auto numberOfEntries = entries.size(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index b4ce10bf..ebd7e16a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -65,7 +65,7 @@ private: static void mRollbackChanges(TraceDB& tdb); static void mCommitTransaction(TraceDB& tdb); - static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); - static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); + inline static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); + inline static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 54ef660e..2457bf40 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -130,6 +130,7 @@ void TraceDB::updateFileDescription(const QString &description) void TraceDB::refreshData() { + prepareQueries(); generalInfo = getGeneralInfoFromDB(); } From 147c8175f257f91bf736530791a86e8fd079320c Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 09:50:09 +0100 Subject: [PATCH 051/121] Removed throw from ConfigurationFactory::possiblePhases. --- .../configurations/configurationfactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 0c5036ef..e75607f0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -64,8 +64,8 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else { // TODO maybe throw? - throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); - + // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); + return {""}; } } From 8d1b854159cf4d45d4046a1fddbb6458031ba3ae Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 10:28:39 +0100 Subject: [PATCH 052/121] Added HBM2 dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 + .../common/StringMapper.cpp | 6 + .../common/StringMapper.h | 2 + .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 1 + .../specialized/HBM2Configuration.cpp | 11 + .../specialized/HBM2Configuration.h | 14 + .../specialized/HBM2dbphaseentry.cpp | 45 ++ .../dbEntries/specialized/HBM2dbphaseentry.h | 14 + .../specialized/TimeDependenciesInfoHBM2.cpp | 398 ++++++++++++++++++ .../specialized/TimeDependenciesInfoHBM2.h | 57 +++ 11 files changed, 561 insertions(+) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 9cf7dc56..ef0b9cb9 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -118,6 +118,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp + + businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp + businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index ddc0cfe3..450410bf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -11,6 +11,8 @@ StringMapper::StringMapper(const QString& name) { QString StringMapper::getIDStr(StringMapper::Identifier id) { static const std::map enumToStr { {StringMapper::Identifier::CMD_BUS, "CMD_BUS"}, + {StringMapper::Identifier::RAS_BUS, "RAS_BUS"}, + {StringMapper::Identifier::CAS_BUS, "CAS_BUS"}, {StringMapper::Identifier::NAW, "NAW"}, {StringMapper::Identifier::FAW, "FAW"}, {StringMapper::Identifier::_32AW, "32AW"}, @@ -44,6 +46,8 @@ QString StringMapper::getIDStr(StringMapper::Identifier id) { StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { static const std::map strToEnum { {"CMD_BUS", StringMapper::Identifier::CMD_BUS}, + {"RAS_BUS", StringMapper::Identifier::RAS_BUS}, + {"CAS_BUS", StringMapper::Identifier::CAS_BUS}, {"NAW", StringMapper::Identifier::NAW}, {"FAW", StringMapper::Identifier::FAW}, {"32AW", StringMapper::Identifier::_32AW}, @@ -76,6 +80,8 @@ StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { bool StringMapper::mAuxIsPool(StringMapper::Identifier id) { return id == StringMapper::Identifier::CMD_BUS + || id == StringMapper::Identifier::RAS_BUS + || id == StringMapper::Identifier::CAS_BUS || id == StringMapper::Identifier::NAW || id == StringMapper::Identifier::FAW || id == StringMapper::Identifier::_32AW diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index 2ecf89c3..b4034cd1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -9,6 +9,8 @@ class StringMapper { enum Identifier { None, CMD_BUS, + RAS_BUS, + CAS_BUS, NAW, FAW, _32AW, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index e75607f0..ee0fa3e2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -44,6 +44,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } else if (deviceName == "DDR4") { return std::make_shared(tdb); + } else if (deviceName == "HBM2") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -62,6 +65,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "DDR4") { return TimeDependenciesInfoDDR4::getPossiblePhases(); + } else if (deviceName == "HBM2") { + return TimeDependenciesInfoHBM2::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -80,6 +86,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "DDR4") { return true; + } else if (deviceName == "HBM2") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index c38877f5..b7b006a4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -40,6 +40,7 @@ #include "configurationIF.h" #include "specialized/DDR3Configuration.h" #include "specialized/DDR4Configuration.h" +#include "specialized/HBM2Configuration.h" #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp new file mode 100644 index 00000000..0ba89bae --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp @@ -0,0 +1,11 @@ + +#include "HBM2Configuration.h" + +HBM2Configuration::HBM2Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr HBM2Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h new file mode 100644 index 00000000..5abbaa37 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h" + +class HBM2Configuration : public ConfigurationIF { + public: + HBM2Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp new file mode 100644 index 00000000..09e2a38a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp @@ -0,0 +1,45 @@ + +#include "HBM2dbphaseentry.h" + +HBM2DBPhaseEntry::HBM2DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraRankAndDifferentRanks + || skipOnInterRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h new file mode 100644 index 00000000..541693fd --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class HBM2DBPhaseEntry : public DBPhaseEntryIF { + public: + HBM2DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp new file mode 100644 index 00000000..977de023 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -0,0 +1,398 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoHBM2.h" + +using namespace std; + +TimeDependenciesInfoHBM2::TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoHBM2::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "RAS_BUS", { + 1, { + "ACT", + "PREPB", + "PREAB", + "REFPB", + "REFAB", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + } + } + }); + + mPools.insert({ + "CAS_BUS", { + 1, { + "RD", + "RDA", + "WR", + "WRA", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + "REFPB", + } + } + }); + + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRCDRD = tCK * mMemspecJson["memtimingspec"].toObject()["RCDRD"].toInt(); + tRCDWR = tCK * mMemspecJson["memtimingspec"].toObject()["RCDWR"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRDS = tCK * mMemspecJson["memtimingspec"].toObject()["RRDS"].toInt(); + tRRDL = tCK * mMemspecJson["memtimingspec"].toObject()["RRDL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tPL = tCK * mMemspecJson["memtimingspec"].toObject()["PL"].toInt(); + tCCDS = tCK * mMemspecJson["memtimingspec"].toObject()["CCDS"].toInt(); + tCCDL = tCK * mMemspecJson["memtimingspec"].toObject()["CCDL"].toInt(); + tRTW = tCK * mMemspecJson["memtimingspec"].toObject()["RTW"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTRS = tCK * mMemspecJson["memtimingspec"].toObject()["WTRS"].toInt(); + tWTRL = tCK * mMemspecJson["memtimingspec"].toObject()["WTRL"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tRFC = tCK * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tRFCSB = tCK * mMemspecJson["memtimingspec"].toObject()["RFCSB"].toInt(); + tRREFD = tCK * mMemspecJson["memtimingspec"].toObject()["RREFD"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + + tPD = tCKE; + tCKESR = tCKE + tCK; + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDPDE = tRL + tPL + tBURST + tCK; + tRDSRE = tRDPDE; + tWRPRE = tWL + tBURST + tWR; + tWRPDE = tWL + tPL + tBURST + tCK + tWR; + tWRAPDE = tWL + tPL + tBURST + tCK + tWR; + tWRRDS = tWL + tBURST + tWTRS; + tWRRDL = tWL + tBURST + tWTRL; + +} + +const std::vector TimeDependenciesInfoHBM2::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFPB", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoHBM2::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRDL, "ACT", DependencyType::IntraBankGroup, "tRRDL"}, + {tRRDS, "ACT", DependencyType::IntraRank, "tRRDS"}, + {tRTP + tRP - tCK, "RDA", DependencyType::IntraBank, "tRTP + tRP - tCK"}, + {tWRPRE + tRP - tCK, "WRA", DependencyType::IntraBank, "tWRPRE + tRP - tCK"}, + {tRP - tCK, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, + {tRP - tCK, "PREAB", DependencyType::IntraRank, "tRP - tCK"}, + {tXP - tCK, "PDXA", DependencyType::IntraRank, "tXP - tCK"}, + {tXP - tCK, "PDXP", DependencyType::IntraRank, "tXP - tCK"}, + {tRFC - tCK, "REFAB", DependencyType::IntraRank, "tRFC - tCK"}, + {tRFCSB - tCK, "REFPB", DependencyType::IntraBank, "tRFCSB - tCK"}, + {tRREFD - tCK, "REFPB", DependencyType::IntraBankGroup, "tRREFD - tCK"}, + {tRREFD - tCK, "REFPB", DependencyType::IntraRank, "tRREFD - tCK"}, + {tXS - tCK, "SREFEX", DependencyType::IntraRank, "tXS - tCK"}, + {2 * tCK, "RAS_BUS", DependencyType::InterRank, "2 * tCK"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCDRD + tCK, "ACT", DependencyType::IntraBank, "tRCDRD + tCK"}, + {tCCDL, "RD", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "RD", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RD", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "RDA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RDA", DependencyType::IntraRank, "tCCDS"}, + {tWRRDL, "WR", DependencyType::IntraBank, "tWRRDL"}, + {tWRRDL, "WR", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WR", DependencyType::IntraRank, "tWRRDS"}, + {tWRRDL, "WRA", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WRA", DependencyType::IntraRank, "tWRRDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCDWR + tCK, "ACT", DependencyType::IntraBank, "tRCDWR + tCK"}, + {tRTW, "RD", DependencyType::IntraBank, "tRTW"}, + {tRTW, "RD", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RD", DependencyType::IntraRank, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraRank, "tRTW"}, + {tCCDL, "WR", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "WR", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WR", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "WRA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WRA", DependencyType::IntraRank, "tCCDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {tRTP, "RD", DependencyType::IntraBank, "tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCDRD + tCK, "ACT", DependencyType::IntraBank, "tRCDRD + tCK"}, + {tCCDL, "RD", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "RD", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RD", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "RDA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RDA", DependencyType::IntraRank, "tCCDS"}, + {tWL + tBURST + max({tWR - tRTP, tWTRL}), "WR", DependencyType::IntraBank, "tWL + tBURST + max(tWR - tRTP, tWTRL)"}, + {tWRRDL, "WR", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WR", DependencyType::IntraRank, "tWRRDS"}, + {tWRRDL, "WRA", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WRA", DependencyType::IntraRank, "tWRRDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCDWR + tCK, "ACT", DependencyType::IntraBank, "tRCDWR + tCK"}, + {tRTW, "RD", DependencyType::IntraBank, "tRTW"}, + {tRTW, "RD", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RD", DependencyType::IntraRank, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraRank, "tRTW"}, + {tCCDL, "WR", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "WR", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WR", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "WRA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WRA", DependencyType::IntraRank, "tCCDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFPB"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraBank, "tRC + tCK"}, + {tRRDL + tCK, "ACT", DependencyType::IntraBankGroup, "tRRDL + tCK"}, + {tRRDS + tCK, "ACT", DependencyType::IntraRank, "tRRDS + tCK"}, + {tRTP + tRP, "RDA", DependencyType::IntraBank, "tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tRFCSB, "REFPB", DependencyType::IntraBank, "tRFCSB"}, + {tRREFD, "REFPB", DependencyType::IntraBankGroup, "tRREFD"}, + {tRREFD, "REFPB", DependencyType::IntraRank, "tRREFD"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraRank, "tRC + tCK"}, + {tRTP + tRP, "RDA", DependencyType::IntraRank, "tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tRFCSB, "REFPB", DependencyType::IntraRank, "tRFCSB"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraRank, "tRAS + tCK"}, + {tRTP, "RD", DependencyType::IntraRank, "tRTP"}, + {tRTP, "RDA", DependencyType::IntraRank, "tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tRFCSB, "REFPB", DependencyType::IntraRank, "tRFCSB"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDE, "RD", DependencyType::IntraRank, "tRDPDE"}, + {tRDPDE, "RDA", DependencyType::IntraRank, "tRDPDE"}, + {tWRAPDE, "WRA", DependencyType::IntraRank, "tWRAPDE"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraRank, "tRC + tCK"}, + {max({tRTP + tRP, tRDSRE}), "RDA", DependencyType::IntraRank, "max(tRTP + tRP, tRDSRE)"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tRFCSB, "REFPB", DependencyType::IntraRank, "tRFCSB"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tRDPDE, "RD", DependencyType::IntraRank, "tRDPDE"}, + {tRDPDE, "RDA", DependencyType::IntraRank, "tRDPDE"}, + {tWRPDE, "WR", DependencyType::IntraRank, "tWRPDE"}, + {tWRAPDE, "WRA", DependencyType::IntraRank, "tWRAPDE"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h new file mode 100644 index 00000000..f4c9f523 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h @@ -0,0 +1,57 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoHBM2 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tRP; + uint tRAS; + uint tRC; + uint tRCDRD; + uint tRCDWR; + uint tRTP; + uint tRRDS; + uint tRRDL; + uint tRL; + uint tPL; + uint tCCDS; + uint tCCDL; + uint tRTW; + uint tWL; + uint tWR; + uint tWTRS; + uint tWTRL; + uint tCKE; + uint tPD; + uint tXP; + uint tRFC; + uint tRFCSB; + uint tRREFD; + uint tXS; + uint tCKESR; + uint tFAW; + + uint tBURST; + uint tRDPDE; + uint tRDSRE; + uint tWRPRE; + uint tWRPDE; + uint tWRAPDE; + uint tWRRDS; + uint tWRRDL; + +}; From 6e30f652bef6e80e516e504ce23bf749ba331338 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 10:50:26 +0100 Subject: [PATCH 053/121] Added LPDDR4 dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 5 +- .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 3 + .../specialized/DDR3Configuration.h | 2 +- .../specialized/LPDDR4Configuration.cpp | 12 + .../specialized/LPDDR4Configuration.h | 14 + .../specialized/LPDDR4dbphaseentry.cpp | 36 ++ .../specialized/LPDDR4dbphaseentry.h | 14 + .../TimeDependenciesInfoLPDDR4.cpp | 409 ++++++++++++++++++ .../specialized/TimeDependenciesInfoLPDDR4.h | 68 +++ 10 files changed, 570 insertions(+), 2 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index ef0b9cb9..7acde332 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -122,7 +122,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp - + + businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp + businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index ee0fa3e2..6700934b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -47,6 +47,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } else if (deviceName == "HBM2") { return std::make_shared(tdb); + } else if (deviceName == "LPDDR4") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -68,6 +71,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "HBM2") { return TimeDependenciesInfoHBM2::getPossiblePhases(); + } else if (deviceName == "LPDDR4") { + return TimeDependenciesInfoLPDDR4::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -89,6 +95,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "HBM2") { return true; + } else if (deviceName == "LPDDR4") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index b7b006a4..4198a68a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -38,9 +38,12 @@ #include #include "configurationIF.h" + #include "specialized/DDR3Configuration.h" #include "specialized/DDR4Configuration.h" #include "specialized/HBM2Configuration.h" +#include "specialized/LPDDR4Configuration.h" + #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index 84f59974..8b0e5abd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -2,7 +2,7 @@ #pragma once #include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" -#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" +// #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp new file mode 100644 index 00000000..a091c516 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp @@ -0,0 +1,12 @@ + +#include "LPDDR4Configuration.h" + +LPDDR4Configuration::LPDDR4Configuration(const TraceDB& tdb) { + // mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr LPDDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h new file mode 100644 index 00000000..448d7ddb --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h" + +class LPDDR4Configuration : public ConfigurationIF { + public: + LPDDR4Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp new file mode 100644 index 00000000..4bd416d7 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp @@ -0,0 +1,36 @@ + +#include "LPDDR4dbphaseentry.h" + +LPDDR4DBPhaseEntry::LPDDR4DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + // tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool LPDDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h new file mode 100644 index 00000000..4bec8806 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class LPDDR4DBPhaseEntry : public DBPhaseEntryIF { + public: + LPDDR4DBPhaseEntry(const QSqlQuery&); + + // size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp new file mode 100644 index 00000000..57c5a94b --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -0,0 +1,409 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoLPDDR4.h" + +using namespace std; + +TimeDependenciesInfoLPDDR4::TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoLPDDR4::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "RDA", + "WRA", + "PREPB", + "PREAB", + "REFAB", + "SREFEN", + "SREFEX", + "REFPB", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + "REFPB", + } + } + }); + + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRPpb = tCK * mMemspecJson["memtimingspec"].toObject()["RPpb"].toInt(); + tRPab = tCK * mMemspecJson["memtimingspec"].toObject()["RPab"].toInt(); + tRCpb = tCK * mMemspecJson["memtimingspec"].toObject()["RCpb"].toInt(); + tRCab = tCK * mMemspecJson["memtimingspec"].toObject()["RCab"].toInt(); + tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = tCK * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tRPST = tCK * mMemspecJson["memtimingspec"].toObject()["RPST"].toInt(); + tDQSCK = tCK * mMemspecJson["memtimingspec"].toObject()["DQSCK"].toInt(); + tDQSS = tCK * mMemspecJson["memtimingspec"].toObject()["DQSS"].toInt(); + tDQS2DQ = tCK * mMemspecJson["memtimingspec"].toObject()["DQS2DQ"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tRFCab = tCK * mMemspecJson["memtimingspec"].toObject()["RFCab"].toInt(); + tRFCpb = tCK * mMemspecJson["memtimingspec"].toObject()["RFCpb"].toInt(); + tESCKE = tCK * mMemspecJson["memtimingspec"].toObject()["ESCKE"].toInt(); + tSR = tCK * mMemspecJson["memtimingspec"].toObject()["SR"].toInt(); + tXSR = tCK * mMemspecJson["memtimingspec"].toObject()["XSR"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCMDCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CMDCKE"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDWR = tRL + tDQSCK + tBURST - tWL + tWPRE + tRPST; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tCK + tBURST + tWTR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tRDPRE = tRTP + tBURST - 6 * tCK; + tRDAACT = tRTP + tRPpb + tBURST - 8 * tCK; + tWRPRE = 2 * tCK + tWL + tCK + tBURST + tWR; + tWRAACT = tWL + tBURST + tWR + tCK + tRPpb; + tACTPDEN = 3 * tCK + tCMDCKE; + tPRPDEN = tCK + tCMDCKE; + tRDPDEN = 3 * tCK + tRL + tDQSCK + tBURST + tRPST; + tWRPDEN = 3 * tCK + tWL + (ceil((uint) (tDQSS / (float) tCK)) + ceil((uint) (tDQS2DQ / (float) tCK))) * tCK + tBURST + tWR; + tWRAPDEN = 3 * tCK + tWL + (ceil((uint) (tDQSS / (float) tCK)) + ceil((uint) (tDQS2DQ / (float) tCK))) * tCK + tBURST + tWR + 2 * tCK; + tREFPDEN = tCK + tCMDCKE; + tSREFPDEN = tCK + tESCKE; + +} + +const std::vector TimeDependenciesInfoLPDDR4::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFPB", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + "SRPDEN", + "SRPDEX", + }; +} + +DependencyMap TimeDependenciesInfoLPDDR4::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRCpb, "ACT", DependencyType::IntraBank, "tRCpb"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, + {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, + {tRPpb - 2 * tCK, "PREPB", DependencyType::IntraBank, "tRPpb - 2 * tCK"}, + {tRPab - 2 * tCK, "PREAB", DependencyType::IntraRank, "tRPab - 2 * tCK"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFCab - 2 * tCK, "REFAB", DependencyType::IntraRank, "tRFCab - 2 * tCK"}, + {tRFCpb - 2 * tCK, "REFPB", DependencyType::IntraBank, "tRFCpb - 2 * tCK"}, + {tRRD - 2 * tCK, "REFPB", DependencyType::IntraRank, "tRRD - 2 * tCK"}, + {tXSR - 2 * tCK, "SREFEX", DependencyType::IntraRank, "tXSR - 2 * tCK"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD, "WR", DependencyType::IntraBank, "tWRRD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + 2 * tCK, "ACT", DependencyType::IntraBank, "tRAS + 2 * tCK"}, + {tRDPRE, "RD", DependencyType::IntraBank, "tRDPRE"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tPPD, "PREPB", DependencyType::IntraRank, "tPPD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {max({tWRRD, tWRPRE - tRDPRE}), "WR", DependencyType::IntraBank, "max(tWRRD, tWRPRE - tRDPRE)"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFPB"), + forward_as_tuple( + initializer_list{ + {tRCpb + 2 * tCK, "ACT", DependencyType::IntraBank, "tRCpb + 2 * tCK"}, + {tRRD + 2 * tCK, "ACT", DependencyType::IntraRank, "tRRD + 2 * tCK"}, + {tRDPRE + tRPpb, "RDA", DependencyType::IntraBank, "tRDPRE + tRPpb"}, + {tWRPRE + tRPpb, "WRA", DependencyType::IntraBank, "tWRPRE + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraBank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {tRFCpb, "REFPB", DependencyType::IntraBank, "tRFCpb"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRCpb + 2 * tCK, "ACT", DependencyType::IntraRank, "tRCpb + 2 * tCK"}, + {tRDPRE + tRPpb, "RDA", DependencyType::IntraRank, "tRDPRE + tRPpb"}, + {tWRPRE + tRPpb, "WRA", DependencyType::IntraRank, "tWRPRE + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraRank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + 2 * tCK, "ACT", DependencyType::IntraRank, "tRAS + 2 * tCK"}, + {tRDPRE, "RD", DependencyType::IntraRank, "tRDPRE"}, + {tRDPRE, "RDA", DependencyType::IntraRank, "tRDPRE"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tPPD, "PREPB", DependencyType::IntraRank, "tPPD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tREFPDEN, "REFPB", DependencyType::IntraRank, "tREFPDEN"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tCKE, "PDEP", DependencyType::IntraRank, "tCKE"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRCpb + 2 * tCK, "ACT", DependencyType::IntraRank, "tRCpb + 2 * tCK"}, + {max({tRDPDEN, tRDPRE + tRPpb}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tRDPRE + tRPpb)"}, + {max({tWRAPDEN, tWRPRE + tRPpb}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRPpb)"}, + {tRPpb, "PREPB", DependencyType::IntraRank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tSR, "SREFEN", DependencyType::IntraRank, "tSR"}, + {tXP, "SRPDEX", DependencyType::IntraRank, "tXP"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFPB", DependencyType::IntraRank, "tREFPDEN"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tCKE, "PDEA", DependencyType::IntraRank, "tCKE"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SRPDEN"), + forward_as_tuple( + initializer_list{ + {tSREFPDEN, "SREFEN", DependencyType::IntraRank, "tSREFPDEN"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SRPDEX"), + forward_as_tuple( + initializer_list{ + {tCKE, "SRPDEN", DependencyType::IntraRank, "tCKE"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h new file mode 100644 index 00000000..93e4406b --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h @@ -0,0 +1,68 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoLPDDR4 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tRRD; + uint tRCD; + uint tRAS; + uint tFAW; + uint tRPpb; + uint tRPab; + uint tRCpb; + uint tRCab; + uint tCCD; + uint tRTP; + uint tWR; + uint tWTR; + uint tPPD; + uint tWPRE; + uint tRPST; + uint tDQSCK; + uint tDQSS; + uint tDQS2DQ; + uint tRL; + uint tWL; + uint tRFCab; + uint tRFCpb; + uint tESCKE; + uint tSR; + uint tXSR; + uint tXP; + uint tCKE; + uint tCMDCKE; + uint tRTRS; + + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRRD_R; + uint tRDPRE; + uint tRDAACT; + uint tWRPRE; + uint tWRAACT; + uint tACTPDEN; + uint tPRPDEN; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + uint tREFPDEN; + uint tSREFPDEN; + +}; From a9d52572b2c67f30776173d8c3bc12449370c124 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 11 Mar 2022 10:00:24 +0100 Subject: [PATCH 054/121] Added DDR5 dependencies. Must be double checked. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 + .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 1 + .../specialized/DDR5Configuration.cpp | 16 + .../specialized/DDR5Configuration.h | 14 + .../specialized/DDR5dbphaseentry.cpp | 55 +++ .../dbEntries/specialized/DDR5dbphaseentry.h | 18 + .../specialized/TimeDependenciesInfoDDR5.cpp | 373 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR5.h | 109 +++++ .../phasedependenciestracker.cpp | 2 +- 10 files changed, 600 insertions(+), 1 deletion(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 7acde332..6db1bec5 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -127,6 +127,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp + businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp + businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 6700934b..9d731976 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -50,6 +50,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } else if (deviceName == "LPDDR4") { return std::make_shared(tdb); + } else if (deviceName == "DDR5") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -74,6 +77,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "LPDDR4") { return TimeDependenciesInfoLPDDR4::getPossiblePhases(); + } else if (deviceName == "DDR5") { + return TimeDependenciesInfoDDR5::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -98,6 +104,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "LPDDR4") { return true; + } else if (deviceName == "DDR5") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index 4198a68a..7b252277 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -43,6 +43,7 @@ #include "specialized/DDR4Configuration.h" #include "specialized/HBM2Configuration.h" #include "specialized/LPDDR4Configuration.h" +#include "specialized/DDR5Configuration.h" #include "data/tracedb.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp new file mode 100644 index 00000000..a5b412ee --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -0,0 +1,16 @@ + +#include "DDR5Configuration.h" +#include + +DDR5Configuration::DDR5Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { + auto phase = std::make_shared(query); + + std::dynamic_pointer_cast(mDeviceDeps)->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); + + return phase; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h new file mode 100644 index 00000000..e1ca0634 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h" + +class DDR5Configuration : public ConfigurationIF { + public: + DDR5Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp new file mode 100644 index 00000000..b7533b8f --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -0,0 +1,55 @@ + +#include "DDR5dbphaseentry.h" + +DDR5DBPhaseEntry::DDR5DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraLogRankAndDifferentRanks = { + dep.depType == DependencyType::IntraLogicalRank + && tLogicalRank != other->tLogicalRank + }; + bool const skipOnIntraPhysRankAndDifferentRanks = { + dep.depType == DependencyType::IntraPhysicalRank + && tPhysicalRank != other->tPhysicalRank + }; + bool const skipOnIntraDIMMRankAndDifferentRanks = { + dep.depType == DependencyType::IntraDIMMRank + && tDIMMRank != other->tDIMMRank + }; + bool const skipOnInterDIMMRankAndSameRank = { + dep.depType == DependencyType::InterDIMMRank + && tDIMMRank == other->tDIMMRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraLogRankAndDifferentRanks + || skipOnIntraPhysRankAndDifferentRanks + || skipOnIntraDIMMRankAndDifferentRanks + || skipOnInterDIMMRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h new file mode 100644 index 00000000..19b35540 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -0,0 +1,18 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class DDR5DBPhaseEntry : public DBPhaseEntryIF { + public: + DDR5DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + + size_t tLogicalRank; + size_t tPhysicalRank; + size_t tDIMMRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp new file mode 100644 index 00000000..098b973d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -0,0 +1,373 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoDDR5.h" +#include + +using namespace std; + +TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); + + mBitsDIMMRanks = ceil(log2(mNumOfDIMMRanks)); + mBitsPhysicalRanks = ceil(log2(mNumOfPhysicalRanks)); + mBitsLogicalRanks = ceil(log2(mNumOfLogicalRanks)); + + mLogRankMask = (1 << mBitsLogicalRanks) - 1; + mPhysRankMask = ((1 << mBitsPhysicalRanks) - 1) << mBitsLogicalRanks; + mDIMMRankMask = ((1 << mBitsDIMMRanks) - 1) << mBitsPhysicalRanks << mBitsLogicalRanks; +} + +void TimeDependenciesInfoDDR5::rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const { + logRID = (rankID & mLogRankMask); + physRID = (rankID & mPhysRankMask) >> mBitsLogicalRanks; + dimmRID = (rankID & mDIMMRankMask) >> mBitsPhysicalRanks >> mBitsLogicalRanks; +} + +void TimeDependenciesInfoDDR5::mInitializeValues() { + mNumOfRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfRanks"].toInt(); + mNumOfDIMMRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfDIMMRanks"].toInt(); + mNumOfPhysicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfPhysicalRanks"].toInt(); + mNumOfLogicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfLogicalRanks"].toInt(); + + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + refMode = mMemspecJson["memarchitecturespec"].toObject()["refMode"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "RDA", + "WRA", + "PREPB", + "PREAB", + "REFAB", + } + } + }); + + mPools.insert({ + "FAW_LOGICAL", { + 4, { + "ACT", + } + } + }); + + mPools.insert({ + "FAW_PHYSICAL", { + 4, { + "ACT", + } + } + }); + + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + RBL = tCK * mMemspecJson["memtimingspec"].toObject()["BL"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRPRE = tCK * mMemspecJson["memtimingspec"].toObject()["RPRE"].toInt(); + tRPST = tCK * mMemspecJson["memtimingspec"].toObject()["RPST"].toInt(); + tRDDQS = tCK * mMemspecJson["memtimingspec"].toObject()["RDDQS"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + WBL = tCK * mMemspecJson["memtimingspec"].toObject()["BL"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tWPST = tCK * mMemspecJson["memtimingspec"].toObject()["WPST"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tCCD_L_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L_slr"].toInt(); + tCCD_L_WR_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L_WR_slr"].toInt(); + tCCD_S_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S_slr"].toInt(); + tCCD_S_WR_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S_WR_slr"].toInt(); + tCCD_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_dlr"].toInt(); + tCCD_WR_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_WR_dlr"].toInt(); + tCCD_WR_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_WR_dpr"].toInt(); + tRRD_S_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_S_slr"].toInt(); + tRRD_L_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_L_slr"].toInt(); + tRRD_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_dlr"].toInt(); + tFAW_slr = tCK * mMemspecJson["memtimingspec"].toObject()["FAW_slr"].toInt(); + tFAW_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["FAW_dlr"].toInt(); + tWTR_L = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_L"].toInt(); + tWTR_S = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_S"].toInt(); + tRFC_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC_slr"].toInt(); + tRFC_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC_dlr"].toInt(); + tRFC_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC_dpr"].toInt(); + tRFCsb_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFCsb_slr"].toInt(); + tRFCsb_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFCsb_dlr"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tREFSBRD_slr = tCK * mMemspecJson["memtimingspec"].toObject()["REFSBRD_slr"].toInt(); + tREFSBRD_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["REFSBRD_dlr"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + UNKNOWN = tCK * mMemspecJson["memtimingspec"].toObject()["NKNOWN"].toInt(); + tCPDED = tCK * mMemspecJson["memtimingspec"].toObject()["CPDED"].toInt(); + tPD = tCK * mMemspecJson["memtimingspec"].toObject()["PD"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + + tRC = tRAS + tRP; + + if (refMode == 1) { + tRFC_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC1_slr"].toInt(); + tRFC_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC1_dlr"].toInt(); + tRFC_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC1_dpr"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI1"].toInt(); + } else { + tRFC_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC2_slr"].toInt(); + tRFC_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC2_dlr"].toInt(); + tRFC_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC2_dpr"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI2"].toInt(); + } + + tRD_BURST = (uint) (RBL / (float) dataRate) * tCK; + tWR_BURST = (uint) (WBL / (float) dataRate) * tCK; + tWTRA = tWR - tRTP; + tWRRDA = tWL + tWR_BURST + tWTRA; + tWRPRE = tWL + tWR_BURST + tWR; + tRDAACT = tRTP + tRP; + tWRAACT = tWRPRE + tRP; + tCCD_L_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_S_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_RTW_dlr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tRDRD_dpr = tRD_BURST + tRTRS; + tRDRD_ddr = tRD_BURST + tRTRS; + tRDWR_dpr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; + tRDWR_ddr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; + tCCD_L_WTR_slr = tWL + tWR_BURST + tWTR_L; + tCCD_S_WTR_slr = tWL + tWR_BURST + tWTR_S; + tCCD_WTR_dlr = tWL + tWR_BURST + tWTR_S; + tWRWR_dpr = max(tCCD_WR_dpr, tWR_BURST + tRTRS); + tWRWR_ddr = tWR_BURST + tRTRS; + tWRRD_dpr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; + tWRRD_ddr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; + tRDPDEN = tRL + tRD_BURST + tCK; + tWRPDEN = tWL + tWR_BURST + tWR + tCK; + tWRAPDEN = tWL + tWR_BURST + tWR + tCK; + +} + +const std::vector TimeDependenciesInfoDDR5::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRD_L_slr, "ACT", DependencyType::IntraBankGroup, "tRRD_L_slr"}, + {tRRD_S_slr, "ACT", DependencyType::IntraLogicalRank, "tRRD_S_slr"}, + {tRRD_dlr, "ACT", DependencyType::IntraPhysicalRank, "tRRD_dlr"}, + {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, + {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, + {tRP - tCK, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, + {tRP - tCK, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, + {tRFC_slr - tCK, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + {tFAW_slr, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {tRTP + tCK, "RD", DependencyType::IntraBank, "tRTP + tCK"}, + {tWRPRE + tCK, "WR", DependencyType::IntraBank, "tWRPRE + tCK"}, + {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tWRRDA, "WR", DependencyType::IntraBank, "tWRRDA"}, + {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, + {tRDAACT + tCK, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, + {tWRPRE + tRP + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tRP, "PREPB", DependencyType::IntraLogicalRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraLogicalRank, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraLogicalRank, "tRAS + tCK"}, + {tRTP + tCK, "RD", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tRTP + tCK, "RDA", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tWRPRE + tCK, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tWRPRE + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h new file mode 100644 index 00000000..a243090e --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -0,0 +1,109 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + void rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const; + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint mNumOfRanks; + uint mNumOfDIMMRanks; + uint mNumOfPhysicalRanks; + uint mNumOfLogicalRanks; + + uint burstLength; + uint dataRate; + uint refMode; + + uint tRCD; + uint tPPD; + uint tRP; + uint tRAS; + uint tRC; + uint tRL; + uint RBL; + uint tRTP; + uint tRPRE; + uint tRPST; + uint tRDDQS; + uint tWL; + uint WBL; + uint tWPRE; + uint tWPST; + uint tWR; + uint tCCD_L_slr; + uint tCCD_L_WR_slr; + uint tCCD_S_slr; + uint tCCD_S_WR_slr; + uint tCCD_dlr; + uint tCCD_WR_dlr; + uint tCCD_WR_dpr; + uint tRRD_S_slr; + uint tRRD_L_slr; + uint tRRD_dlr; + uint tFAW_slr; + uint tFAW_dlr; + uint tWTR_L; + uint tWTR_S; + uint tRFC_slr; + uint tRFC_dlr; + uint tRFC_dpr; + uint tRFCsb_slr; + uint tRFCsb_dlr; + uint tREFI; + uint tREFSBRD_slr; + uint tREFSBRD_dlr; + uint tRTRS; + uint UNKNOWN; + uint tCPDED; + uint tPD; + uint tXP; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; + + uint tRD_BURST; + uint tWR_BURST; + uint tWTRA; + uint tWRRDA; + uint tWRPRE; + uint tRDAACT; + uint tWRAACT; + uint tCCD_L_RTW_slr; + uint tCCD_S_RTW_slr; + uint tCCD_RTW_dlr; + uint tRDRD_dpr; + uint tRDRD_ddr; + uint tRDWR_dpr; + uint tRDWR_ddr; + uint tCCD_L_WTR_slr; + uint tCCD_S_WTR_slr; + uint tCCD_WTR_dlr; + uint tWRWR_dpr; + uint tWRWR_ddr; + uint tWRRD_dpr; + uint tWRRD_ddr; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + + protected: + uint mBitsDIMMRanks; + uint mBitsPhysicalRanks; + uint mBitsLogicalRanks; + uint mLogRankMask; + uint mPhysRankMask; + uint mDIMMRankMask; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 9c0fb5fe..a5334f19 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -212,7 +212,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetDependencies(commands); + const DependencyMap deviceDependencies = deviceConfig->getDependencies(commands); // Tries to find all timing dependencies for each phase on the trace PoolControllerMap poolController = deviceConfig->getPools(); From d2e85bdae5a02394fa2547bc84fde60d99f426ea Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 16 Mar 2022 10:42:22 +0100 Subject: [PATCH 055/121] Modified DDR5 to comply with time checker. --- .../common/StringMapper.cpp | 8 + .../common/StringMapper.h | 56 ++-- .../specialized/TimeDependenciesInfoDDR5.cpp | 274 ++++++++++++++++-- .../specialized/TimeDependenciesInfoDDR5.h | 9 + 4 files changed, 290 insertions(+), 57 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index 450410bf..c6cd1e33 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -35,6 +35,10 @@ QString StringMapper::getIDStr(StringMapper::Identifier id) { {StringMapper::Identifier::RDA, "RDA"}, {StringMapper::Identifier::WRA, "WRA"}, {StringMapper::Identifier::REFPB, "REFPB"}, + {StringMapper::Identifier::PRESB, "PRESB"}, + {StringMapper::Identifier::RFMAB, "RFMAB"}, + {StringMapper::Identifier::REFSB, "REFSB"}, + {StringMapper::Identifier::RFMSB, "RFMSB"}, }; auto it = enumToStr.find(id); @@ -70,6 +74,10 @@ StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { {"RDA", StringMapper::Identifier::RDA}, {"WRA", StringMapper::Identifier::WRA}, {"REFPB", StringMapper::Identifier::REFPB}, + {"PRESB", StringMapper::Identifier::PRESB}, + {"RFMAB", StringMapper::Identifier::RFMAB}, + {"REFSB", StringMapper::Identifier::REFSB}, + {"RFMSB", StringMapper::Identifier::RFMSB}, }; auto it = strToEnum.find(id); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index b4034cd1..b372c0c2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -7,32 +7,36 @@ class StringMapper { public: enum Identifier { - None, - CMD_BUS, - RAS_BUS, - CAS_BUS, - NAW, - FAW, - _32AW, - FAW_LOGICAL, - FAW_PHYSICAL, - REFAB, - PREAB, - PDEP, - PDXP, - SREFEN, - SREFEX, - PDEA, - PDXA, - SRPDEN, - SRPDEX, - ACT, - RD, - WR, - PREPB, - RDA, - WRA, - REFPB + None, + CMD_BUS, + RAS_BUS, + CAS_BUS, + NAW, + FAW, + _32AW, + FAW_LOGICAL, + FAW_PHYSICAL, + REFAB, + PREAB, + PDEP, + PDXP, + SREFEN, + SREFEX, + PDEA, + PDXA, + SRPDEN, + SRPDEX, + ACT, + RD, + WR, + PREPB, + RDA, + WRA, + REFPB, + PRESB, + RFMAB, + REFSB, + RFMSB }; public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 098b973d..1033f910 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -32,6 +32,8 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); refMode = mMemspecJson["memarchitecturespec"].toObject()["refMode"].toInt(); + cmdMode = mMemspecJson["memarchitecturespec"].toObject()["cmdMode"].toInt(); + bitWidth = mMemspecJson["memarchitecturespec"].toObject()["width"].toInt(); mPools.insert({ "CMD_BUS", { @@ -44,6 +46,10 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { "PREPB", "PREAB", "REFAB", + "PRESB", + "RFMAB", + "REFSB", + "RFMSB", } } }); @@ -52,6 +58,8 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { "FAW_LOGICAL", { 4, { "ACT", + "REFSB", + "RFMSB", } } }); @@ -60,6 +68,8 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { "FAW_PHYSICAL", { 4, { "ACT", + "REFSB", + "RFMSB", } } }); @@ -124,30 +134,45 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI2"].toInt(); } + if (cmdMode == 2) { + shortCmdOffset = 1 * tCK; + longCmdOffset = 3 * tCK; + } else { + shortCmdOffset = 0 * tCK; + longCmdOffset = 1 * tCK; + } + + cmdLengthDiff = tCK * mMemspecJson["memarchitecturespec"].toObject()["cmdMode"].toInt(); + if (!(burstLength == 16 && bitWidth == 4)) + tCCD_L_WR_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L_WR2_slr"].toInt(); + + tBURST16 = 8 * tCK; + tBURST32 = 16 * tCK; + tRD_BURST = (uint) (RBL / (float) dataRate) * tCK; tWR_BURST = (uint) (WBL / (float) dataRate) * tCK; tWTRA = tWR - tRTP; - tWRRDA = tWL + tWR_BURST + tWTRA; - tWRPRE = tWL + tWR_BURST + tWR; + tWRRDA = tWL + tBURST16 + tWTRA; + tWRPRE = tWL + tBURST16 + tWR; tRDAACT = tRTP + tRP; tWRAACT = tWRPRE + tRP; - tCCD_L_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; - tCCD_S_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; - tCCD_RTW_dlr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_L_RTW_slr = tRL - tWL + tBURST16 + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_S_RTW_slr = tRL - tWL + tBURST16 + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_RTW_dlr = tRL - tWL + tBURST16 + 2 * tCK - tRDDQS + tRPST + tWPRE; tRDRD_dpr = tRD_BURST + tRTRS; tRDRD_ddr = tRD_BURST + tRTRS; tRDWR_dpr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; tRDWR_ddr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; - tCCD_L_WTR_slr = tWL + tWR_BURST + tWTR_L; - tCCD_S_WTR_slr = tWL + tWR_BURST + tWTR_S; - tCCD_WTR_dlr = tWL + tWR_BURST + tWTR_S; - tWRWR_dpr = max(tCCD_WR_dpr, tWR_BURST + tRTRS); - tWRWR_ddr = tWR_BURST + tRTRS; - tWRRD_dpr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; - tWRRD_ddr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; - tRDPDEN = tRL + tRD_BURST + tCK; - tWRPDEN = tWL + tWR_BURST + tWR + tCK; - tWRAPDEN = tWL + tWR_BURST + tWR + tCK; + tCCD_L_WTR_slr = tWL + tBURST16 + tWTR_L; + tCCD_S_WTR_slr = tWL + tBURST16 + tWTR_S; + tCCD_WTR_dlr = tWL + tBURST16 + tWTR_S; + tWRWR_dpr = max(tCCD_WR_dpr, tBURST16 + tRTRS); + tWRWR_ddr = tBURST16 + tRTRS; + tWRRD_dpr = tWL - tRL + tBURST16 + tRTRS + tRDDQS + tWPST + tRPRE; + tWRRD_ddr = tWL - tRL + tBURST16 + tRTRS + tRDDQS + tWPST + tRPRE; + tRDPDEN = tRL + tBURST16 + cmdLengthDiff; + tWRPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; + tWRAPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; } @@ -156,9 +181,13 @@ const std::vector TimeDependenciesInfoDDR5::getPossiblePhases() { "ACT", "RD", "WR", + "PRESB", "PREPB", "RDA", "WRA", + "RFMAB", + "REFSB", + "RFMSB", "REFAB", "PREAB", "PDEP", @@ -184,12 +213,21 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tRRD_dlr, "ACT", DependencyType::IntraPhysicalRank, "tRRD_dlr"}, {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, - {tRP - tCK, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, - {tRP - tCK, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, - {tRFC_slr - tCK, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {tWRAACT + tBURST16, "WRA", DependencyType::IntraBank, "tWRAACT + tBURST16"}, + {tRP - cmdLengthDiff, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, + {tRP - cmdLengthDiff, "PRESB", DependencyType::IntraBankGroup, "tRP - tCK"}, + {tRP - cmdLengthDiff, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, + {tRFC_slr - cmdLengthDiff, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {tRFC_slr - cmdLengthDiff, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "REFSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tREFSBRD_slr - cmdLengthDiff, "REFSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, + {tREFSBRD_dlr - cmdLengthDiff, "REFSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tREFSBRD_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, + {tREFSBRD_dlr - cmdLengthDiff, "RFMSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, - {tFAW_slr, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, - {tFAW_dlr, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + {tFAW_slr - longCmdOffset, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr - longCmdOffset, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, } ) ); @@ -203,23 +241,39 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -232,25 +286,42 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { initializer_list{ {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_L_WR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr + tBURST16"}, {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -261,11 +332,13 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("PREPB"), forward_as_tuple( initializer_list{ - {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, - {tRTP + tCK, "RD", DependencyType::IntraBank, "tRTP + tCK"}, - {tWRPRE + tCK, "WR", DependencyType::IntraBank, "tWRPRE + tCK"}, + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBank, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBank, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBank, "tWRPRE + tCK + tBURST16"}, {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PRESB", DependencyType::IntraPhysicalRank, "tPPD"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -280,24 +353,41 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tWRRDA, "WR", DependencyType::IntraBank, "tWRRDA"}, + {tWRRDA + tBURST16, "WR", DependencyType::IntraBank, "tWRRDA + tBURST16"}, {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -310,25 +400,42 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { initializer_list{ {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_L_WR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr + tBURST16"}, {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -339,29 +446,134 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("REFAB"), forward_as_tuple( initializer_list{ - {tRC + tCK, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, - {tRDAACT + tCK, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, - {tWRPRE + tRP + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, + {tWRPRE + tRP + cmdLengthDiff, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tWRPRE + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK + tBURST16"}, {tRP, "PREPB", DependencyType::IntraLogicalRank, "tRP"}, {tRP, "PREAB", DependencyType::IntraLogicalRank, "tRP"}, {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) ); + dmap.emplace( + piecewise_construct, + forward_as_tuple("RFMAB"), + forward_as_tuple( + initializer_list{ + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, + {tWRPRE + tRP + cmdLengthDiff, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tWRPRE + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraLogicalRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraLogicalRank, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFSB"), + forward_as_tuple( + initializer_list{ + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRC + tCK"}, + {tRRD_L_slr + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRRD_L_slr + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRDAACT + tCK"}, + {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK"}, + {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraBankGroup, "tRP"}, + {tRP, "PRESB", DependencyType::IntraBankGroup, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFCsb_slr, "REFSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "REFSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tRFCsb_slr, "RFMSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "RFMSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + {tFAW_slr - shortCmdOffset, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr - shortCmdOffset, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RFMSB"), + forward_as_tuple( + initializer_list{ + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRC + tCK"}, + {tRRD_L_slr + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRRD_L_slr + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRDAACT + tCK"}, + {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK"}, + {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraBankGroup, "tRP"}, + {tRP, "PRESB", DependencyType::IntraBankGroup, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFCsb_slr, "REFSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "REFSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tRFCsb_slr, "RFMSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "RFMSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + {tFAW_slr - shortCmdOffset, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr - shortCmdOffset, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + } + ) + ); + dmap.emplace( piecewise_construct, forward_as_tuple("PREAB"), forward_as_tuple( initializer_list{ - {tRAS + tCK, "ACT", DependencyType::IntraLogicalRank, "tRAS + tCK"}, - {tRTP + tCK, "RD", DependencyType::IntraLogicalRank, "tRTP + tCK"}, - {tRTP + tCK, "RDA", DependencyType::IntraLogicalRank, "tRTP + tCK"}, - {tWRPRE + tCK, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, - {tWRPRE + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK + tBURST16"}, + {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK + tBURST16"}, + {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PRESB"), + forward_as_tuple( + initializer_list{ + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBankGroup, "tRTP + tCK"}, + {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, + {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index a243090e..24b80eec 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -98,6 +98,15 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesIF { uint tWRPDEN; uint tWRAPDEN; + uint cmdMode; + uint bitWidth; + uint cmdLengthDiff; + uint shortCmdOffset; + uint longCmdOffset; + + uint tBURST16; + uint tBURST32; + protected: uint mBitsDIMMRanks; uint mBitsPhysicalRanks; From 837662bd35995936ae36392d5747550ec9d0a4e3 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 17 Mar 2022 11:03:14 +0100 Subject: [PATCH 056/121] Added copyright notice. --- .../common/QStringComparator.cpp | 34 ++++++++++++++++++ .../common/QStringComparator.h | 34 ++++++++++++++++++ .../common/StringMapper.cpp | 34 ++++++++++++++++++ .../common/StringMapper.h | 34 ++++++++++++++++++ .../common/timedependency.h | 34 ++++++++++++++++++ .../configurations/configurationIF.cpp | 34 ++++++++++++++++++ .../configurations/configurationIF.h | 34 ++++++++++++++++++ .../specialized/DDR3Configuration.cpp | 34 ++++++++++++++++++ .../specialized/DDR3Configuration.h | 34 ++++++++++++++++++ .../specialized/DDR4Configuration.cpp | 34 ++++++++++++++++++ .../specialized/DDR4Configuration.h | 34 ++++++++++++++++++ .../specialized/DDR5Configuration.cpp | 34 ++++++++++++++++++ .../specialized/DDR5Configuration.h | 34 ++++++++++++++++++ .../specialized/HBM2Configuration.cpp | 34 ++++++++++++++++++ .../specialized/HBM2Configuration.h | 34 ++++++++++++++++++ .../specialized/LPDDR4Configuration.cpp | 34 ++++++++++++++++++ .../specialized/LPDDR4Configuration.h | 34 ++++++++++++++++++ .../dbEntries/dbphaseentryIF.h | 34 ++++++++++++++++++ .../specialized/DDR3dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/DDR3dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/DDR4dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/DDR4dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/DDR5dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/DDR5dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/HBM2dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/HBM2dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/LPDDR4dbphaseentry.cpp | 34 ++++++++++++++++++ .../specialized/LPDDR4dbphaseentry.h | 35 +++++++++++++++++++ .../deviceDependencies/poolcontroller.cpp | 34 ++++++++++++++++++ .../deviceDependencies/poolcontroller.h | 34 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR3.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR3.h | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR4.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR4.h | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR5.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR5.h | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoHBM2.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoHBM2.h | 35 ++++++++++++++++++- .../TimeDependenciesInfoLPDDR4.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoLPDDR4.h | 35 ++++++++++++++++++- 40 files changed, 1361 insertions(+), 10 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp index a56a891c..f3d3128e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "QStringComparator.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h index 4f6fc913..479eecae 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index c6cd1e33..5e74151a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "StringMapper.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index b372c0c2..2464afcc 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h index 06a4750f..7fd828fc 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp index 35c96028..d41e5cad 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "configurationIF.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h index 38595563..440e0dc8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp index abe11bf8..934ab61a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR3Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index 8b0e5abd..ebd8d195 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp index ce696152..2cef13f2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR4Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h index 992e8df2..7534bcb6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp index a5b412ee..5f0022e6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR5Configuration.h" #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h index e1ca0634..6025f15c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp index 0ba89bae..d746eadd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "HBM2Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h index 5abbaa37..3cf77a1f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp index a091c516..bc328d81 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "LPDDR4Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h index 448d7ddb..f7587a93 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index 3d61939e..fd62a755 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index 61a22bb9..add142ae 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h index b312e59f..904ee54f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp index 611ac9b7..2dc988a2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR4dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h index 7f53fe6c..94e65857 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp index b7533b8f..b1d2f3e3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR5dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h index 19b35540..651b8fb3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp index 09e2a38a..1c0b039e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "HBM2dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h index 541693fd..d3b6c24a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp index 4bd416d7..d16e296b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "LPDDR4dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h index 4bec8806..e2612bce 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h @@ -1,4 +1,39 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + #pragma once #include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp index 813fc687..b54fcc84 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "poolcontroller.h" #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index 262d4997..17f7aefb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp index 0bc82412..5b68f4fd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoDDR3.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h index 28d36a87..b1b5bd73 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index 287239af..9a6a89c5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoDDR4.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h index 5b89e31a..f6366603 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 1033f910..58020485 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoDDR5.h" #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index 24b80eec..a3b587b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp index 977de023..790a4ed7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoHBM2.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h index f4c9f523..8ec86bb8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 57c5a94b..8f988584 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoLPDDR4.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h index 93e4406b..20613bb1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once From c58ac6cfcc7b82a9417e769a5a753da1753e963e Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 17 Mar 2022 12:06:02 +0100 Subject: [PATCH 057/121] Renamed some objects from suffix IF to suffix Base. Added a small readme to the 'dramTimeDependencies' folder. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 +- .../dramTimeDependencies/README.md | 53 +++++++++++++++++++ ...figurationIF.cpp => configurationBase.cpp} | 20 +++---- ...{configurationIF.h => configurationBase.h} | 14 ++--- .../configurations/configurationfactory.cpp | 8 +-- .../configurations/configurationfactory.h | 4 +- .../specialized/DDR3Configuration.cpp | 2 +- .../specialized/DDR3Configuration.h | 6 +-- .../specialized/DDR4Configuration.cpp | 2 +- .../specialized/DDR4Configuration.h | 6 +-- .../specialized/DDR5Configuration.cpp | 2 +- .../specialized/DDR5Configuration.h | 6 +-- .../specialized/HBM2Configuration.cpp | 2 +- .../specialized/HBM2Configuration.h | 6 +-- .../specialized/LPDDR4Configuration.cpp | 2 +- .../specialized/LPDDR4Configuration.h | 6 +-- .../{dbphaseentryIF.h => dbphaseentryBase.h} | 8 +-- .../specialized/DDR3dbphaseentry.cpp | 2 +- .../dbEntries/specialized/DDR3dbphaseentry.h | 6 +-- .../specialized/DDR4dbphaseentry.cpp | 2 +- .../dbEntries/specialized/DDR4dbphaseentry.h | 6 +-- .../specialized/DDR5dbphaseentry.cpp | 2 +- .../dbEntries/specialized/DDR5dbphaseentry.h | 6 +-- .../specialized/HBM2dbphaseentry.cpp | 2 +- .../dbEntries/specialized/HBM2dbphaseentry.h | 6 +-- .../specialized/LPDDR4dbphaseentry.cpp | 2 +- .../specialized/LPDDR4dbphaseentry.h | 6 +-- ...iesIF.cpp => dramtimedependenciesbase.cpp} | 14 ++--- ...denciesIF.h => dramtimedependenciesbase.h} | 6 +-- .../specialized/DDR3TimeDependencies.cpp | 2 +- .../specialized/DDR3TimeDependencies.h | 4 +- .../specialized/TimeDependenciesInfoDDR3.cpp | 2 +- .../specialized/TimeDependenciesInfoDDR3.h | 4 +- .../specialized/TimeDependenciesInfoDDR4.cpp | 2 +- .../specialized/TimeDependenciesInfoDDR4.h | 4 +- .../specialized/TimeDependenciesInfoDDR5.cpp | 2 +- .../specialized/TimeDependenciesInfoDDR5.h | 4 +- .../specialized/TimeDependenciesInfoHBM2.cpp | 2 +- .../specialized/TimeDependenciesInfoHBM2.h | 4 +- .../TimeDependenciesInfoLPDDR4.cpp | 2 +- .../specialized/TimeDependenciesInfoLPDDR4.h | 4 +- .../phasedependenciestracker.cpp | 8 +-- .../phasedependenciestracker.h | 4 +- 43 files changed, 156 insertions(+), 103 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{configurationIF.cpp => configurationBase.cpp} (82%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{configurationIF.h => configurationBase.h} (87%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{dbphaseentryIF.h => dbphaseentryBase.h} (91%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{dramtimedependenciesIF.cpp => dramtimedependenciesbase.cpp} (88%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{dramtimedependenciesIF.h => dramtimedependenciesbase.h} (94%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 6db1bec5..ea1123f7 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -107,8 +107,8 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/common/StringMapper.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp - businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/configurations/configurationIF.cpp + businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp + businessObjects/dramTimeDependencies/configurations/configurationBase.cpp businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp # businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md new file mode 100644 index 00000000..43efabe9 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md @@ -0,0 +1,53 @@ + +## Relevant classes +``` +PhaseDependenciesTracker +├── ConfigurationFactory +│   └── ConfigurationBase +│   ├── DBPhaseEntryBase +│   └── DRAMTimeDependenciesBase +│   ├── DependencyMap +│   │   └── PhaseTimeDependencies +│   └── PoolControllerMap +└── DBDependencyEntry +``` + +#### PhaseDependenciesTracker +Responsible for the whole execution. Instantiates a configuration class through the ConfigurationFactory, loads the selected phases into memory, calculates the time dependencies between phases and saves into the database file. + +#### ConfigurationFactory +Creates a configuration object given its name. + +#### ConfigurationBase +Interface and common functionality of configuration classes. These include creating DBPhaseEntryBase objects from the database for the given device and delegate methods. + +#### DBPhaseEntryBase +Interfaces to device specific phase entries. Specificities include object data, construction and dependency logic. + +#### DRAMTimeDependenciesBase +Interfaces to device's time dependencies descriptor class. + +#### DependencyMap +A STL map using auxiliar objects. Maps phases to their PhaseTimeDependencies. + +#### PhaseTimeDependencies +An auxiliar class with initializer list constructor. Contains a vector of TimeDependency objects and its maximum time value. + +#### PoolControllerMap +Maps pool names to PoolController objects. Pools keep track of all potential dependencies of a given phase. + +#### DBDependencyEntry +Contains the data to be written to the database. + + +## Suggested steps for creating a device: +1. Create a time dependencies class inheriting from the DRAMTimeDependenciesBase object. +2. Create the phase entry object inheriting from DBPhaseEntryBase. The object must determine the relevant data to be used and how phases may be correlated. +3. Create a configuration class for your object inheriting from ConfigurationBase. This will contain the dependencies maps and instantiate the specialized DBPhaseEntryBase object. +4. Add the newly created device to the functions of the ConfigurationFactory class. The device name is taken from the database. + +#### Example +For instance, we have the necessary objects for calculating DDR3 device dependencies implemented in the following files: +1. deviceDependencies/specialized/TimeDependenciesInfoDDR3.(h/cpp) +2. dbEntries/specialized/DDR3dbphaseentry.(h/cpp) +3. configurations/specialized/DDR3Configuration.(h/cpp) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.cpp similarity index 82% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.cpp index d41e5cad..1f4e62d0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.cpp @@ -33,34 +33,34 @@ * Iron Prando da Silva */ -#include "configurationIF.h" +#include "configurationBase.h" -const uint ConfigurationIF::getClk() const { +const uint ConfigurationBase::getClk() const { if (!mDeviceDeps) - throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getClk'."); + throw std::invalid_argument("Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getClk'."); return mDeviceDeps->getClk(); } -DependencyMap ConfigurationIF::getDependencies(std::vector& commands) const { +DependencyMap ConfigurationBase::getDependencies(std::vector& commands) const { if (!mDeviceDeps) - throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getDependencies'."); + throw std::invalid_argument("Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getDependencies'."); return mDeviceDeps->getDependencies(commands); } -PoolControllerMap ConfigurationIF::getPools() const { +PoolControllerMap ConfigurationBase::getPools() const { if (!mDeviceDeps) - throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getAWPools'."); + throw std::invalid_argument("Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getAWPools'."); return mDeviceDeps->getPools(); } -const QString ConfigurationIF::getDeviceName(const TraceDB& tdb) { +const QString ConfigurationBase::getDeviceName(const TraceDB& tdb) { return mGetMemspec(tdb)["memoryType"].toString(); } -const uint ConfigurationIF::mGetClk(const TraceDB& tdb) { +const uint ConfigurationBase::mGetClk(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT clk FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); @@ -72,7 +72,7 @@ const uint ConfigurationIF::mGetClk(const TraceDB& tdb) { return clock; } -const QJsonObject ConfigurationIF::mGetMemspec(const TraceDB& tdb) { +const QJsonObject ConfigurationBase::mGetMemspec(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.h similarity index 87% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.h index 440e0dc8..a9eb54e7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.h @@ -37,15 +37,15 @@ #include -#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class ConfigurationIF { +class ConfigurationBase { public: - ConfigurationIF() {}; - virtual ~ConfigurationIF() = default; + ConfigurationBase() {}; + virtual ~ConfigurationBase() = default; - virtual std::shared_ptr makePhaseEntry(const QSqlQuery&) const { return nullptr; } + virtual std::shared_ptr makePhaseEntry(const QSqlQuery&) const { return nullptr; } // Delegated methods const uint getClk() const; @@ -55,7 +55,7 @@ class ConfigurationIF { static const QString getDeviceName(const TraceDB& tdb); protected: - std::shared_ptr mDeviceDeps = nullptr; + std::shared_ptr mDeviceDeps = nullptr; static const uint mGetClk(const TraceDB& tdb); static const QJsonObject mGetMemspec(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 9d731976..48d4d553 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -35,8 +35,8 @@ #include "configurationfactory.h" -std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) { - const QString deviceName = ConfigurationIF::getDeviceName(tdb); +std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) { + const QString deviceName = ConfigurationBase::getDeviceName(tdb); if (deviceName == "DDR3") { return std::make_shared(tdb); @@ -62,7 +62,7 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } const std::vector ConfigurationFactory::possiblePhases(const TraceDB& tdb) { - const QString deviceName = ConfigurationIF::getDeviceName(tdb); + const QString deviceName = ConfigurationBase::getDeviceName(tdb); if (deviceName == "DDR3") { // return DDR3TimeDependencies::getPossiblePhases(); @@ -90,7 +90,7 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { uint clk; // Not used - const QString deviceName = ConfigurationIF::getDeviceName(tdb); + const QString deviceName = ConfigurationBase::getDeviceName(tdb); if (deviceName == "DDR3") { return true; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index 7b252277..d1c3eaa6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -37,7 +37,7 @@ #include -#include "configurationIF.h" +#include "configurationBase.h" #include "specialized/DDR3Configuration.h" #include "specialized/DDR4Configuration.h" @@ -49,7 +49,7 @@ class ConfigurationFactory { public: - static std::shared_ptr make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); static const std::vector possiblePhases(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp index 934ab61a..ce676838 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp @@ -41,6 +41,6 @@ DDR3Configuration::DDR3Configuration(const TraceDB& tdb) { } -std::shared_ptr DDR3Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr DDR3Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index ebd8d195..0d0b74db 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -35,15 +35,15 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" // #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" -class DDR3Configuration : public ConfigurationIF { +class DDR3Configuration : public ConfigurationBase { public: DDR3Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp index 2cef13f2..d36d11f3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp @@ -40,6 +40,6 @@ DDR4Configuration::DDR4Configuration(const TraceDB& tdb) { } -std::shared_ptr DDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr DDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h index 7534bcb6..f089b2e2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h" -class DDR4Configuration : public ConfigurationIF { +class DDR4Configuration : public ConfigurationBase { public: DDR4Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp index 5f0022e6..d43b27b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -41,7 +41,7 @@ DDR5Configuration::DDR5Configuration(const TraceDB& tdb) { } -std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { auto phase = std::make_shared(query); std::dynamic_pointer_cast(mDeviceDeps)->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h index 6025f15c..700e6af9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h" -class DDR5Configuration : public ConfigurationIF { +class DDR5Configuration : public ConfigurationBase { public: DDR5Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp index d746eadd..59586627 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp @@ -40,6 +40,6 @@ HBM2Configuration::HBM2Configuration(const TraceDB& tdb) { } -std::shared_ptr HBM2Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr HBM2Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h index 3cf77a1f..ac6297e4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h" -class HBM2Configuration : public ConfigurationIF { +class HBM2Configuration : public ConfigurationBase { public: HBM2Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp index bc328d81..b8b66f0a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp @@ -41,6 +41,6 @@ LPDDR4Configuration::LPDDR4Configuration(const TraceDB& tdb) { } -std::shared_ptr LPDDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr LPDDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h index f7587a93..5882a0b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h" -class LPDDR4Configuration : public ConfigurationIF { +class LPDDR4Configuration : public ConfigurationBase { public: LPDDR4Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h similarity index 91% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h index fd62a755..81f82a22 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h @@ -40,12 +40,12 @@ #include "businessObjects/phases/phasedependency.h" #include "businessObjects/dramTimeDependencies/common/common.h" -class DBPhaseEntryIF { +class DBPhaseEntryBase { public: - DBPhaseEntryIF() = default; - virtual ~DBPhaseEntryIF() = default; + DBPhaseEntryBase() = default; + virtual ~DBPhaseEntryBase() = default; - virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } + virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } size_t id; StringMapper phaseName; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index add142ae..ab5019ab 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -46,7 +46,7 @@ DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h index 904ee54f..ed78fc98 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class DDR3DBPhaseEntry : public DBPhaseEntryIF { +class DDR3DBPhaseEntry : public DBPhaseEntryBase { public: DDR3DBPhaseEntry(const QSqlQuery&); // size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp index 2dc988a2..ce79d097 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp @@ -46,7 +46,7 @@ DDR4DBPhaseEntry::DDR4DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool DDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool DDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h index 94e65857..ddf19e90 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class DDR4DBPhaseEntry : public DBPhaseEntryIF { +class DDR4DBPhaseEntry : public DBPhaseEntryBase { public: DDR4DBPhaseEntry(const QSqlQuery&); size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp index b1d2f3e3..d2e95f6c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -46,7 +46,7 @@ DDR5DBPhaseEntry::DDR5DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h index 651b8fb3..6b118760 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -35,9 +35,9 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class DDR5DBPhaseEntry : public DBPhaseEntryIF { +class DDR5DBPhaseEntry : public DBPhaseEntryBase { public: DDR5DBPhaseEntry(const QSqlQuery&); @@ -48,5 +48,5 @@ class DDR5DBPhaseEntry : public DBPhaseEntryIF { size_t tPhysicalRank; size_t tDIMMRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp index 1c0b039e..6403f9bf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp @@ -46,7 +46,7 @@ HBM2DBPhaseEntry::HBM2DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h index d3b6c24a..476f9e99 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class HBM2DBPhaseEntry : public DBPhaseEntryIF { +class HBM2DBPhaseEntry : public DBPhaseEntryBase { public: HBM2DBPhaseEntry(const QSqlQuery&); size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp index d16e296b..78de425b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp @@ -46,7 +46,7 @@ LPDDR4DBPhaseEntry::LPDDR4DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool LPDDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool LPDDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h index e2612bce..1017ea8f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h @@ -36,14 +36,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class LPDDR4DBPhaseEntry : public DBPhaseEntryIF { +class LPDDR4DBPhaseEntry : public DBPhaseEntryBase { public: LPDDR4DBPhaseEntry(const QSqlQuery&); // size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp similarity index 88% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp index df67097c..00ee6b85 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp @@ -33,18 +33,18 @@ * Iron Prando da Silva */ -#include "dramtimedependenciesIF.h" +#include "dramtimedependenciesbase.h" #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inTCK) { +DRAMTimeDependenciesBase::DRAMTimeDependenciesBase(const QJsonObject& memspec, const uint inTCK) { mMemspecJson = memspec; tCK = inTCK; } DependencyMap -DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { +DRAMTimeDependenciesBase::getDependencies(std::vector& dependencyFilter) const { DependencyMap dependenciesMap; std::vector dependencyFilterStrMapper(dependencyFilter.begin(), dependencyFilter.end()); @@ -68,11 +68,11 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -PoolControllerMap DRAMTimeDependenciesIF::getPools() const { +PoolControllerMap DRAMTimeDependenciesBase::getPools() const { return PoolControllerMap(mPools); } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesBase::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); // TODO - probably there is a smarter way to filter these values, @@ -113,7 +113,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesBase::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -159,7 +159,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } -uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { +uint DRAMTimeDependenciesBase::mFindVectorMaximum(const std::vector& dependencyList) const { auto maxElement = std::max_element( dependencyList.begin(), dependencyList.end(), diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h similarity index 94% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h index bfdeb033..04f524fb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h @@ -39,10 +39,10 @@ #include "businessObjects/dramTimeDependencies/common/common.h" #include "poolcontrollermap.h" -class DRAMTimeDependenciesIF { +class DRAMTimeDependenciesBase { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint tCK); - virtual ~DRAMTimeDependenciesIF() = default; + DRAMTimeDependenciesBase(const QJsonObject& memspec, const uint tCK); + virtual ~DRAMTimeDependenciesBase() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index 4cdf2562..9382eadf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -37,7 +37,7 @@ using namespace std; -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h index 1d7f777e..ae73e23c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h @@ -35,9 +35,9 @@ #pragma once -#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h" -class DDR3TimeDependencies final : public DRAMTimeDependenciesIF { +class DDR3TimeDependencies final : public DRAMTimeDependenciesBase { public: DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp index 5b68f4fd..d3cc0756 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoDDR3::TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoDDR3::TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h index b1b5bd73..89183f1b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoDDR3 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoDDR3 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index 9a6a89c5..afcd0b62 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoDDR4::TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoDDR4::TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h index f6366603..ac974ec7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoDDR4 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoDDR4 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 58020485..60083362 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -38,7 +38,7 @@ using namespace std; -TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); mBitsDIMMRanks = ceil(log2(mNumOfDIMMRanks)); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index a3b587b5..e07bb7ad 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp index 790a4ed7..6f8c849a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoHBM2::TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoHBM2::TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h index 8ec86bb8..06a55775 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoHBM2 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoHBM2 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 8f988584..3b8fc142 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoLPDDR4::TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoLPDDR4::TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h index 20613bb1..03f49166 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoLPDDR4 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoLPDDR4 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index a5334f19..e2ba2d9b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -152,9 +152,9 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } -const std::vector> -PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr deviceConfig, TraceDB& tdb, const std::vector& commands) { - std::vector> phases; +const std::vector> +PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr deviceConfig, TraceDB& tdb, const std::vector& commands) { + std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TBankgroup, Transactions.TRank " " FROM Phases " @@ -207,7 +207,7 @@ PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr -PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr deviceConfig, const std::vector>& phases, std::vector& commands) { +PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr deviceConfig, const std::vector>& phases, std::vector& commands) { std::vector entries; entries.reserve((size_t) (0.4 * phases.size())); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index ebd7e16a..de20b25f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -52,8 +52,8 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetFilteredPhases(const std::shared_ptr, TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const std::shared_ptr, const std::vector>& phases, std::vector& commands); + static const std::vector> mGetFilteredPhases(const std::shared_ptr, TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::shared_ptr, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); From f0caf8b60c480c469e26806e615842ae9c982aaf Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 21 Mar 2022 11:02:33 +0100 Subject: [PATCH 058/121] Added 'bank in group' granularity for ddr5. --- .../specialized/DDR5Configuration.cpp | 6 +- .../specialized/DDR5dbphaseentry.cpp | 5 ++ .../dbEntries/specialized/DDR5dbphaseentry.h | 1 + .../deviceDependencies/poolcontroller.h | 3 +- .../deviceDependencies/poolcontrollermap.cpp | 12 ++++ .../deviceDependencies/poolcontrollermap.h | 2 + .../specialized/TimeDependenciesInfoDDR5.cpp | 57 ++++++++++--------- .../specialized/TimeDependenciesInfoDDR5.h | 14 ++--- .../phasedependenciestracker.cpp | 12 +++- .../phases/phasedependency.cpp | 3 + .../businessObjects/phases/phasedependency.h | 1 + 11 files changed, 73 insertions(+), 43 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp index d43b27b5..e0957d53 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -44,7 +44,9 @@ DDR5Configuration::DDR5Configuration(const TraceDB& tdb) { std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { auto phase = std::make_shared(query); - std::dynamic_pointer_cast(mDeviceDeps)->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); - + auto device = std::dynamic_pointer_cast(mDeviceDeps); + device->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); + device->bankIDToBankInGroup(phase->tLogicalRank, phase->tBank, phase->tBankInGroup); + return phase; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp index d2e95f6c..adeee0d8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -60,6 +60,10 @@ bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: dep.depType == DependencyType::IntraBankGroup && tBankgroup != other->tBankgroup }; + bool const skipOnIntraBankInGroupAndDifferentBankInGroup = { + dep.depType == DependencyType::IntraBankInGroup + && tBankInGroup != other->tBankInGroup + }; bool const skipOnIntraLogRankAndDifferentRanks = { dep.depType == DependencyType::IntraLogicalRank && tLogicalRank != other->tLogicalRank @@ -81,6 +85,7 @@ bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: return !( skipOnIntraBankAndDifferentBanks || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraBankInGroupAndDifferentBankInGroup || skipOnIntraLogRankAndDifferentRanks || skipOnIntraPhysRankAndDifferentRanks || skipOnIntraDIMMRankAndDifferentRanks diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h index 6b118760..cf94e903 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -42,6 +42,7 @@ class DDR5DBPhaseEntry : public DBPhaseEntryBase { DDR5DBPhaseEntry(const QSqlQuery&); size_t tBankgroup; + size_t tBankInGroup; size_t tRank; size_t tLogicalRank; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index 17f7aefb..ac650bf9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -46,7 +46,8 @@ public: void push(DBDependencyEntry); void increment(); void merge(std::vector& depEntries); - + size_t count() { return mCount; } + bool isDependency(const StringMapper& phaseName); protected: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index 95ba8ebe..c20f7d18 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -83,3 +83,15 @@ bool PoolControllerMap::isDependency(const StringMapper& poolName, const StringM } } + +size_t PoolControllerMap::count(const StringMapper& poolName) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + return pool->second.count(); + + } else { + // TODO throw? + return 0; + + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index b7d247f1..fa5b7910 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -46,9 +46,11 @@ public: void push(const StringMapper& poolName, DBDependencyEntry); void increment(const StringMapper& poolName); void merge(std::vector& depEntries); + size_t count(const StringMapper& poolName); bool isDependency(const StringMapper& poolName, const StringMapper& phaseName); + protected: std::map mPools; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 60083362..dc087ca7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -41,26 +41,27 @@ using namespace std; TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); - mBitsDIMMRanks = ceil(log2(mNumOfDIMMRanks)); - mBitsPhysicalRanks = ceil(log2(mNumOfPhysicalRanks)); - mBitsLogicalRanks = ceil(log2(mNumOfLogicalRanks)); - - mLogRankMask = (1 << mBitsLogicalRanks) - 1; - mPhysRankMask = ((1 << mBitsPhysicalRanks) - 1) << mBitsLogicalRanks; - mDIMMRankMask = ((1 << mBitsDIMMRanks) - 1) << mBitsPhysicalRanks << mBitsLogicalRanks; } void TimeDependenciesInfoDDR5::rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const { - logRID = (rankID & mLogRankMask); - physRID = (rankID & mPhysRankMask) >> mBitsLogicalRanks; - dimmRID = (rankID & mDIMMRankMask) >> mBitsPhysicalRanks >> mBitsLogicalRanks; + logRID = rankID; + physRID = logRID / mNumLogicalRanksPerPhysicalRank; + dimmRID = physRID / mNumPhysicalRanksPerDIMMRank; +} + +void TimeDependenciesInfoDDR5::bankIDToBankInGroup(size_t logicalRankID, size_t bankID, size_t& bankInGroup) const { + bankInGroup = logicalRankID * mNumBanksPerGroup + bankID % mNumBanksPerGroup; + } void TimeDependenciesInfoDDR5::mInitializeValues() { mNumOfRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfRanks"].toInt(); mNumOfDIMMRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfDIMMRanks"].toInt(); - mNumOfPhysicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfPhysicalRanks"].toInt(); - mNumOfLogicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfLogicalRanks"].toInt(); + mNumPhysicalRanksPerDIMMRank = mMemspecJson["memarchitecturespec"].toObject()["nbrOfPhysicalRanks"].toInt(); + mNumLogicalRanksPerPhysicalRank = mMemspecJson["memarchitecturespec"].toObject()["nbrOfLogicalRanks"].toInt(); + + mNumBanksPerGroup = mMemspecJson["memarchitecturespec"].toObject()["nbrOfBanks"].toInt(1); + mNumBanksPerGroup /= mMemspecJson["memarchitecturespec"].toObject()["nbrOfBankGroups"].toInt(1); burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); @@ -248,14 +249,14 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, {tWRAACT + tBURST16, "WRA", DependencyType::IntraBank, "tWRAACT + tBURST16"}, {tRP - cmdLengthDiff, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, - {tRP - cmdLengthDiff, "PRESB", DependencyType::IntraBankGroup, "tRP - tCK"}, + {tRP - cmdLengthDiff, "PRESB", DependencyType::IntraBankInGroup, "tRP - tCK"}, {tRP - cmdLengthDiff, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, {tRFC_slr - cmdLengthDiff, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, {tRFC_slr - cmdLengthDiff, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, - {tRFCsb_slr - cmdLengthDiff, "REFSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "REFSB", DependencyType::IntraBankInGroup, "tRFCsb_slr - tCK"}, {tREFSBRD_slr - cmdLengthDiff, "REFSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, {tREFSBRD_dlr - cmdLengthDiff, "REFSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, - {tRFCsb_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraBankInGroup, "tRFCsb_slr - tCK"}, {tREFSBRD_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, {tREFSBRD_dlr - cmdLengthDiff, "RFMSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, @@ -523,13 +524,13 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("REFSB"), forward_as_tuple( initializer_list{ - {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRC + tCK"}, + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankInGroup, "tRC + tCK"}, {tRRD_L_slr + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRRD_L_slr + tCK"}, - {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRDAACT + tCK"}, - {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK"}, - {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK + tBURST16"}, - {tRP, "PREPB", DependencyType::IntraBankGroup, "tRP"}, - {tRP, "PRESB", DependencyType::IntraBankGroup, "tRP"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankInGroup, "tRDAACT + tCK"}, + {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankInGroup, "tWRAACT + tRP + tCK"}, + {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankInGroup, "tWRAACT + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraBankInGroup, "tRP"}, + {tRP, "PRESB", DependencyType::IntraBankInGroup, "tRP"}, {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, @@ -600,13 +601,13 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("PRESB"), forward_as_tuple( initializer_list{ - {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRAS + tCK"}, - {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBankGroup, "tRTP + tCK"}, - {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRTP + tCK"}, - {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, - {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, - {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, - {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBankInGroup, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBankInGroup, "tRTP + tCK"}, + {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraBankInGroup, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBankInGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBankInGroup, "tWRPRE + tCK + tBURST16"}, + {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraBankInGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankInGroup, "tWRPRE + tCK + tBURST16"}, {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index e07bb7ad..f17513ab 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -44,6 +44,7 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { static const std::vector getPossiblePhases(); void rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const; + void bankIDToBankInGroup(size_t logicalRankID, size_t bankID, size_t& bankInGroup) const; protected: void mInitializeValues() override; @@ -52,8 +53,9 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { protected: uint mNumOfRanks; uint mNumOfDIMMRanks; - uint mNumOfPhysicalRanks; - uint mNumOfLogicalRanks; + uint mNumLogicalRanksPerPhysicalRank; + uint mNumPhysicalRanksPerDIMMRank; + uint mNumBanksPerGroup; uint burstLength; uint dataRate; @@ -139,13 +141,5 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { uint tBURST16; uint tBURST32; - - protected: - uint mBitsDIMMRanks; - uint mBitsPhysicalRanks; - uint mBitsLogicalRanks; - uint mLogRankMask; - uint mPhysRankMask; - uint mDIMMRankMask; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index e2ba2d9b..a9d0f80b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -261,9 +261,17 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrid, otherPhase->phaseName.getIDStr() }); - } + } else if (timeDiff < dep.timeValue && dep.phaseDep == StringMapper::Identifier::CMD_BUS) { + poolController.push(dep.phaseDep, DBDependencyEntry{ + phase->id, + phase->phaseName.getIDStr(), + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName.getIDStr() + }); - if (timeDiff < dep.timeValue) { + } else if (timeDiff < dep.timeValue) { poolController.increment(dep.phaseDep); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index 0cd7ec0e..5b30c638 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -138,6 +138,9 @@ QString PhaseDependency::dependencyTypeName(DependencyType dtype) { case IntraBankGroup: return "IntraBankGroup"; + + case IntraBankInGroup: + return "IntraBankInGroup"; case IntraRank: return "IntraRank"; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index a29a67dd..86c4308a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -50,6 +50,7 @@ enum DependencyType { IntraBank, IntraBankGroup, + IntraBankInGroup, IntraRank, IntraLogicalRank, IntraPhysicalRank, From 828191af5a17d48becefa0fc05cb97f1bff455c5 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 21 Mar 2022 11:21:08 +0100 Subject: [PATCH 059/121] Removed incorrect if check for pool dependency. TODO correct pool time dependency direction. --- .../phasedependenciestracker.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index a9d0f80b..e2ba2d9b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -261,17 +261,9 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrid, otherPhase->phaseName.getIDStr() }); - } else if (timeDiff < dep.timeValue && dep.phaseDep == StringMapper::Identifier::CMD_BUS) { - poolController.push(dep.phaseDep, DBDependencyEntry{ - phase->id, - phase->phaseName.getIDStr(), - PhaseDependency::dependencyTypeName(dep.depType), - dep.timeDepName, - otherPhase->id, - otherPhase->phaseName.getIDStr() - }); + } - } else if (timeDiff < dep.timeValue) { + if (timeDiff < dep.timeValue) { poolController.increment(dep.phaseDep); } From cf8d58898f2d8613b071251292b049acc72b9ac9 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 24 Mar 2022 10:21:54 +0100 Subject: [PATCH 060/121] Corrected pools time tracking. --- .../deviceDependencies/poolcontroller.cpp | 30 +++++-- .../deviceDependencies/poolcontroller.h | 10 ++- .../deviceDependencies/poolcontrollermap.cpp | 6 +- .../deviceDependencies/poolcontrollermap.h | 2 +- .../specialized/DDR3TimeDependencies.cpp | 44 +++++----- .../specialized/TimeDependenciesInfoDDR3.cpp | 58 ++++++------ .../specialized/TimeDependenciesInfoDDR4.cpp | 58 ++++++------ .../specialized/TimeDependenciesInfoDDR5.cpp | 78 ++++++++-------- .../specialized/TimeDependenciesInfoHBM2.cpp | 88 +++++++++---------- .../TimeDependenciesInfoLPDDR4.cpp | 54 ++++++------ .../phasedependenciestracker.cpp | 12 +-- 11 files changed, 229 insertions(+), 211 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp index b54fcc84..3aff2149 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -36,7 +36,7 @@ #include "poolcontroller.h" #include -PoolController::PoolController(const uint poolSize, const std::vector& dependencies) +PoolController::PoolController(const uint poolSize, const std::vector& dependencies) : mDependencies(mAuxSortInput(dependencies)) { mPoolSize = poolSize; @@ -65,17 +65,33 @@ void PoolController::merge(std::vector& depEntries) { } } -bool PoolController::isDependency(const StringMapper& phaseName) { - return std::binary_search( +uint PoolController::getBusyTime(const StringMapper& phaseName) { + PoolEntry v{phaseName, 0}; + + auto entryIt = std::lower_bound( mDependencies.begin(), mDependencies.end(), - phaseName, - StringMapper::compare + v, + [](const PoolEntry& e1, const PoolEntry& e2) { + return e1.first < e2.first; + } ); + + if (entryIt->first == phaseName) { + return entryIt->second; + } else { + return 0; + } } -std::vector PoolController::mAuxSortInput(std::vector vec) { - std::sort(vec.begin(), vec.end()); +std::vector PoolController::mAuxSortInput(std::vector vec) { + std::sort( + vec.begin(), + vec.end(), + [](const PoolEntry& e1, const PoolEntry& e2) { + return e1.first < e2.first; + } + ); return vec; } \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index ac650bf9..e7eb76fb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -37,9 +37,11 @@ #include "businessObjects/dramTimeDependencies/common/common.h" +typedef std::pair PoolEntry; + class PoolController { public: - PoolController(const uint poolSize, const std::vector& dependencies); + PoolController(const uint poolSize, const std::vector& dependencies); ~PoolController() = default; void clear(); @@ -48,14 +50,14 @@ public: void merge(std::vector& depEntries); size_t count() { return mCount; } - bool isDependency(const StringMapper& phaseName); + uint getBusyTime(const StringMapper& phaseName); protected: - const std::vector mDependencies; + const std::vector mDependencies; std::vector mPool; uint mCount = 0; uint mPoolSize = 0; protected: - static std::vector mAuxSortInput(std::vector vec); + static std::vector mAuxSortInput(std::vector vec); }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index c20f7d18..ae00c001 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -72,14 +72,14 @@ void PoolControllerMap::merge(std::vector& depEntries) { } } -bool PoolControllerMap::isDependency(const StringMapper& poolName, const StringMapper& phaseName) { +uint PoolControllerMap::getBusyTime(const StringMapper& poolName, const StringMapper& phaseName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { - return pool->second.isDependency(phaseName); + return pool->second.getBusyTime(phaseName); } else { // TODO throw? - return false; + return 0; } } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index fa5b7910..1266c852 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -48,7 +48,7 @@ public: void merge(std::vector& depEntries); size_t count(const StringMapper& poolName); - bool isDependency(const StringMapper& poolName, const StringMapper& phaseName); + uint getBusyTime(const StringMapper& poolName, const StringMapper& phaseName); protected: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index 9382eadf..827849df 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -45,28 +45,6 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "PREPB", - "RDA", - "WRA", - "REFAB", - "PREAB", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - "PDEA", - "PDXA", - } - } - }); - mPools.insert({"NAW", {4, {"ACT"}}}); - tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); @@ -105,6 +83,28 @@ void DDR3TimeDependencies::mInitializeValues() { tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + tCK; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"PREPB", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"REFAB", tCK}, + {"PREAB", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + } + } + }); + mPools.insert({"NAW", {4, {{"ACT", tFAW}}}}); + } const vector DDR3TimeDependencies::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp index d3cc0756..7b2db32d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -45,35 +45,6 @@ void TimeDependenciesInfoDDR3::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "PREPB", - "RDA", - "WRA", - "REFAB", - "PREAB", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - "PDEA", - "PDXA", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - } - } - }); - tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); @@ -112,6 +83,35 @@ void TimeDependenciesInfoDDR3::mInitializeValues() { tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + tCK; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"PREPB", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"REFAB", tCK}, + {"PREAB", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoDDR3::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index afcd0b62..78c41b64 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -45,35 +45,6 @@ void TimeDependenciesInfoDDR4::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "PREPB", - "RDA", - "WRA", - "REFAB", - "PREAB", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - "PDEA", - "PDXA", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - } - } - }); - tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); @@ -128,6 +99,35 @@ void TimeDependenciesInfoDDR4::mInitializeValues() { tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + tCK; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"PREPB", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"REFAB", tCK}, + {"PREAB", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoDDR4::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index dc087ca7..c36b40b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -69,45 +69,6 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { cmdMode = mMemspecJson["memarchitecturespec"].toObject()["cmdMode"].toInt(); bitWidth = mMemspecJson["memarchitecturespec"].toObject()["width"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "RDA", - "WRA", - "PREPB", - "PREAB", - "REFAB", - "PRESB", - "RFMAB", - "REFSB", - "RFMSB", - } - } - }); - - mPools.insert({ - "FAW_LOGICAL", { - 4, { - "ACT", - "REFSB", - "RFMSB", - } - } - }); - - mPools.insert({ - "FAW_PHYSICAL", { - 4, { - "ACT", - "REFSB", - "RFMSB", - } - } - }); - tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); @@ -208,6 +169,45 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { tWRPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; tWRAPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", 2 * tCK}, + {"RD", 2 * tCK}, + {"WR", 2 * tCK}, + {"RDA", 2 * tCK}, + {"WRA", 2 * tCK}, + {"PREPB", tCK}, + {"PREAB", tCK}, + {"REFAB", tCK}, + {"PRESB", tCK}, + {"RFMAB", tCK}, + {"REFSB", tCK}, + {"RFMSB", tCK}, + } + } + }); + + mPools.insert({ + "FAW_LOGICAL", { + 4, { + {"ACT", tFAW_slr - longCmdOffset}, + {"REFSB", tFAW_slr - shortCmdOffset}, + {"RFMSB", tFAW_slr - shortCmdOffset}, + } + } + }); + + mPools.insert({ + "FAW_PHYSICAL", { + 4, { + {"ACT", tFAW_dlr - longCmdOffset}, + {"REFSB", tFAW_dlr - shortCmdOffset}, + {"RFMSB", tFAW_dlr - shortCmdOffset}, + } + } + }); + } const std::vector TimeDependenciesInfoDDR5::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp index 6f8c849a..8fceeb97 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -45,50 +45,6 @@ void TimeDependenciesInfoHBM2::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "RAS_BUS", { - 1, { - "ACT", - "PREPB", - "PREAB", - "REFPB", - "REFAB", - "PDEA", - "PDXA", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - } - } - }); - - mPools.insert({ - "CAS_BUS", { - 1, { - "RD", - "RDA", - "WR", - "WRA", - "PDEA", - "PDXA", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - "REFPB", - } - } - }); - tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); @@ -126,6 +82,50 @@ void TimeDependenciesInfoHBM2::mInitializeValues() { tWRRDS = tWL + tBURST + tWTRS; tWRRDL = tWL + tBURST + tWTRL; + mPools.insert({ + "RAS_BUS", { + 1, { + {"ACT", 2*tCK}, + {"PREPB", tCK}, + {"PREAB", tCK}, + {"REFPB", tCK}, + {"REFAB", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + } + } + }); + + mPools.insert({ + "CAS_BUS", { + 1, { + {"RD", tCK}, + {"RDA", tCK}, + {"WR", tCK}, + {"WRA", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + {"REFPB", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoHBM2::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 3b8fc142..84976422 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -45,33 +45,6 @@ void TimeDependenciesInfoLPDDR4::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "RDA", - "WRA", - "PREPB", - "PREAB", - "REFAB", - "SREFEN", - "SREFEX", - "REFPB", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - "REFPB", - } - } - }); - tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); @@ -119,6 +92,33 @@ void TimeDependenciesInfoLPDDR4::mInitializeValues() { tREFPDEN = tCK + tCMDCKE; tSREFPDEN = tCK + tESCKE; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", 4 * tCK}, + {"RD", 4 * tCK}, + {"WR", 4 * tCK}, + {"RDA", 4 * tCK}, + {"WRA", 4 * tCK}, + {"PREPB", 2 * tCK}, + {"PREAB", 2 * tCK}, + {"REFAB", 2 * tCK}, + {"SREFEN", 2 * tCK}, + {"SREFEX", 2 * tCK}, + {"REFPB", 2 * tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + {"REFPB", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoLPDDR4::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index e2ba2d9b..eb935e2d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -247,10 +247,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName)) { - if (timeDiff == dep.timeValue) { + auto busyTime = poolController.getBusyTime(dep.phaseDep, otherPhase->phaseName); + if (busyTime > 0 && timeDiff <= busyTime) { + if (timeDiff == busyTime) { // Captures only the first (exactly matching time) phase in // the pool window as a dependency poolController.push(dep.phaseDep, DBDependencyEntry{ @@ -263,14 +264,13 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr Date: Tue, 23 Nov 2021 12:11:15 +0100 Subject: [PATCH 061/121] Testing new color configuration -- Refactored ColorGenerator and added HSV15. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../businessObjects/phases/phase.cpp | 24 ++- .../presentation/util/colorgenerator.cpp | 89 ++------- .../presentation/util/colorgenerator.h | 21 +- .../presentation/util/colorobject.cpp | 179 ++++++++++++++++++ .../presentation/util/colorobject.h | 71 +++++++ 6 files changed, 299 insertions(+), 86 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp create mode 100644 DRAMSys/traceAnalyzer/presentation/util/colorobject.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 3ce4cceb..74b5e4c9 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -76,6 +76,7 @@ add_executable(TraceAnalyzer data/tracedb.cpp presentation/tracenavigator.cpp presentation/util/colorgenerator.cpp + presentation/util/colorobject.cpp presentation/tracedrawing.cpp presentation/traceplotitem.cpp gototimedialog.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 463fde5c..5ee4e694 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -177,16 +177,20 @@ void Phase::drawPhaseDependencies(traceTime begin, traceTime end, double y, QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const { - switch (drawingProperties.colorGrouping) - { - case ColorGrouping::PhaseType: - return getPhaseColor(); - case ColorGrouping::Thread: - return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); - case ColorGrouping::AlphaTransaction: - return ColorGenerator::getAlphaColored(transaction.lock()->id); - case ColorGrouping::Transaction: default: - return ColorGenerator::getColor(transaction.lock()->id); + switch (drawingProperties.colorGrouping) { + case ColorGrouping::PhaseType: + return getPhaseColor(); + break; + case ColorGrouping::Thread: + return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); + break; + case ColorGrouping::AlphaTransaction: + return ColorGenerator::getAlphaColored(transaction.lock()->id, ColorName::HSV15); + + break; + case ColorGrouping::Transaction: + default: + return ColorGenerator::getColor(transaction.lock()->id); } } diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index ae3070a6..11cf1023 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -38,79 +38,30 @@ #include "colorgenerator.h" #include -ColorGenerator::ColorGenerator() + +QColor ColorGenerator::getColor(unsigned int i, ColorName color) { - r[0] = 0xFF; - r[1] = 0x00; - r[2] = 0x00; - r[3] = 0xFF; - g[0] = 0x00; - g[1] = 0xFF; - g[2] = 0x00; - g[3] = 0xFF; - b[0] = 0x00; - b[1] = 0x00; - b[2] = 0xFF; - b[3] = 0x00; - - r[4] = 0xFF; - r[5] = 0x00; - r[6] = 0xFF; - r[7] = 0x6B; - g[4] = 0x00; - g[5] = 0xFF; - g[6] = 0xA5; - g[7] = 0x8E; - b[4] = 0xFF; - b[5] = 0xFF; - b[6] = 0x00; - b[7] = 0x23; - - r[8] = 0x8A; - r[9] = 0xFF; - r[10] = 0x7C; - r[11] = 0x00; - g[8] = 0x2B; - g[9] = 0xD7; - g[10] = 0xFC; - g[11] = 0x00; - b[8] = 0xE2; - b[9] = 0x00; - b[10] = 0x00; - b[11] = 0x80; - - r[12] = 0x80; - r[13] = 0x00; - r[14] = 0xEE; - r[15] = 0xFF; - g[12] = 0x00; - g[13] = 0x80; - g[14] = 0x82; - g[15] = 0x45; - b[12] = 0x00; - b[13] = 0x00; - b[14] = 0xEE; - b[15] = 0x00; + switch(color) { + case ColorName::Default: + return cDefault.getColor(i); + case ColorName::HSV15: + return cHSV15.getColor(i); + } + return {0, 0, 0}; } -QColor ColorGenerator::getColor(unsigned int i) +QColor ColorGenerator::getAlphaColored(unsigned int i, ColorName color) { - static ColorGenerator gen; - i = i % 16; - QColor result(gen.r[i], gen.g[i], gen.b[i]); - result.setAlpha(130); - return result; + switch(color) { + case ColorName::Default: + return cDefault.getAlphaColored(i); + case ColorName::HSV15: + return cHSV15.getAlphaColored(i); + } + + return {0, 0, 0}; } -QColor ColorGenerator::getAlphaColored(unsigned int i) -{ - static ColorGenerator gen; - const int minAlpha = 25; - const int alphaLevels = 40 - 255 / minAlpha; - int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); - i = (i / alphaLevels) % 16; - QColor result(gen.r[i], gen.g[i], gen.b[i]); - result.setAlpha(alpha); - return result; -} +ColorDefault ColorGenerator::cDefault; +ColorHSV15 ColorGenerator::cHSV15; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h index 35941474..7897393d 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h @@ -39,21 +39,28 @@ #ifndef COLORGENERATOR_H #define COLORGENERATOR_H +#include "colorobject.h" + #include #include +enum ColorName +{ + Default, + HSV15 +}; + class ColorGenerator { private: - static constexpr int NumberOfColors = 16; - int r[NumberOfColors]; - int g[NumberOfColors]; - int b[NumberOfColors]; - ColorGenerator(); + ColorGenerator() = delete; + + static ColorDefault cDefault; + static ColorHSV15 cHSV15; public: - static QColor getColor(unsigned int i); - static QColor getAlphaColored(unsigned int i); + static QColor getColor(unsigned int i, ColorName color = ColorName::Default); + static QColor getAlphaColored(unsigned int i, ColorName color = ColorName::Default); }; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp new file mode 100644 index 00000000..9f708e98 --- /dev/null +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2015, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + * Iron Prando da Silva + */ + +#include "colorobject.h" + + +QColor ColorObject::getColor(unsigned int i) +{ + i = i % numberOfColors; + QColor result(r[i], g[i], b[i]); + result.setAlpha(130); + return result; +} + +QColor ColorObject::getAlphaColored(unsigned int i) +{ + const int minAlpha = 50; + const int alphaLevels = 20 - 255 / minAlpha; + + int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); + i = (i / alphaLevels) % numberOfColors; + QColor result(r[i], g[i], b[i]); + result.setAlpha(alpha); + + return result; +} + +ColorDefault::ColorDefault() +{ + numberOfColors = 16; + + r.resize(numberOfColors); + g.resize(numberOfColors); + b.resize(numberOfColors); + + r[0] = 0xFF; + r[1] = 0x00; + r[2] = 0x00; + r[3] = 0xFF; + g[0] = 0x00; + g[1] = 0xFF; + g[2] = 0x00; + g[3] = 0xFF; + b[0] = 0x00; + b[1] = 0x00; + b[2] = 0xFF; + b[3] = 0x00; + + r[4] = 0xFF; + r[5] = 0x00; + r[6] = 0xFF; + r[7] = 0x6B; + g[4] = 0x00; + g[5] = 0xFF; + g[6] = 0xA5; + g[7] = 0x8E; + b[4] = 0xFF; + b[5] = 0xFF; + b[6] = 0x00; + b[7] = 0x23; + + r[8] = 0x8A; + r[9] = 0xFF; + r[10] = 0x7C; + r[11] = 0x00; + g[8] = 0x2B; + g[9] = 0xD7; + g[10] = 0xFC; + g[11] = 0x00; + b[8] = 0xE2; + b[9] = 0x00; + b[10] = 0x00; + b[11] = 0x80; + + r[12] = 0x80; + r[13] = 0x00; + r[14] = 0xEE; + r[15] = 0xFF; + g[12] = 0x00; + g[13] = 0x80; + g[14] = 0x82; + g[15] = 0x45; + b[12] = 0x00; + b[13] = 0x00; + b[14] = 0xEE; + b[15] = 0x00; +} + +ColorHSV15::ColorHSV15() +{ + numberOfColors = 15; + + r.resize(numberOfColors); + g.resize(numberOfColors); + b.resize(numberOfColors); + + r[0] = 0XFF; + r[1] = 0XFF; + r[2] = 0XFF; + r[3] = 0XD1; + r[4] = 0X6C; + r[5] = 0X08; + r[6] = 0X00; + r[7] = 0X00; + r[8] = 0X00; + r[9] = 0X00; + r[10] = 0X00; + r[11] = 0X54; + r[12] = 0XB9; + r[13] = 0XFF; + r[14] = 0XFF; + + g[0] = 0X00; + g[1] = 0X64; + g[2] = 0XC9; + g[3] = 0XFF; + g[4] = 0XFF; + g[5] = 0XFF; + g[6] = 0XFF; + g[7] = 0XFF; + g[8] = 0XD9; + g[9] = 0X74; + g[10] = 0X10; + g[11] = 0X00; + g[12] = 0X00; + g[13] = 0X00; + g[14] = 0X00; + + b[0] = 0X00; + b[1] = 0X00; + b[2] = 0X00; + b[3] = 0X00; + b[4] = 0X00; + b[5] = 0X00; + b[6] = 0X5C; + b[7] = 0XC1; + b[8] = 0XFF; + b[9] = 0XFF; + b[10] = 0XFF; + b[11] = 0XFF; + b[12] = 0XFF; + b[13] = 0XE1; + b[14] = 0X7C; +} diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h new file mode 100644 index 00000000..f54ee8f4 --- /dev/null +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + * Iron Prando da Silva + */ + +#pragma once + +#include + +class ColorObject +{ +protected: + int numberOfColors = 0; + + std::vector r; + std::vector g; + std::vector b; + // std::vector a; + + ColorObject() {}; + +public: + + virtual QColor getColor(unsigned int i); + virtual QColor getAlphaColored(unsigned int i); +}; + +class ColorDefault : public ColorObject +{ +public: + ColorDefault(); +}; + +class ColorHSV15 : public ColorObject +{ +public: + ColorHSV15(); +}; From 0c97541c95ec78002c1c019cd9dc504a51daee8d Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 23 Nov 2021 13:22:09 +0100 Subject: [PATCH 062/121] Minor correction to alpha distribution equation. --- DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp index 9f708e98..a3e21ca8 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -51,8 +51,9 @@ QColor ColorObject::getAlphaColored(unsigned int i) { const int minAlpha = 50; const int alphaLevels = 20 - 255 / minAlpha; - - int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels)); + const int alphaStep = (255. - minAlpha) / alphaLevels; + + int alpha = minAlpha + (int)(alphaStep * (i % alphaLevels)); i = (i / alphaLevels) % numberOfColors; QColor result(r[i], g[i], b[i]); result.setAlpha(alpha); From b5dc20ad735b5108718191931ee671d470751ef0 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 25 Nov 2021 14:05:14 +0100 Subject: [PATCH 063/121] Renamed 'Alpha Colored' to 'Rainbow Colored'. --- .../businessObjects/phases/phase.cpp | 4 ++-- .../presentation/tracedrawingproperties.h | 2 +- DRAMSys/traceAnalyzer/presentation/traceplot.cpp | 16 ++++++++-------- DRAMSys/traceAnalyzer/presentation/traceplot.h | 4 ++-- .../presentation/util/colorgenerator.cpp | 6 +++--- .../presentation/util/colorgenerator.h | 2 +- .../presentation/util/colorobject.cpp | 2 +- .../presentation/util/colorobject.h | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 5ee4e694..7ce91e98 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -184,8 +184,8 @@ QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const case ColorGrouping::Thread: return ColorGenerator::getColor(static_cast(transaction.lock()->thread)); break; - case ColorGrouping::AlphaTransaction: - return ColorGenerator::getAlphaColored(transaction.lock()->id, ColorName::HSV15); + case ColorGrouping::RainbowTransaction: + return ColorGenerator::getRainbowColored(transaction.lock()->id, ColorName::HSV15); break; case ColorGrouping::Transaction: diff --git a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h index 119d1a24..a29d4642 100644 --- a/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h +++ b/DRAMSys/traceAnalyzer/presentation/tracedrawingproperties.h @@ -57,7 +57,7 @@ enum class ColorGrouping PhaseType, Transaction, Thread, - AlphaTransaction + RainbowTransaction }; class TracePlot; diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index d81bc852..b7160fac 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -150,10 +150,10 @@ void TracePlot::setUpActions() QObject::connect(setColorGroupingTransaction, SIGNAL(triggered()), this, SLOT(on_colorGroupingTransaction())); - setColorGroupingAlphaTransaction = new QAction("Group by Transaction - Alpha Colored", this); - addAction(setColorGroupingAlphaTransaction); - QObject::connect(setColorGroupingAlphaTransaction, SIGNAL(triggered()), this, - SLOT(on_colorGroupingAlphaTransaction())); + setColorGroupingRainbowTransaction = new QAction("Group by Transaction - Rainbow Colored", this); + addAction(setColorGroupingRainbowTransaction); + QObject::connect(setColorGroupingRainbowTransaction, SIGNAL(triggered()), this, + SLOT(on_colorGroupingRainbowTransaction())); setColorGroupingThread = new QAction("Group by Thread", this); setColorGroupingThread->setCheckable(true); @@ -231,7 +231,7 @@ void TracePlot::setUpContextMenu() QMenu *colorGroupingSubMenu = new QMenu("Group by", contextMenu); colorGroupingSubMenu->addActions( - {setColorGroupingPhase, setColorGroupingTransaction, setColorGroupingThread, setColorGroupingAlphaTransaction}); + {setColorGroupingPhase, setColorGroupingTransaction, setColorGroupingRainbowTransaction, setColorGroupingThread}); contextMenu->addMenu(colorGroupingSubMenu); dependenciesSubMenu = new QMenu("Show dependencies", contextMenu); @@ -597,10 +597,10 @@ void TracePlot::on_colorGroupingTransaction() replot(); } -void TracePlot::on_colorGroupingAlphaTransaction() +void TracePlot::on_colorGroupingRainbowTransaction() { - drawingProperties.colorGrouping = ColorGrouping::AlphaTransaction; - Q_EMIT(colorGroupingChanged(ColorGrouping::AlphaTransaction)); + drawingProperties.colorGrouping = ColorGrouping::RainbowTransaction; + Q_EMIT(colorGroupingChanged(ColorGrouping::RainbowTransaction)); replot(); } diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.h b/DRAMSys/traceAnalyzer/presentation/traceplot.h index c3ec388c..560b819f 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.h +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.h @@ -108,7 +108,7 @@ private Q_SLOTS: void on_colorGroupingPhase(); void on_colorGroupingTransaction(); void on_colorGroupingThread(); - void on_colorGroupingAlphaTransaction(); + void on_colorGroupingRainbowTransaction(); void on_goToTransaction(); void on_goToPhase(); void on_deselectAll(); @@ -181,7 +181,7 @@ private: QAction *setColorGroupingPhase; QAction *setColorGroupingTransaction; QAction *setColorGroupingThread; - QAction *setColorGroupingAlphaTransaction; + QAction *setColorGroupingRainbowTransaction; QAction *exportToPdf; ToggleCollapsedAction *toggleCollapsedState; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index 11cf1023..c42339f5 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -51,13 +51,13 @@ QColor ColorGenerator::getColor(unsigned int i, ColorName color) return {0, 0, 0}; } -QColor ColorGenerator::getAlphaColored(unsigned int i, ColorName color) +QColor ColorGenerator::getRainbowColored(unsigned int i, ColorName color) { switch(color) { case ColorName::Default: - return cDefault.getAlphaColored(i); + return cDefault.getRainbowColored(i); case ColorName::HSV15: - return cHSV15.getAlphaColored(i); + return cHSV15.getRainbowColored(i); } return {0, 0, 0}; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h index 7897393d..e1e98ec0 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.h @@ -60,7 +60,7 @@ private: public: static QColor getColor(unsigned int i, ColorName color = ColorName::Default); - static QColor getAlphaColored(unsigned int i, ColorName color = ColorName::Default); + static QColor getRainbowColored(unsigned int i, ColorName color = ColorName::Default); }; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp index a3e21ca8..a9a4e82b 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.cpp @@ -47,7 +47,7 @@ QColor ColorObject::getColor(unsigned int i) return result; } -QColor ColorObject::getAlphaColored(unsigned int i) +QColor ColorObject::getRainbowColored(unsigned int i) { const int minAlpha = 50; const int alphaLevels = 20 - 255 / minAlpha; diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h index f54ee8f4..d3ec584c 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorobject.h +++ b/DRAMSys/traceAnalyzer/presentation/util/colorobject.h @@ -55,7 +55,7 @@ protected: public: virtual QColor getColor(unsigned int i); - virtual QColor getAlphaColored(unsigned int i); + virtual QColor getRainbowColored(unsigned int i); }; class ColorDefault : public ColorObject From 5d4b25519741e970fee6b144f8061fcf13f8bf4e Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 14:44:35 +0100 Subject: [PATCH 064/121] Began adding base algorithm for dependency calculations. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../phasedependenciestracker.cpp | 134 ++++++++++++++++++ .../phasedependenciestracker.h | 45 ++++++ .../businessObjects/phases/phasedependency.h | 4 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 12 +- DRAMSys/traceAnalyzer/data/tracedb.h | 3 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 39 +++-- DRAMSys/traceAnalyzer/tracefiletab.h | 1 + DRAMSys/traceAnalyzer/tracefiletab.ui | 9 ++ 9 files changed, 218 insertions(+), 30 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 74b5e4c9..e21f2ff0 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -99,6 +99,7 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp + businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp new file mode 100644 index 00000000..715eed86 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -0,0 +1,134 @@ + +#include "phasedependenciestracker.h" + +void +PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector& commands) { + mDropTable(tdb); + mCreateTable(tdb); + + auto& phases = mGetAllPhases(tdb, commands); + + auto& entries = mCalculateDependencies(phases); + + mInsertIntoTable(tdb, entries); + +} + +void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { + QString command = "DROP TABLE DirectDependencies; "; + + auto query = mExecuteQuery(tdb, command); + query.finish(); +} + +void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { + QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID, DependencyPhaseName ); "; + + auto query = mExecuteQuery(tdb, command); + query.finish(); +} + +void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { + auto numberOfEntries = entries.size(); + size_t bulkInsertionSize = 1000; + + QString command; + size_t counter = 0; + for (auto& entry : entries) { + if (counter == 0) { + // TODO Reset command string and add first command + command = ""; + + } else if (counter == bulkInsertionSize) { + // TODO Write last command and submit + + counter = 0; + + } else { + // TODO + + counter++; + + } + + } + + if (counter != 0) { + // TODO Submit command string + } + +} + +const std::vector> +PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { + std::vector> phases; + + QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " + " FROM Phases " + " INNER JOIN Transactions " + " ON Phases.Transact=Transactions.ID " + " WHERE PhaseName IN ("; + + for (auto cmd : commands) { + queryStr += '\"' + QString::fromStdString(cmd + "\","); + } + queryStr.back() = ')'; + queryStr += " ORDER BY PhaseBegin "; + + auto query = mExecuteQuery(tdb, queryStr); + + if (!query.last()) { + throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" + "Could not retrieve number of rows\n").toStdString(), + tdb.pathToDB.toStdString()); + } + + size_t nrows = query.at() + 1; + + if (!query.first()) { + throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" + "Could not safely retrieve number of rows\n").toStdString(), + tdb.pathToDB.toStdString()); + } + + phases.resize(nrows); + + size_t rowIt = 0; + do { + DBPhaseEntry phase; + phase.id = query.value(0).toLongLong(); + phase.phaseName = query.value(1).toString(); + phase.phaseBegin = query.value(2).toLongLong(); + phase.phaseEnd = query.value(3).toLongLong(); + phase.transact = query.value(4).toLongLong(); + phase.tBank = query.value(5).toLongLong(); + phase.tRank = query.value(6).toLongLong(); + + phases[rowIt] = std::make_shared(phase); + ++rowIt; + } while (query.next()); + + if (rowIt != nrows) { + throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); + } + + return phases; +} + +const std::vector +PhaseDependenciesTracker::mCalculateDependencies(const std::vector>& transactions) { + std::vector entries; + + // TODO Get dependency object for specific trace + // TODO Main dependency calculation loop + + return entries; +} + +QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString queryStr) { + QSqlQuery query(tdb.getDatabase()); + query.prepare(queryStr); + tdb.executeQuery(query); + + return query; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h new file mode 100644 index 00000000..fcfe7021 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -0,0 +1,45 @@ + +#pragma once + +#include +#include +#include + +#include "data/tracedb.h" + +struct DBPhaseEntry { + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; + size_t tRank; +}; + +struct DBDependencyEntry { + size_t delayedPhaseID; + QString delayedPhaseName; + QString dependencyType; + QString timeDependency; + size_t dependencyPhaseID; + QString dependencyPhaseName; +}; + +class PhaseDependenciesTracker { +public: + static void calculateDependencies(TraceDB& tdb, const std::vector& commands); + +private: + static void mDropTable(TraceDB& tdb); + static void mCreateTable(TraceDB& tdb); + static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); + + static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::vector>& phases); + + static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); + + PhaseDependenciesTracker() = delete; + ~PhaseDependenciesTracker() = delete; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index 41be1c1e..fa203556 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -48,8 +48,8 @@ class Phase; enum DependencyType { - Bank, - Rank, + IntraBank, + IntraRank, InterRank }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 6d79a2c8..75c0f133 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -151,10 +151,12 @@ std::vector> TraceDB::getTransactionsInTimespan(con bool TraceDB::checkDependencyTableExists() { executeQuery(checkDependenciesExist); - if (checkDependenciesExist.next() && checkDependenciesExist.value(0).toInt() == 1) - return true; - return false; + bool exists = checkDependenciesExist.next() && checkDependenciesExist.value(0).toInt() == 1; + + checkDependenciesExist.finish(); + + return exists; } void TraceDB::updateDependenciesInTimespan(const Timespan &span) @@ -577,11 +579,11 @@ void TraceDB::mUpdateDependenciesFromQuery(QSqlQuery &query) QString dependencyTypeStr = query.value(2).toString(); if (dependencyTypeStr == "bank") { - type = DependencyType::Bank; + type = DependencyType::IntraBank; } else if (dependencyTypeStr == "rank") { - type = DependencyType::Rank; + type = DependencyType::IntraRank; } else if (dependencyTypeStr == "interRank") { diff --git a/DRAMSys/traceAnalyzer/data/tracedb.h b/DRAMSys/traceAnalyzer/data/tracedb.h index 0ee3e3cb..67ca4d8c 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.h +++ b/DRAMSys/traceAnalyzer/data/tracedb.h @@ -151,6 +151,9 @@ private: QVariant getParameterFromTable(const std::string& parameter, const std::string& table); std::map> _visiblePhases; // Updated at parseTransactionsFromQuery + + // At businessObjects/phasedependenciestracker.h + friend class PhaseDependenciesTracker; }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index bd6e72cb..ba09aa33 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -42,7 +42,7 @@ #include "businessObjects/commentmodel.h" #include "businessObjects/configmodels.h" #include "businessObjects/pythoncaller.h" -#include "businessObjects/tracetime.h" +#include "businessObjects/phasedependenciestracker.h" #include "presentation/traceselector.h" #include "qmessagebox.h" #include "queryeditor.h" @@ -310,30 +310,23 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } } -bool TraceFileTab::eventFilter(QObject *object, QEvent *event) -{ - if (auto canvas = qobject_cast(object)) - { - if (event->type() == QEvent::MouseButtonDblClick) - { - QMouseEvent *mouseEvent = static_cast(event); +void TraceFileTab::on_calculateDependencies_clicked() { + // TODO - anything else? Update view maybe? + // TODO - For now fixed, but must be selectable + std::vector commands = { + "ACT", + "PRE", + "RD", + "RDA", + "WR", + "WRA", + "PDE", + "PDX", + "PREA" + }; - if (mouseEvent->button() != Qt::LeftButton) - return false; + PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), commands); - QwtPlot *plot = canvas->plot(); - - double realTime = plot->invTransform(QwtPlot::xBottom, mouseEvent->x()); - - // Convert from seconds to picoseconds - traceTime time = realTime * 1000 * 1000 * 1000 * 1000; - - navigator->navigateToTime(time); - return true; - } - } - - return QWidget::eventFilter(object, event); } void TraceFileTab::on_startLatencyAnalysis_clicked() diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index a345bbc1..cd36887f 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -117,6 +117,7 @@ Q_SIGNALS: private Q_SLOTS: void on_latencyTreeView_doubleClicked(const QModelIndex &index); + void on_calculateDependencies_clicked(); void on_startLatencyAnalysis_clicked(); void on_startPowerAnalysis_clicked(); }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index 22a0a210..f2cac71d 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -208,6 +208,13 @@ Dependency Information + + + + Calculate Dependencies + + + @@ -247,6 +254,7 @@ + @@ -295,6 +303,7 @@ + true From 4e2855785b21838b621e76d007fd85fe21ab4511 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 16:56:52 +0100 Subject: [PATCH 065/121] Began adding time dependencies interface for to be generated code. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../timedependenciesIF.cpp | 85 +++++++++++++++++++ .../dramTimeDependencies/timedependenciesIF.h | 44 ++++++++++ 3 files changed, 130 insertions(+) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index e21f2ff0..0216e6da 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -103,6 +103,7 @@ add_executable(TraceAnalyzer businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp + businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp new file mode 100644 index 00000000..89cb4052 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -0,0 +1,85 @@ + +#include "timedependenciesIF.h" + +#include + +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { + mGetMemspec(tdb); + +} + +QMap +DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { + QMap dependenciesMap; + + dependenciesMap = mSpecializedGetDependencies(); + + mFilterDependencyMap(dependenciesMap, commands); + + auto it = dependenciesMap.begin(); + while (it != dependenciesMap.end()) { + mFilterDependencyList(it.value().dependencies, commands); + it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + } + + return dependenciesMap; +} + +void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT Memspec FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + QString memSpecJson = sqlQuery.value(0).toString(); + sqlQuery.finish(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + mMemspecJson = jsonDocument.object()["memspec"].toObject(); + +} + +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { + std::vector newDepList(dependencyList.size()); + + std::copy_if( + dependencyList.begin(), + dependencyList.end(), + newDepList.begin(), + [ commands ](const TimeDependency& dep) { + return dep.phaseDep == "NAW" + || ( + std::find_if( + commands.begin(), + commands.end(), + [ dep ](const QString& cmd) { + return dep.phaseDep == cmd; + } + ) != commands.end() ) + ; + } + ); + + newDepList.shrink_to_fit(); + + dependencyList = newDepList; + +} + +void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { + // TODO +} + +size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { + auto maxElement = std::max_element( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& dep1, const TimeDependency& dep2) { + return dep1.timeValue < dep2.timeValue; + } + ); + + if (maxElement == dependencyList.end()) return 0; + + return maxElement->timeValue; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h new file mode 100644 index 00000000..7234090d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -0,0 +1,44 @@ + +#pragma once + +#include +#include +#include +#include + +#include "data/tracedb.h" +#include "businessObjects/phases/phasedependency.h" + +struct TimeDependency { + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; +}; + +struct PhaseTimeDependencies { + QString phaseName; + std::vector dependencies; + size_t maxTime; +}; + +class DRAMTimeDependenciesIF { +public: + DRAMTimeDependenciesIF(const TraceDB& tdb); + virtual ~DRAMTimeDependenciesIF() = default; + + QMap getDependencies(const std::vector& commands) const; + +protected: + void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; + void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + size_t mFindVectorMaximum(const std::vector& dependencyList) const; + +protected: + QJsonObject mMemspecJson; + virtual void mInitializeValues() = 0; + virtual QMap mSpecializedGetDependencies() const = 0; + +private: + void mGetMemspec(const TraceDB& tdb); +}; From 23c66e7e5699efd705754b5f762f32e177c8afd4 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 12:43:19 +0100 Subject: [PATCH 066/121] Finished interface class for auto-generated time dependencies code. --- .../timedependenciesIF.cpp | 88 ++++++++++++++----- .../dramTimeDependencies/timedependenciesIF.h | 15 ++-- .../phasedependenciestracker.cpp | 5 +- DRAMSys/traceAnalyzer/tracefiletab.cpp | 7 +- 4 files changed, 84 insertions(+), 31 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 89cb4052..8f6c8c7f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,18 +8,26 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -QMap -DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { - QMap dependenciesMap; +std::map +DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { + std::map dependenciesMap; + + std::sort( + dependencyFilter.begin(), + dependencyFilter.end(), + [](const QString& s1, const QString& s2) { + return s1.compare(s2); + } + ); dependenciesMap = mSpecializedGetDependencies(); - mFilterDependencyMap(dependenciesMap, commands); + mFilterDependencyMap(dependenciesMap, dependencyFilter); auto it = dependenciesMap.begin(); while (it != dependenciesMap.end()) { - mFilterDependencyList(it.value().dependencies, commands); - it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + mFilterDependencyList(it->second.dependencies, dependencyFilter); + it->second.maxTime = mFindVectorMaximum(it->second.dependencies); } return dependenciesMap; @@ -39,24 +47,26 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); std::copy_if( dependencyList.begin(), dependencyList.end(), newDepList.begin(), - [ commands ](const TimeDependency& dep) { - return dep.phaseDep == "NAW" - || ( - std::find_if( - commands.begin(), - commands.end(), - [ dep ](const QString& cmd) { - return dep.phaseDep == cmd; - } - ) != commands.end() ) - ; + [ dependencyFilter ](const TimeDependency& dep) { + auto it = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dep.phaseDep, + [](const QString& cmd, const QString& value) { + return value.compare(cmd); + } + ); + + if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; + + return false; } ); @@ -66,8 +76,46 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { - // TODO +void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { + if (!dependencyMap.empty()) { + + auto itFilter = dependencyFilter.begin(); + auto itFilterLast = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dependencyMap.rbegin()->first + ); + + auto itDependencyMap = dependencyMap.begin(); + + while (true) { + + auto pair = std::mismatch( + itFilter, + itFilterLast, + itDependencyMap, + [](const QString& cmd, const std::pair& vpair) { + return cmd == vpair.first; + } + ); + + if (pair.first == dependencyFilter.end() || pair.second == dependencyMap.end()) { + dependencyMap.erase(pair.second, dependencyMap.end()); + break; + + } else if (pair.first->compare(pair.second->first) < 0) { + ++(pair.first); + + } else { + pair.second = dependencyMap.erase(pair.second); + + } + + itFilter = pair.first; + itDependencyMap = pair.second; + + } + } } size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 7234090d..2d0c657f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "data/tracedb.h" @@ -27,17 +27,20 @@ public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - QMap getDependencies(const std::vector& commands) const; + std::map getDependencies(std::vector& dependencyFilter) const; protected: - void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; - void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; - + protected: QJsonObject mMemspecJson; + +// To be implemented +protected: virtual void mInitializeValues() = 0; - virtual QMap mSpecializedGetDependencies() const = 0; + virtual std::map mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 715eed86..667a046d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -29,12 +29,13 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { + static const size_t bulkInsertionSize = 1000; + auto numberOfEntries = entries.size(); - size_t bulkInsertionSize = 1000; QString command; size_t counter = 0; - for (auto& entry : entries) { + for (const auto& entry : entries) { if (counter == 0) { // TODO Reset command string and add first command command = ""; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index ba09aa33..30fe32f2 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -313,7 +313,7 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) void TraceFileTab::on_calculateDependencies_clicked() { // TODO - anything else? Update view maybe? // TODO - For now fixed, but must be selectable - std::vector commands = { + std::vector dependencyFilter = { "ACT", "PRE", "RD", @@ -322,10 +322,11 @@ void TraceFileTab::on_calculateDependencies_clicked() { "WRA", "PDE", "PDX", - "PREA" + "PREA", + "NAW" }; - PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), commands); + PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); } From 97715374412fbbe88f433e159a9d86101adfe409 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 13:29:06 +0100 Subject: [PATCH 067/121] Added stl map QString comparator. --- .../timedependenciesIF.cpp | 22 +++++++++++-------- .../dramTimeDependencies/timedependenciesIF.h | 16 +++++++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 8f6c8c7f..692c87c4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,16 +8,14 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -std::map +DependencyMap DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { - std::map dependenciesMap; + DependencyMap dependenciesMap; std::sort( dependencyFilter.begin(), dependencyFilter.end(), - [](const QString& s1, const QString& s2) { - return s1.compare(s2); - } + QStringsComparator::compareQStrings ); dependenciesMap = mSpecializedGetDependencies(); @@ -59,9 +57,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - [](const QString& cmd, const QString& value) { - return value.compare(cmd); - } + QStringsComparator::compareQStrings ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -76,7 +72,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -131,3 +127,11 @@ size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vectortimeValue; } + +bool QStringsComparator::operator()(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} + +bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 2d0c657f..a9bbde13 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -22,16 +22,24 @@ struct PhaseTimeDependencies { size_t maxTime; }; + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2); + static bool compareQStrings(const QString& s1, const QString& s2); +}; + +typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - std::map getDependencies(std::vector& dependencyFilter) const; + DependencyMap getDependencies(std::vector& dependencyFilter) const; protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; - void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; protected: @@ -40,8 +48,10 @@ protected: // To be implemented protected: virtual void mInitializeValues() = 0; - virtual std::map mSpecializedGetDependencies() const = 0; + virtual DependencyMap mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); + }; + From fcab6a31450d955017a7393eab595dd40a6245f0 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 15:50:26 +0100 Subject: [PATCH 068/121] Started adding manual code for DDR3 time dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 7 +- .../DDR3TimeDependencies.cpp | 80 +++++++++++++++++++ .../DDR3TimeDependencies.h | 59 ++++++++++++++ ...nciesIF.cpp => dramtimedependenciesIF.cpp} | 21 +++-- ...endenciesIF.h => dramtimedependenciesIF.h} | 20 +++-- .../dramtimedependencyfactory.cpp | 17 ++++ .../dramtimedependencyfactory.h | 15 ++++ .../phasedependenciestracker.cpp | 6 +- .../phasedependenciestracker.h | 3 +- 9 files changed, 209 insertions(+), 19 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{timedependenciesIF.cpp => dramtimedependenciesIF.cpp} (85%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{timedependenciesIF.h => dramtimedependenciesIF.h} (72%) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 0216e6da..84026164 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -99,11 +99,9 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp - businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp - businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp @@ -113,6 +111,11 @@ add_executable(TraceAnalyzer businessObjects/commentmodel.cpp simulationdialog.cpp + businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp + businessObjects/phasedependenciestracker.cpp + selectmetrics.ui preferences.ui evaluationtool.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp new file mode 100644 index 00000000..e1e375cf --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -0,0 +1,80 @@ + +#include "DDR3TimeDependencies.h" + +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTimeDependenciesIF(memspec) { + mInitializeValues(); +} + +void DDR3TimeDependencies::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toLongLong(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toLongLong(); + clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toLongLong(); + + nActivateWindow = 4; + + tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toLongLong(); + tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toLongLong(); + tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toLongLong(); + tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toLongLong(); + tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toLongLong(); + tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toLongLong(); + tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toLongLong(); + tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toLongLong(); + tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toLongLong(); + tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toLongLong(); + tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toLongLong(); + tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toLongLong(); + tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toLongLong(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toLongLong(); + tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toLongLong(); + tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toLongLong(); + tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toLongLong(); + tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toLongLong(); + tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toLongLong(); + tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toLongLong(); + tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toLongLong(); + tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toLongLong(); + tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toLongLong(); + tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toLongLong(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + + tPD = tCKE; + tBURST = (int) ((burstLength / dataRate) * clk); + tRDWR = tRL + tBURST + 2 * clk - tWL; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tBURST + tWTR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tWRPRE = tWL + tBURST + tWR; + tRDPDEN = tRL + tBURST + clk; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + clk; +} + +DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("ACT"), + std::forward_as_tuple( + std::initializer_list{ + TimeDependency{tRC, "ACT", DependencyType::IntraBank, "tRC"}, + TimeDependency{tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + TimeDependency{tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + TimeDependency{tRP, "PRE", DependencyType::IntraBank, "tRP"}, + TimeDependency{tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + TimeDependency{tRP, "PREA", DependencyType::IntraRank, "tRP"}, + TimeDependency{tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + TimeDependency{tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + TimeDependency{tRFC, "REFA", DependencyType::IntraRank, "tRFC"}, + TimeDependency{tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + TimeDependency{tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + } + ) + ); + + // TODO add all the rest + + return dmap; +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h new file mode 100644 index 00000000..793b50f1 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -0,0 +1,59 @@ + +#pragma once + +#include "dramtimedependenciesIF.h" + +class DDR3TimeDependencies : public DRAMTimeDependenciesIF { +public: + DDR3TimeDependencies(const QJsonObject& memspec); + +protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + +protected: + size_t burstLength; + size_t dataRate; + size_t clk; + + size_t nActivateWindow; + + size_t tRP; + size_t tRAS; + size_t tRC; + size_t tRTP; + size_t tRRD; + size_t tCCD; + size_t tRCD; + size_t tNAW; + size_t tRL; + size_t tWL; + size_t tWR; + size_t tWTR; + size_t tCKESR; + size_t tCKE; + size_t tXP; + size_t tXPDLL; + size_t tXS; + size_t tXSDLL; + size_t tAL; + size_t tRFC; + size_t tREFI; + size_t tRTRS; + + size_t tACTPDEN; + size_t tPRPDEN; + size_t tREFPDEN; + + size_t tPD; + size_t tBURST; + size_t tRDWR; + size_t tRDWR_R; + size_t tWRRD; + size_t tWRRD_R; + size_t tWRPRE; + size_t tRDPDEN; + size_t tWRPDEN; + size_t tWRAPDEN; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp similarity index 85% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 692c87c4..c740a801 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -1,10 +1,10 @@ -#include "timedependenciesIF.h" +#include "dramtimedependenciesIF.h" #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { - mGetMemspec(tdb); +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec) { + mMemspecJson = memspec; } @@ -31,7 +31,7 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); @@ -41,13 +41,16 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { sqlQuery.finish(); QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); - mMemspecJson = jsonDocument.object()["memspec"].toObject(); + return jsonDocument.object()["memspec"].toObject(); } void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); + // TODO - probably there is a smarter way to filter these values, + // although the lists are not to be greater than 20-50 elements + std::copy_if( dependencyList.begin(), dependencyList.end(), @@ -70,6 +73,14 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList = newDepList; + std::sort( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& v1, const TimeDependency& v2) { + return v1.timeValue < v2.timeValue; + } + ); + } void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h similarity index 72% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index a9bbde13..7071ef84 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -4,6 +4,10 @@ #include #include #include + +#include +#include +#include #include #include "data/tracedb.h" @@ -17,7 +21,8 @@ struct TimeDependency { }; struct PhaseTimeDependencies { - QString phaseName; + explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} + std::vector dependencies; size_t maxTime; }; @@ -32,11 +37,13 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const TraceDB& tdb); + DRAMTimeDependenciesIF(const QJsonObject& memspec); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; + static const QJsonObject getMemspec(const TraceDB& tdb); + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; @@ -45,13 +52,10 @@ protected: protected: QJsonObject mMemspecJson; -// To be implemented +// To be implemented by the specializing class protected: - virtual void mInitializeValues() = 0; - virtual DependencyMap mSpecializedGetDependencies() const = 0; - -private: - void mGetMemspec(const TraceDB& tdb); + virtual void mInitializeValues() {} ; + virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp new file mode 100644 index 00000000..f9c72c91 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -0,0 +1,17 @@ + +#include "dramtimedependencyfactory.h" + +DRAMTimeDependenciesIF DRAMTimeDependencyFactory::make(const TraceDB& tdb) { + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); + QString deviceType = memspec["memspec"]["memoryType"].toString(); + + if (deviceType == "DDR3") { + return DDR3TimeDependencies(memspec); + + } else { + // TODO maybe throw? + return DRAMTimeDependenciesIF(memspec); + + } + +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h new file mode 100644 index 00000000..d6232ffe --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -0,0 +1,15 @@ + +#pragma once + +#include "dramtimedependenciesIF.h" +#include "DDR3TimeDependencies.h" +#include "data/tracedb.h" + +class DRAMTimeDependencyFactory { +public: + static DRAMTimeDependenciesIF make(const TraceDB& tdb); + +private: + DRAMTimeDependencyFactory() = delete; + ~DRAMTimeDependencyFactory() = delete; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 667a046d..984a8886 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -8,7 +8,7 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector< auto& phases = mGetAllPhases(tdb, commands); - auto& entries = mCalculateDependencies(phases); + auto& entries = mCalculateDependencies(tdb, phases); mInsertIntoTable(tdb, entries); @@ -117,10 +117,10 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const std::vector>& transactions) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& transactions) { std::vector entries; - // TODO Get dependency object for specific trace + DRAMTimeDependenciesIF deviceDependencies = DRAMTimeDependencyFactory::make(tdb); // TODO Main dependency calculation loop return entries; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index fcfe7021..a46d6c05 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -6,6 +6,7 @@ #include #include "data/tracedb.h" +#include "dramTimeDependencies/dramtimedependencyfactory.h" struct DBPhaseEntry { size_t id; @@ -36,7 +37,7 @@ private: static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const std::vector>& phases); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); From b75a795779a6a5254f5e80b870884b613998e7f0 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 11:07:21 +0100 Subject: [PATCH 069/121] Added DDR3 time dependencies code manually. --- .../DDR3TimeDependencies.cpp | 210 ++++++++++++++++-- 1 file changed, 197 insertions(+), 13 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index e1e375cf..237939d3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -59,22 +59,206 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { std::forward_as_tuple("ACT"), std::forward_as_tuple( std::initializer_list{ - TimeDependency{tRC, "ACT", DependencyType::IntraBank, "tRC"}, - TimeDependency{tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, - TimeDependency{tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, - TimeDependency{tRP, "PRE", DependencyType::IntraBank, "tRP"}, - TimeDependency{tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, - TimeDependency{tRP, "PREA", DependencyType::IntraRank, "tRP"}, - TimeDependency{tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - TimeDependency{tXP, "PDXP", DependencyType::IntraRank, "tXP"}, - TimeDependency{tRFC, "REFA", DependencyType::IntraRank, "tRFC"}, - TimeDependency{tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - TimeDependency{tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tNAW, "NAW", DependencyType::IntraRank, "tNAW"} } ) ); - // TODO add all the rest + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("RD"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("RDA"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tWRPRE - tRTP, "WR", DependencyType::IntraBank, "tWRPRE - tRTP"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("WR"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PREPB"), + std::forward_as_tuple( + std::initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PREAB"), + std::forward_as_tuple( + std::initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("REFAB"), + std::forward_as_tuple( + std::initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("REFAB"), + std::forward_as_tuple( + std::initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDXA"), + std::forward_as_tuple( + std::initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDEP"), + std::forward_as_tuple( + std::initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("PDXP"), + std::forward_as_tuple( + std::initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("SREFEN"), + std::forward_as_tuple( + std::initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {std::max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {std::max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + } + ) + ); + + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("SREFEX"), + std::forward_as_tuple( + std::initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} + } + ) + ); return dmap; -} \ No newline at end of file +} From 1f789322677b79537c70a8ba71c5d0a56b7f4139 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 15:14:39 +0100 Subject: [PATCH 070/121] Added main calculation loop and other modifications and corrections. Still missing table data storing and test. --- .../DDR3TimeDependencies.cpp | 83 ++++++++----- .../DDR3TimeDependencies.h | 79 ++++++------- .../dramtimedependenciesIF.cpp | 14 ++- .../dramtimedependenciesIF.h | 9 +- .../dramtimedependencyfactory.cpp | 8 +- .../dramtimedependencyfactory.h | 4 +- .../phasedependenciestracker.cpp | 109 ++++++++++++++++-- .../phasedependenciestracker.h | 6 +- .../phases/phasedependency.cpp | 20 +++- .../businessObjects/phases/phasedependency.h | 2 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 7 +- 11 files changed, 244 insertions(+), 97 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 237939d3..5b494732 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -6,41 +6,41 @@ DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTim } void DDR3TimeDependencies::mInitializeValues() { - burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toLongLong(); - dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toLongLong(); - clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toLongLong(); + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toInt(); + clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toInt(); nActivateWindow = 4; - tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toLongLong(); - tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toLongLong(); - tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toLongLong(); - tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toLongLong(); - tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toLongLong(); - tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toLongLong(); - tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toLongLong(); - tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toLongLong(); - tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toLongLong(); - tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toLongLong(); - tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toLongLong(); - tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toLongLong(); - tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toLongLong(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); - tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toLongLong(); - tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toLongLong(); - tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toLongLong(); - tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toLongLong(); - tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toLongLong(); - tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toLongLong(); - tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toLongLong(); - tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toLongLong(); - tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toLongLong(); - tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toLongLong(); - tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toLongLong(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toLongLong(); + tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toInt(); + tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toInt(); + tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toInt(); + tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toInt(); + tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toInt(); + tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toInt(); + tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toInt(); + tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toInt(); + tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toInt(); + tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toInt(); + tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toInt(); + tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toInt(); + tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toInt(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); + tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toInt(); + tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toInt(); + tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toInt(); + tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toInt(); + tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toInt(); + tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toInt(); + tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toInt(); + tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toInt(); + tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toInt(); + tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toInt(); + tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toInt(); + tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); tPD = tCKE; - tBURST = (int) ((burstLength / dataRate) * clk); + tBURST = (uint) ((burstLength / (float) dataRate) * clk); tRDWR = tRL + tBURST + 2 * clk - tWL; tRDWR_R = tRL + tBURST + tRTRS - tWL; tWRRD = tWL + tBURST + tWTR; @@ -49,6 +49,7 @@ void DDR3TimeDependencies::mInitializeValues() { tRDPDEN = tRL + tBURST + clk; tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + clk; + } DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { @@ -135,6 +136,26 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ) ); + dmap.emplace( + std::piecewise_construct, + std::forward_as_tuple("WRA"), + std::forward_as_tuple( + std::initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + } + ) + ); + dmap.emplace( std::piecewise_construct, std::forward_as_tuple("PREPB"), @@ -182,7 +203,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { dmap.emplace( std::piecewise_construct, - std::forward_as_tuple("REFAB"), + std::forward_as_tuple("PDEA"), std::forward_as_tuple( std::initializer_list{ {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 793b50f1..53568c34 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -10,50 +10,47 @@ public: protected: void mInitializeValues() override; DependencyMap mSpecializedGetDependencies() const override; - + protected: - size_t burstLength; - size_t dataRate; - size_t clk; + uint burstLength; + uint dataRate; - size_t nActivateWindow; + uint tRP; + uint tRAS; + uint tRC; + uint tRTP; + uint tRRD; + uint tCCD; + uint tRCD; + uint tNAW; + uint tRL; + uint tWL; + uint tWR; + uint tWTR; + uint tCKESR; + uint tCKE; + uint tXP; + uint tXPDLL; + uint tXS; + uint tXSDLL; + uint tAL; + uint tRFC; + uint tREFI; + uint tRTRS; - size_t tRP; - size_t tRAS; - size_t tRC; - size_t tRTP; - size_t tRRD; - size_t tCCD; - size_t tRCD; - size_t tNAW; - size_t tRL; - size_t tWL; - size_t tWR; - size_t tWTR; - size_t tCKESR; - size_t tCKE; - size_t tXP; - size_t tXPDLL; - size_t tXS; - size_t tXSDLL; - size_t tAL; - size_t tRFC; - size_t tREFI; - size_t tRTRS; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; - size_t tACTPDEN; - size_t tPRPDEN; - size_t tREFPDEN; - - size_t tPD; - size_t tBURST; - size_t tRDWR; - size_t tRDWR_R; - size_t tWRRD; - size_t tWRRD_R; - size_t tWRPRE; - size_t tRDPDEN; - size_t tWRPDEN; - size_t tWRAPDEN; + uint tPD; + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRRD_R; + uint tWRPRE; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index c740a801..0960d646 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -26,8 +26,11 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) while (it != dependenciesMap.end()) { mFilterDependencyList(it->second.dependencies, dependencyFilter); it->second.maxTime = mFindVectorMaximum(it->second.dependencies); + + ++it; } + return dependenciesMap; } @@ -60,7 +63,9 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - QStringsComparator::compareQStrings + [](const QString& cmd, const QString& depName){ + return cmd == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + } ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -102,7 +107,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, itFilterLast, itDependencyMap, [](const QString& cmd, const std::pair& vpair) { - return cmd == vpair.first; + return cmd.compare(vpair.first) == 0; } ); @@ -113,6 +118,8 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } else if (pair.first->compare(pair.second->first) < 0) { ++(pair.first); + } else if (pair.first->compare(pair.second->first) == 0) { + ++(pair.second); } else { pair.second = dependencyMap.erase(pair.second); @@ -123,9 +130,10 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } } + } -size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { +uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { auto maxElement = std::max_element( dependencyList.begin(), dependencyList.end(), diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index 7071ef84..cc818162 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -35,6 +35,7 @@ struct QStringsComparator { typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const QJsonObject& memspec); @@ -44,10 +45,13 @@ public: static const QJsonObject getMemspec(const TraceDB& tdb); + const uint getClk() const { return clk; } + const uint getNAW() const { return nActivateWindow; }; + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; - size_t mFindVectorMaximum(const std::vector& dependencyList) const; + uint mFindVectorMaximum(const std::vector& dependencyList) const; protected: QJsonObject mMemspecJson; @@ -56,6 +60,9 @@ protected: protected: virtual void mInitializeValues() {} ; virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; + + uint clk = 0; + uint nActivateWindow = 0; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index f9c72c91..65f41cc7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -1,16 +1,16 @@ #include "dramtimedependencyfactory.h" -DRAMTimeDependenciesIF DRAMTimeDependencyFactory::make(const TraceDB& tdb) { +std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); - QString deviceType = memspec["memspec"]["memoryType"].toString(); + QString deviceType = memspec["memoryType"].toString(); if (deviceType == "DDR3") { - return DDR3TimeDependencies(memspec); + return std::make_shared(memspec); } else { // TODO maybe throw? - return DRAMTimeDependenciesIF(memspec); + throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index d6232ffe..748c5ab1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -1,13 +1,15 @@ #pragma once +#include + #include "dramtimedependenciesIF.h" #include "DDR3TimeDependencies.h" #include "data/tracedb.h" class DRAMTimeDependencyFactory { public: - static DRAMTimeDependenciesIF make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); private: DRAMTimeDependencyFactory() = delete; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 984a8886..7a18e978 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -2,13 +2,13 @@ #include "phasedependenciestracker.h" void -PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { mDropTable(tdb); mCreateTable(tdb); auto& phases = mGetAllPhases(tdb, commands); - auto& entries = mCalculateDependencies(tdb, phases); + auto& entries = mCalculateDependencies(tdb, phases, commands); mInsertIntoTable(tdb, entries); @@ -61,7 +61,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " @@ -70,8 +70,8 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& transactions) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; - DRAMTimeDependenciesIF deviceDependencies = DRAMTimeDependencyFactory::make(tdb); - // TODO Main dependency calculation loop + // Get dependencies for tdb device + auto device = DRAMTimeDependencyFactory::make(tdb); + DependencyMap deviceDependencies = device->getDependencies(commands); + + // Tries to find all timing dependencies for each phase on the trace + std::vector tmpPotentialNAW; + tmpPotentialNAW.reserve(16); + for (size_t i = 1; i < phases.size(); i++) { + // NAW dependencies variables reset + tmpPotentialNAW.clear(); + size_t nawCount = 0; + + // Auxiliary variables + const auto& phase = phases[i]; + const size_t cmdBank = phase->tBank; + const size_t cmdRank = phase->tRank; + + // Get time dependency descriptions for the current phase + const auto& deps = deviceDependencies.at(phase->phaseName); + + // Loop all previous phases until there cannot be any more time dependencies + for (int j = i-1; j >= 0; j--) { + // Get next phase to analyse + const auto& otherPhase = phases[j]; + // Calculates the time difference in nanoseconds + const auto timeDiff = phase->phaseBegin - otherPhase->phaseBegin; + + // Time difference begin greater than the maximum possible dependency time ends the internal loop + if (timeDiff > deps.maxTime) break; + + // For each possible dependency for the current phase, + // checks if otherPhase would match as a dependency + for (const auto& dep : deps.dependencies) { + if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; + + if ( + dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank + || dep.depType == DependencyType::IntraRank && cmdBank != otherPhase->tRank + || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? + ) { + continue; + } + + if (dep.phaseDep == "NAW") { + if (otherPhase->phaseName == "ACT") { + if (timeDiff == dep.timeValue) { + // Captures only the first (or exactly matching time) ACT in + // the ACT window as a dependency + tmpPotentialNAW.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName + }); + } + nawCount++; + + } + + continue; // TODO should this continue here or should it be removed for potentially more time dependencies to be captured? + } + + if (timeDiff == dep.timeValue) { + entries.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName + }); + } + + } + + if (timeDiff == device->getClk()) { + entries.emplace_back(DBDependencyEntry{ + phase->id, + phase->phaseName, + PhaseDependency::dependencyTypeName(DependencyType::IntraRank), + "CommandBus", + otherPhase->id, + otherPhase->phaseName + }); + } + + } + + if (nawCount >= device->getNAW()) { + entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); + } + + } return entries; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index a46d6c05..a01c537a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -29,15 +29,15 @@ struct DBDependencyEntry { class PhaseDependenciesTracker { public: - static void calculateDependencies(TraceDB& tdb, const std::vector& commands); + static void calculateDependencies(TraceDB& tdb, std::vector& dependencyFilter); private: static void mDropTable(TraceDB& tdb); static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases); + static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index e76d0f8e..de6c65ff 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -129,4 +129,22 @@ void PhaseDependency::mDraw(QPoint &end, double depY, const TraceDrawingProperti drawText(painter, mTimeDependency, textPosition, alignment); } -} \ No newline at end of file +} + +QString PhaseDependency::dependencyTypeName(DependencyType dtype) { + switch(dtype) { + case IntraBank: + return "IntraBank"; + + case IntraRank: + return "IntraRank"; + + case InterRank: + return "InterRank"; + + default: + // TODO - maybe throw? + return ""; + + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index fa203556..439f973c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -68,6 +68,8 @@ public: bool draw(QPoint &end, const TraceDrawingProperties &drawingProperties, QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap); + static QString dependencyTypeName(DependencyType); + protected: DependencyType mType; QString mTimeDependency; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 30fe32f2..c5e9df52 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -313,17 +313,16 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) void TraceFileTab::on_calculateDependencies_clicked() { // TODO - anything else? Update view maybe? // TODO - For now fixed, but must be selectable - std::vector dependencyFilter = { + std::vector dependencyFilter = { "ACT", - "PRE", + "PREPB", "RD", "RDA", "WR", "WRA", "PDE", "PDX", - "PREA", - "NAW" + "PREAB" }; PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); From 6f7c232f450a0f6dc678790484cd937e0792ff8e Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 13:31:15 +0100 Subject: [PATCH 071/121] Added dependency calculations. Still missing tests and interface. --- .../DDR3TimeDependencies.cpp | 60 ++++++++------- .../DDR3TimeDependencies.h | 2 +- .../dramtimedependenciesIF.cpp | 11 ++- .../dramtimedependenciesIF.h | 4 +- .../dramtimedependencyfactory.cpp | 5 +- .../phasedependenciestracker.cpp | 73 ++++++++++++++++--- .../phasedependenciestracker.h | 9 +++ DRAMSys/traceAnalyzer/tracefiletab.cpp | 2 +- 8 files changed, 114 insertions(+), 52 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 5b494732..1b59a3eb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -1,43 +1,41 @@ #include "DDR3TimeDependencies.h" -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec) : DRAMTimeDependenciesIF(memspec) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint clk) : DRAMTimeDependenciesIF(memspec, clk) { mInitializeValues(); } void DDR3TimeDependencies::mInitializeValues() { - burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toString().toInt(); - dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toString().toInt(); - clk = mMemspecJson["memarchitecturespec"].toArray()[0].toString().toInt(); + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; - - tRP = mMemspecJson["memtimingspec"].toObject()["RP"].toString().toInt(); - tRAS = mMemspecJson["memtimingspec"].toObject()["RAS"].toString().toInt(); - tRC = mMemspecJson["memtimingspec"].toObject()["RC"].toString().toInt(); - tRTP = mMemspecJson["memtimingspec"].toObject()["RTP"].toString().toInt(); - tRRD = mMemspecJson["memtimingspec"].toObject()["RRD"].toString().toInt(); - tCCD = mMemspecJson["memtimingspec"].toObject()["CCD"].toString().toInt(); - tRCD = mMemspecJson["memtimingspec"].toObject()["RCD"].toString().toInt(); - tNAW = mMemspecJson["memtimingspec"].toObject()["NAW"].toString().toInt(); - tRL = mMemspecJson["memtimingspec"].toObject()["RL"].toString().toInt(); - tWL = mMemspecJson["memtimingspec"].toObject()["WL"].toString().toInt(); - tWR = mMemspecJson["memtimingspec"].toObject()["WR"].toString().toInt(); - tWTR = mMemspecJson["memtimingspec"].toObject()["WTR"].toString().toInt(); - tCKESR = mMemspecJson["memtimingspec"].toObject()["CKESR"].toString().toInt(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); - tXP = mMemspecJson["memtimingspec"].toObject()["XP"].toString().toInt(); - tXPDLL = mMemspecJson["memtimingspec"].toObject()["XPDLL"].toString().toInt(); - tXS = mMemspecJson["memtimingspec"].toObject()["XS"].toString().toInt(); - tXSDLL = mMemspecJson["memtimingspec"].toObject()["XSDLL"].toString().toInt(); - tAL = mMemspecJson["memtimingspec"].toObject()["AL"].toString().toInt(); - tRFC = mMemspecJson["memtimingspec"].toObject()["RFC"].toString().toInt(); - tREFI = mMemspecJson["memtimingspec"].toObject()["REFI"].toString().toInt(); - tRTRS = mMemspecJson["memtimingspec"].toObject()["RTRS"].toString().toInt(); - tACTPDEN = mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toString().toInt(); - tPRPDEN = mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toString().toInt(); - tREFPDEN = mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toString().toInt(); - tCKE = mMemspecJson["memtimingspec"].toObject()["CKE"].toString().toInt(); + tRP = clk * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = clk * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = clk * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRTP = clk * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRD = clk * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tCCD = clk * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = clk * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tNAW = clk * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRL = clk * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = clk * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = clk * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = clk * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tCKESR = clk * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = clk * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXPDLL = clk * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); + tXS = clk * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = clk * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tAL = clk * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRFC = clk * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tREFI = clk * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tRTRS = clk * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + tACTPDEN = clk * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = clk * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = clk * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); tPD = tCKE; tBURST = (uint) ((burstLength / (float) dataRate) * clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 53568c34..7c8a30f4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -5,7 +5,7 @@ class DDR3TimeDependencies : public DRAMTimeDependenciesIF { public: - DDR3TimeDependencies(const QJsonObject& memspec); + DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); protected: void mInitializeValues() override; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 0960d646..40f43b6a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -3,8 +3,9 @@ #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec) { +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inClk) { mMemspecJson = memspec; + clk = inClk; } @@ -34,16 +35,18 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& clk) { QSqlDatabase db = tdb.getDatabase(); - QString query = "SELECT Memspec FROM GeneralInfo"; + QString query = "SELECT clk, Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); sqlQuery.next(); - QString memSpecJson = sqlQuery.value(0).toString(); + clk = sqlQuery.value(0).toInt(); + QString memSpecJson = sqlQuery.value(1).toString(); sqlQuery.finish(); QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + return jsonDocument.object()["memspec"].toObject(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index cc818162..bd495583 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -38,12 +38,12 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec); + DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint clk); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb); + static const QJsonObject getMemspec(const TraceDB& tdb, uint& clk); const uint getClk() const { return clk; } const uint getNAW() const { return nActivateWindow; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index 65f41cc7..1586406f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -2,11 +2,12 @@ #include "dramtimedependencyfactory.h" std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb); + uint clk = 0; + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); QString deviceType = memspec["memoryType"].toString(); if (deviceType == "DDR3") { - return std::make_shared(memspec); + return std::make_shared(memspec, clk); } else { // TODO maybe throw? diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 7a18e978..2f0a8e45 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -3,15 +3,22 @@ void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { + mBeginTransaction(tdb); + mDropTable(tdb); mCreateTable(tdb); auto& phases = mGetAllPhases(tdb, commands); + if (phases.size() == 0) { + mRollbackChanges(tdb); + } + auto& entries = mCalculateDependencies(tdb, phases, commands); mInsertIntoTable(tdb, entries); + mCommitTransaction(tdb); } void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { @@ -29,7 +36,7 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { - static const size_t bulkInsertionSize = 1000; + static const size_t bulkInsertionSize = 200; auto numberOfEntries = entries.size(); @@ -37,25 +44,33 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< size_t counter = 0; for (const auto& entry : entries) { if (counter == 0) { - // TODO Reset command string and add first command - command = ""; + // Reset command string and add first entry + command = "INSERT INTO 'DirectDependencies' ('DelayedPhaseID', 'DelayedPhaseName', 'DependencyType', 'TimeDependency', 'DependencyPhaseID', 'DependencyPhaseName') "; + mAddFirstEntryCommandString(command, entry); + + counter++; - } else if (counter == bulkInsertionSize) { - // TODO Write last command and submit + } else if (counter == bulkInsertionSize-1) { + // Write last entry and submit + mAddEntryCommandString(command, entry); + + mExecuteQuery(tdb, command); counter = 0; } else { - // TODO + // Write entry + mAddEntryCommandString(command, entry); counter++; + } } if (counter != 0) { - // TODO Submit command string + mExecuteQuery(tdb, command); } } @@ -74,7 +89,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector queryStr = queryStr + '\"' + cmd + "\","; } queryStr.back() = ')'; - queryStr += " ORDER BY PhaseBegin "; + queryStr += " ORDER BY PhaseBegin; "; auto query = mExecuteQuery(tdb, queryStr); @@ -119,6 +134,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector const std::vector PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; + entries.reserve((size_t) (0.4 * phases.size())); // Get dependencies for tdb device auto device = DRAMTimeDependencyFactory::make(tdb); @@ -146,7 +162,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: const auto& otherPhase = phases[j]; // Calculates the time difference in nanoseconds const auto timeDiff = phase->phaseBegin - otherPhase->phaseBegin; - // Time difference begin greater than the maximum possible dependency time ends the internal loop if (timeDiff > deps.maxTime) break; @@ -157,12 +172,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: if ( dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank - || dep.depType == DependencyType::IntraRank && cmdBank != otherPhase->tRank + || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? ) { continue; } - if (dep.phaseDep == "NAW") { if (otherPhase->phaseName == "ACT") { if (timeDiff == dep.timeValue) { @@ -226,3 +240,40 @@ QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString qu return query; } + +void PhaseDependenciesTracker::mBeginTransaction(TraceDB& tdb) { + const QString queryStr = "BEGIN TRANSACTION;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mRollbackChanges(TraceDB& tdb) { + const QString queryStr = "ROLLBACK;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mCommitTransaction(TraceDB& tdb) { + const QString queryStr = "COMMIT;"; + mExecuteQuery(tdb, queryStr); + +} + +void PhaseDependenciesTracker::mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry) { + command = command + " SELECT '" + QString::number(entry.delayedPhaseID) + "' AS 'DelayedPhaseID', '" + + entry.delayedPhaseName + "' AS 'DelayedPhaseName', '" + + entry.dependencyType + "' AS 'DependencyType', '" + + entry.timeDependency + "' AS 'TimeDependency', '" + + QString::number(entry.dependencyPhaseID) + "' AS 'DependencyPhaseID', '" + + entry.dependencyPhaseName + "' AS 'DependencyPhaseName' "; + +} + +void PhaseDependenciesTracker::mAddEntryCommandString(QString& command, const DBDependencyEntry& entry) { + command = command + " UNION ALL SELECT '" + QString::number(entry.delayedPhaseID) + "', '" + + entry.delayedPhaseName + "', '" + + entry.dependencyType + "', '" + + entry.timeDependency + "', '" + + QString::number(entry.dependencyPhaseID) + "', '" + + entry.dependencyPhaseName + "' "; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index a01c537a..17d5ecda 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -43,4 +43,13 @@ private: PhaseDependenciesTracker() = delete; ~PhaseDependenciesTracker() = delete; + +private: + static void mBeginTransaction(TraceDB& tdb); + static void mRollbackChanges(TraceDB& tdb); + static void mCommitTransaction(TraceDB& tdb); + + static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); + static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); + }; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index c5e9df52..c922b299 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -315,7 +315,7 @@ void TraceFileTab::on_calculateDependencies_clicked() { // TODO - For now fixed, but must be selectable std::vector dependencyFilter = { "ACT", - "PREPB", + "PREPB", "RD", "RDA", "WR", From 03b4c6e976a5143d7443e681ad93571cc50b8eda Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:30:45 +0100 Subject: [PATCH 072/121] Added interface for dependency calculation. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../businessObjects/configmodels.cpp | 139 ----------------- .../businessObjects/configmodels.h | 56 ------- .../businessObjects/dependencymodels.cpp | 141 ++++++++++++++++++ .../businessObjects/dependencymodels.h | 65 ++++++++ .../DDR3TimeDependencies.cpp | 18 +++ .../DDR3TimeDependencies.h | 2 + .../dramtimedependencyfactory.cpp | 29 ++++ .../dramtimedependencyfactory.h | 4 + .../phasedependenciestracker.cpp | 50 ++++--- DRAMSys/traceAnalyzer/data/QueryTexts.h | 10 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 9 +- .../traceAnalyzer/presentation/traceplot.cpp | 3 + DRAMSys/traceAnalyzer/tracefiletab.cpp | 36 +++-- DRAMSys/traceAnalyzer/tracefiletab.h | 3 + DRAMSys/traceAnalyzer/tracefiletab.ui | 16 +- 16 files changed, 343 insertions(+), 239 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 84026164..df7b80f2 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -110,6 +110,7 @@ add_executable(TraceAnalyzer businessObjects/configmodels.cpp businessObjects/commentmodel.cpp simulationdialog.cpp + businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp index 149ccf8d..439f85f1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp @@ -283,142 +283,3 @@ QModelIndex MemSpecModel::parent(const QModelIndex &index) const return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); } - -DependencyInfosModel::DependencyInfosModel(TraceDB &traceFile, QObject *parent) : QAbstractItemModel(parent) -{ - mDepInfosDepType = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyType); - mDepInfosTimeDep = traceFile.getDependencyInfos(DependencyInfos::Type::TimeDependency); - mDepInfosDelPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DelayedPhase); - mDepInfosDepPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyPhase); - - if (traceFile.checkDependencyTableExists()) - { - parseInfos(); - } -} - -int DependencyInfosModel::Node::getRow() const -{ - if (!parent) - return 0; - - const auto &siblings = parent->children; - const auto siblingsIt = std::find_if(siblings.begin(), siblings.end(), - [this](const std::unique_ptr &node) { return node.get() == this; }); - - Q_ASSERT(siblingsIt != siblings.end()); - - return std::distance(siblings.begin(), siblingsIt); -} - -void DependencyInfosModel::parseInfos() -{ - - std::vector> infos = {{"Dependency Granularity", mDepInfosDepType}, - {"Time Dependencies", mDepInfosTimeDep}, - {"Delayed Phases", mDepInfosDelPhase}, - {"Dependency Phases", mDepInfosDepPhase}}; - - for (auto pair : infos) - { - std::unique_ptr node = std::unique_ptr(new Node({pair.first, ""}, rootNode.get())); - - for (auto v : pair.second.getInfos()) - { - QString value = QString::number(v.value) + " %"; - node->children.push_back(std::move(std::unique_ptr(new Node({v.id, value}, node.get())))); - } - - rootNode->children.push_back(std::move(node)); - } -} - -int DependencyInfosModel::rowCount(const QModelIndex &parent) const -{ - if (parent.column() > 0) - return 0; - - const Node *parentNode; - - if (!parent.isValid()) - parentNode = rootNode.get(); - else - parentNode = static_cast(parent.internalPointer()); - - return parentNode->childCount(); -} - -int DependencyInfosModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent) - - return 2; -} - -QVariant DependencyInfosModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) - return QVariant(); - - if (role != Qt::DisplayRole && role != Qt::ToolTipRole) - return QVariant(); - - auto *node = static_cast(index.internalPointer()); - - if (index.column() == 0) - return QVariant(node->data.first); - else - return QVariant(node->data.second); -} - -QVariant DependencyInfosModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if (role != Qt::DisplayRole) - return QVariant(); - - if (orientation == Qt::Horizontal) - { - switch (section) - { - case 0: - return "Field"; - case 1: - return "Percentage"; - default: - break; - } - } - - return QVariant(); -} - -QModelIndex DependencyInfosModel::index(int row, int column, const QModelIndex &parent) const -{ - if (!hasIndex(row, column, parent)) - return QModelIndex(); - - const Node *parentNode; - - if (!parent.isValid()) - parentNode = rootNode.get(); - else - parentNode = static_cast(parent.internalPointer()); - - const Node *node = parentNode->children[row].get(); - - return createIndex(row, column, const_cast(node)); -} - -QModelIndex DependencyInfosModel::parent(const QModelIndex &index) const -{ - if (!index.isValid()) - return QModelIndex(); - - const Node *childNode = static_cast(index.internalPointer()); - const Node *parentNode = childNode->parent; - - if (!parentNode) - return QModelIndex(); - - return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h index 7408db5c..9b5731db 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h @@ -31,7 +31,6 @@ * * Authors: * Derek Christ - * Iron Prando da Silva */ #ifndef CONFIGMODELS_H @@ -124,59 +123,4 @@ private: std::unique_ptr rootNode = std::unique_ptr(new Node); }; -class DependencyInfosModel : public QAbstractItemModel -{ - Q_OBJECT -public: - explicit DependencyInfosModel(TraceDB &traceFile, QObject *parent = nullptr); - ~DependencyInfosModel() - { - } - -protected: - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - - QModelIndex index(int row, int column, const QModelIndex &parent) const override; - QModelIndex parent(const QModelIndex &index) const override; - -private: - DependencyInfos mDepInfosDepType; - DependencyInfos mDepInfosTimeDep; - DependencyInfos mDepInfosDelPhase; - DependencyInfos mDepInfosDepPhase; - - void parseInfos(); - struct Node - { - using NodeData = std::pair; - - Node() - { - } - Node(NodeData data, const Node *parent) : data(data), parent(parent) - { - } - - /** - * Gets the row relative to its parent. - */ - int getRow() const; - int childCount() const - { - return children.size(); - } - - NodeData data; - - const Node *parent = nullptr; - std::vector> children; - }; - - std::unique_ptr rootNode = std::unique_ptr(new Node); -}; - #endif // CONFIGMODELS_H diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp new file mode 100644 index 00000000..cbc39b65 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp @@ -0,0 +1,141 @@ + +#include "dependencymodels.h" + +DependencyInfosModel::DependencyInfosModel(TraceDB &traceFile, QObject *parent) : QAbstractItemModel(parent) +{ + mDepInfosDepType = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyType); + mDepInfosTimeDep = traceFile.getDependencyInfos(DependencyInfos::Type::TimeDependency); + mDepInfosDelPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DelayedPhase); + mDepInfosDepPhase = traceFile.getDependencyInfos(DependencyInfos::Type::DependencyPhase); + + if (traceFile.checkDependencyTableExists()) + { + parseInfos(); + } +} + +int DependencyInfosModel::Node::getRow() const +{ + if (!parent) + return 0; + + const auto &siblings = parent->children; + const auto siblingsIt = std::find_if(siblings.begin(), siblings.end(), + [this](const std::unique_ptr &node) { return node.get() == this; }); + + Q_ASSERT(siblingsIt != siblings.end()); + + return std::distance(siblings.begin(), siblingsIt); +} + +void DependencyInfosModel::parseInfos() +{ + + std::vector> infos = {{"Dependency Granularity", mDepInfosDepType}, + {"Time Dependencies", mDepInfosTimeDep}, + {"Delayed Phases", mDepInfosDelPhase}, + {"Dependency Phases", mDepInfosDepPhase}}; + + for (auto pair : infos) + { + std::unique_ptr node = std::unique_ptr(new Node({pair.first, ""}, rootNode.get())); + + for (auto v : pair.second.getInfos()) + { + QString value = QString::number(v.value) + " %"; + node->children.push_back(std::move(std::unique_ptr(new Node({v.id, value}, node.get())))); + } + + rootNode->children.push_back(std::move(node)); + } +} + +int DependencyInfosModel::rowCount(const QModelIndex &parent) const +{ + if (parent.column() > 0) + return 0; + + const Node *parentNode; + + if (!parent.isValid()) + parentNode = rootNode.get(); + else + parentNode = static_cast(parent.internalPointer()); + + return parentNode->childCount(); +} + +int DependencyInfosModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + + return 2; +} + +QVariant DependencyInfosModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + if (role != Qt::DisplayRole && role != Qt::ToolTipRole) + return QVariant(); + + auto *node = static_cast(index.internalPointer()); + + if (index.column() == 0) + return QVariant(node->data.first); + else + return QVariant(node->data.second); +} + +QVariant DependencyInfosModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (orientation == Qt::Horizontal) + { + switch (section) + { + case 0: + return "Field"; + case 1: + return "Percentage"; + default: + break; + } + } + + return QVariant(); +} + +QModelIndex DependencyInfosModel::index(int row, int column, const QModelIndex &parent) const +{ + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + const Node *parentNode; + + if (!parent.isValid()) + parentNode = rootNode.get(); + else + parentNode = static_cast(parent.internalPointer()); + + const Node *node = parentNode->children[row].get(); + + return createIndex(row, column, const_cast(node)); +} + +QModelIndex DependencyInfosModel::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + const Node *childNode = static_cast(index.internalPointer()); + const Node *parentNode = childNode->parent; + + if (!parentNode) + return QModelIndex(); + + return createIndex(parentNode->getRow(), 0, const_cast(parentNode)); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h new file mode 100644 index 00000000..02736e13 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h @@ -0,0 +1,65 @@ + +#pragma once + +#include "../data/tracedb.h" +#include "phases/dependencyinfos.h" + +#include +#include +#include +#include + +class DependencyInfosModel : public QAbstractItemModel +{ + Q_OBJECT +public: + explicit DependencyInfosModel(TraceDB &traceFile, QObject *parent = nullptr); + ~DependencyInfosModel() + { + } + +protected: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + QModelIndex index(int row, int column, const QModelIndex &parent) const override; + QModelIndex parent(const QModelIndex &index) const override; + +private: + DependencyInfos mDepInfosDepType; + DependencyInfos mDepInfosTimeDep; + DependencyInfos mDepInfosDelPhase; + DependencyInfos mDepInfosDepPhase; + + void parseInfos(); + struct Node + { + using NodeData = std::pair; + + Node() + { + } + Node(NodeData data, const Node *parent) : data(data), parent(parent) + { + } + + /** + * Gets the row relative to its parent. + */ + int getRow() const; + int childCount() const + { + return children.size(); + } + + NodeData data; + + const Node *parent = nullptr; + std::vector> children; + }; + + std::unique_ptr rootNode = std::unique_ptr(new Node); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 1b59a3eb..fca581e0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -50,6 +50,24 @@ void DDR3TimeDependencies::mInitializeValues() { } +const std::vector DDR3TimeDependencies::getPossiblePhases() { + return {"ACT", + "RD", + "RDA", + "WR", + "WRA", + "PREPB", + "PREAB", + "REFAB", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX" + }; +} + DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { DependencyMap dmap; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 7c8a30f4..47d15f9a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -7,6 +7,8 @@ class DDR3TimeDependencies : public DRAMTimeDependenciesIF { public: DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); + static const std::vector getPossiblePhases(); + protected: void mInitializeValues() override; DependencyMap mSpecializedGetDependencies() const override; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index 1586406f..a71e0eed 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -16,3 +16,32 @@ std::shared_ptr DRAMTimeDependencyFactory::make(const Tr } } + +const std::vector DRAMTimeDependencyFactory::possiblePhases(const TraceDB& tdb) { + uint clk; // Not used + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); + QString deviceType = memspec["memoryType"].toString(); + + if (deviceType == "DDR3") { + return DDR3TimeDependencies::getPossiblePhases(); + + } else { + // TODO maybe throw? + throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + + } + +} + +bool DRAMTimeDependencyFactory::deviceSupported(const TraceDB& tdb) { + uint clk; // Not used + const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); + QString deviceType = memspec["memoryType"].toString(); + + if (deviceType == "DDR3") { + return true; + + } else { + return false; + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index 748c5ab1..7a30dec4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -11,6 +11,10 @@ class DRAMTimeDependencyFactory { public: static std::shared_ptr make(const TraceDB& tdb); + static const std::vector possiblePhases(const TraceDB& tdb); + + static bool deviceSupported(const TraceDB& tdb); + private: DRAMTimeDependencyFactory() = delete; ~DRAMTimeDependencyFactory() = delete; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 2f0a8e45..0c2c6450 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -6,23 +6,28 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector 0) { + mCreateTable(tdb); + + auto& phases = mGetAllPhases(tdb, commands); + + if (phases.size() != 0) { + auto& entries = mCalculateDependencies(tdb, phases, commands); + mInsertIntoTable(tdb, entries); + + } else { + // mRollbackChanges(tdb); + // return; + } + } - auto& entries = mCalculateDependencies(tdb, phases, commands); - - mInsertIntoTable(tdb, entries); - mCommitTransaction(tdb); } void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { - QString command = "DROP TABLE DirectDependencies; "; + QString command = "DROP TABLE IF EXISTS DirectDependencies; "; auto query = mExecuteQuery(tdb, command); query.finish(); @@ -54,7 +59,8 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< // Write last entry and submit mAddEntryCommandString(command, entry); - mExecuteQuery(tdb, command); + auto query = mExecuteQuery(tdb, command); + query.finish(); counter = 0; @@ -70,7 +76,8 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } if (counter != 0) { - mExecuteQuery(tdb, command); + auto query = mExecuteQuery(tdb, command); + query.finish(); } } @@ -93,6 +100,9 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector auto query = mExecuteQuery(tdb, queryStr); + if (!query.next()) + return phases; + if (!query.last()) { throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" "Could not retrieve number of rows\n").toStdString(), @@ -128,6 +138,8 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); } + query.finish(); + return phases; } @@ -243,20 +255,20 @@ QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString qu void PhaseDependenciesTracker::mBeginTransaction(TraceDB& tdb) { const QString queryStr = "BEGIN TRANSACTION;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mRollbackChanges(TraceDB& tdb) { const QString queryStr = "ROLLBACK;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mCommitTransaction(TraceDB& tdb) { const QString queryStr = "COMMIT;"; - mExecuteQuery(tdb, queryStr); - + auto query = mExecuteQuery(tdb, queryStr); + query.finish(); } void PhaseDependenciesTracker::mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry) { diff --git a/DRAMSys/traceAnalyzer/data/QueryTexts.h b/DRAMSys/traceAnalyzer/data/QueryTexts.h index 361ec855..0b877a5d 100644 --- a/DRAMSys/traceAnalyzer/data/QueryTexts.h +++ b/DRAMSys/traceAnalyzer/data/QueryTexts.h @@ -63,7 +63,7 @@ struct TransactionQueryTexts { "WITH timespanTransactions AS (" + selectTransactionsByTimespan + ") SELECT * from DirectDependencies WHERE DelayedPhaseID IN (" " SELECT DirectDependencies.DelayedPhaseID FROM DirectDependencies JOIN timespanTransactions " - " ON DirectDependencies.DelayedPhaseID = timespanTransactions.PhaseID )"; + " ON DirectDependencies.DelayedPhaseID = timespanTransactions.PhaseID ) "; // For some reason I could not use a parameter for these below selectDependencyTypePercentages = @@ -79,7 +79,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectTimeDependencyPercentages = "WITH TotalDeps (total) AS ( " @@ -94,7 +94,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectDelayedPhasePercentages = "WITH TotalDeps (total) AS ( " @@ -109,7 +109,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; selectDependencyPhasePercentages = "WITH TotalDeps (total) AS ( " @@ -124,7 +124,7 @@ struct TransactionQueryTexts { ") " "SELECT param, ROUND(ndeps*100.0 / (SELECT total FROM TotalDeps), 3) as percentage " "FROM DependencyTypeDeps " - "ORDER BY percentage DESC "; + "ORDER BY percentage DESC ;"; } }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 75c0f133..a8584360 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -66,7 +66,10 @@ TraceDB::TraceDB(QString path, bool openExisting) database = QSqlDatabase::addDatabase("QSQLITE", path); database.setDatabaseName(path); - database.open(); + if (!database.open()) + { + qDebug() << database.lastError().text(); + } if (!openExisting) dropAndCreateTables(); prepareQueries(); @@ -471,6 +474,7 @@ DependencyInfos TraceDB::getDependencyInfos(DependencyInfos::Type infoType) executeQuery(checkDependenciesExist); if (!checkDependenciesExist.next() || checkDependenciesExist.value(0).toInt() != 1) { + checkDependenciesExist.finish(); return dummy; } @@ -635,6 +639,8 @@ DependencyInfos TraceDB::parseDependencyInfos(QSqlQuery &query, const Dependency infos.addInfo({query.value(0).toString(), query.value(1).toFloat()}); } + query.finish(); + return infos; } @@ -649,6 +655,7 @@ void TraceDB::executeQuery(QSqlQuery query) } else { + query.finish(); throw sqlException( ("Query:\n " + queryToString(query) + "\n failed. Error: \n" + query.lastError().text()).toStdString(), this->pathToDB.toStdString()); diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index b7160fac..86c5869f 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -524,6 +524,9 @@ void TracePlot::currentTraceTimeChanged() } setAxisScale(xBottom, GetCurrentTimespan().Begin(), GetCurrentTimespan().End()); + + dependenciesSubMenu->setEnabled(navigator->TraceFile().checkDependencyTableExists()); + replot(); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index c922b299..66b2c401 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -87,6 +87,8 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path) setUpTraceSelector(); setUpCommentView(); + setUpPossiblePhases(); + ui->mcConfigView->setModel(mcConfigModel); ui->mcConfigView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); @@ -190,6 +192,18 @@ void TraceFileTab::setUpCommentView() commentModel, &CommentModel::rowDoubleClicked); } +void TraceFileTab::setUpPossiblePhases() { + const auto possiblePhases = DRAMTimeDependencyFactory::possiblePhases(navigator->TraceFile()); + for (auto p : possiblePhases) { + auto item = new QListWidgetItem(p, ui->depTabPossiblePhases); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag + item->setCheckState(Qt::Unchecked); // AND initialize check state + + } + + ui->calculateDependencies->setEnabled(DRAMTimeDependencyFactory::deviceSupported(navigator->TraceFile())); +} + void TraceFileTab::tracefileChanged() { if (savingChangesToDB == true) { @@ -311,21 +325,17 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } void TraceFileTab::on_calculateDependencies_clicked() { - // TODO - anything else? Update view maybe? - // TODO - For now fixed, but must be selectable - std::vector dependencyFilter = { - "ACT", - "PREPB", - "RD", - "RDA", - "WR", - "WRA", - "PDE", - "PDX", - "PREAB" - }; + std::vector dependencyFilter; + for (int row = 0; row < ui->depTabPossiblePhases->count(); row++) { + auto item = ui->depTabPossiblePhases->item(row); + if (item->checkState() == Qt::Checked) + dependencyFilter.push_back(item->text()); + } PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); + depInfosView = new DependencyInfosModel(navigator->TraceFile(), this); + ui->depInfosView->setModel(depInfosView); + ui->depInfosView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index cd36887f..64e02158 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -47,6 +47,7 @@ #include "presentation/traceplot.h" #include "presentation/tracescroller.h" #include "businessObjects/configmodels.h" +#include "businessObjects/dependencymodels.h" class CommentModel; @@ -66,6 +67,8 @@ public: void setUpTraceplotScrollbar(); void setUpTraceSelector(); void setUpCommentView(); + void setUpPossiblePhases(); + void initNavigatorAndItsDependentWidgets(QString path); QString getPathToTraceFile() { diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index f2cac71d..31e8134a 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -209,16 +209,20 @@ - - - Calculate Dependencies + + + true - - - true + + + + + + + Calculate Dependencies From abe98ecf7402366a1654c60d640ceb61a622bd38 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:42:47 +0100 Subject: [PATCH 073/121] Closing database before removal. --- DRAMSys/traceAnalyzer/data/tracedb.cpp | 40 ++++++++++++++++++-------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index a8584360..079351d5 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -60,8 +60,8 @@ TraceDB::TraceDB(QString path, bool openExisting) if (database.isValid() && database.isOpen()) { // Close the database connection if it exists and was not closed yet. - database.removeDatabase(path); database.close(); + QSqlDatabase::removeDatabase(path); } database = QSqlDatabase::addDatabase("QSQLITE", path); @@ -80,28 +80,44 @@ TraceDB::TraceDB(QString path, bool openExisting) void TraceDB::prepareQueries() { selectTransactionsByTimespan = QSqlQuery(database); - selectTransactionsByTimespan.prepare(queryTexts.selectTransactionsByTimespan); - selectTransactionById = QSqlQuery(database); + if (!selectTransactionsByTimespan.prepare(queryTexts.selectTransactionsByTimespan)) + qDebug() << database.lastError().text(); + + selectTransactionById = QSqlQuery(database); + if (!selectTransactionById.prepare(queryTexts.selectTransactionById)) + qDebug() << database.lastError().text(); - selectTransactionById.prepare(queryTexts.selectTransactionById); selectDebugMessagesByTimespan = QSqlQuery(database); - selectDebugMessagesByTimespan.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end "); + if (!selectDebugMessagesByTimespan.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end ")) + qDebug() << database.lastError().text(); + selectDebugMessagesByTimespanWithLimit = QSqlQuery(database); - selectDebugMessagesByTimespanWithLimit.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end LIMIT :limit"); + if (!selectDebugMessagesByTimespanWithLimit.prepare("SELECT time, Message FROM DebugMessages WHERE :begin <= time AND time <= :end LIMIT :limit")) + qDebug() << database.lastError().text(); checkDependenciesExist = QSqlQuery(database); - checkDependenciesExist.prepare(queryTexts.checkDependenciesExist); + if (!checkDependenciesExist.prepare(queryTexts.checkDependenciesExist)) + qDebug() << database.lastError().text(); + selectDependenciesByTimespan = QSqlQuery(database); - selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan); + if (!selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan)) + qDebug() << database.lastError().text(); selectDependencyTypePercentages = QSqlQuery(database); - selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages); + if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) + qDebug() << database.lastError().text(); + selectTimeDependencyPercentages = QSqlQuery(database); - selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages); + if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) + qDebug() << database.lastError().text(); + selectDelayedPhasePercentages = QSqlQuery(database); - selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages); + if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) + qDebug() << database.lastError().text(); + selectDependencyPhasePercentages = QSqlQuery(database); - selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages); + if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) + qDebug() << database.lastError().text(); } void TraceDB::updateComments(const std::vector &comments) From f092b79592eb0936da88a6655f2861e9c850a5ea Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 15 Dec 2021 11:33:05 +0100 Subject: [PATCH 074/121] Added INT types to ID columns in DirectDependencies table creation. --- .../traceAnalyzer/businessObjects/phasedependenciestracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 0c2c6450..ccd0665c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -34,7 +34,7 @@ void PhaseDependenciesTracker::mDropTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { - QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID, DependencyPhaseName ); "; + QString command = "CREATE TABLE DirectDependencies( DelayedPhaseID INT, DelayedPhaseName, DependencyType, TimeDependency, DependencyPhaseID INT, DependencyPhaseName ); "; auto query = mExecuteQuery(tdb, command); query.finish(); From 57cf59ec3be8ec3955e6a5f2924518586c5c6e03 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 15 Dec 2021 12:31:11 +0100 Subject: [PATCH 075/121] Corrected dependency calculation algorithm. All good. --- .../dramtimedependenciesIF.cpp | 5 ++-- .../phasedependenciestracker.cpp | 8 +++++- DRAMSys/traceAnalyzer/tracefiletab.cpp | 26 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 40f43b6a..dd01353d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -67,11 +67,12 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.end(), dep.phaseDep, [](const QString& cmd, const QString& depName){ - return cmd == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + return depName == "NAW" || QStringsComparator::compareQStrings(cmd, depName); } ); - if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; + if (dep.phaseDep == "NAW" || it != dependencyFilter.end() && *it == dep.phaseDep) + return true; return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index ccd0665c..aaf0e285 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -17,6 +17,7 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vectorphaseName == "ACT") { if (timeDiff == dep.timeValue) { @@ -202,8 +204,12 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: otherPhase->id, otherPhase->phaseName }); + } + + if (timeDiff <= dep.timeValue) { + nawCount++; + } - nawCount++; } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 66b2c401..fcd287d2 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -324,6 +324,32 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) } } +bool TraceFileTab::eventFilter(QObject *object, QEvent *event) +{ + if (auto canvas = qobject_cast(object)) + { + if (event->type() == QEvent::MouseButtonDblClick) + { + QMouseEvent *mouseEvent = static_cast(event); + + if (mouseEvent->button() != Qt::LeftButton) + return false; + + QwtPlot *plot = canvas->plot(); + + double realTime = plot->invTransform(QwtPlot::xBottom, mouseEvent->x()); + + // Convert from seconds to picoseconds + traceTime time = realTime * 1000 * 1000 * 1000 * 1000; + + navigator->navigateToTime(time); + return true; + } + } + + return QWidget::eventFilter(object, event); +} + void TraceFileTab::on_calculateDependencies_clicked() { std::vector dependencyFilter; for (int row = 0; row < ui->depTabPossiblePhases->count(); row++) { From 091f7590e2a1d8eee8feef0cf6cd7ff6d22b3602 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 23 Nov 2021 12:11:15 +0100 Subject: [PATCH 076/121] Testing new color configuration -- Refactored ColorGenerator and added HSV15. --- DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp index c42339f5..d926a32f 100644 --- a/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp +++ b/DRAMSys/traceAnalyzer/presentation/util/colorgenerator.cpp @@ -63,5 +63,6 @@ QColor ColorGenerator::getRainbowColored(unsigned int i, ColorName color) return {0, 0, 0}; } + ColorDefault ColorGenerator::cDefault; ColorHSV15 ColorGenerator::cHSV15; From b91edecb5ec3a2789018eca3a5a4c5dcc8150ede Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 14:44:35 +0100 Subject: [PATCH 077/121] Began adding base algorithm for dependency calculations. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + DRAMSys/traceAnalyzer/tracefiletab.ui | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index df7b80f2..acb2b9c3 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -99,6 +99,7 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp + businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index 31e8134a..affaa7b4 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -208,6 +208,13 @@ Dependency Information + + + + Calculate Dependencies + + + From 471adee1be0b576664ec9ef769acc9ec6ae43abe Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 8 Dec 2021 16:56:52 +0100 Subject: [PATCH 078/121] Began adding time dependencies interface for to be generated code. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../timedependenciesIF.cpp | 85 +++++++++++++++++++ .../dramTimeDependencies/timedependenciesIF.h | 44 ++++++++++ 3 files changed, 130 insertions(+) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index acb2b9c3..bd22f0a3 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -103,6 +103,7 @@ add_executable(TraceAnalyzer businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp + businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp new file mode 100644 index 00000000..89cb4052 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -0,0 +1,85 @@ + +#include "timedependenciesIF.h" + +#include + +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { + mGetMemspec(tdb); + +} + +QMap +DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { + QMap dependenciesMap; + + dependenciesMap = mSpecializedGetDependencies(); + + mFilterDependencyMap(dependenciesMap, commands); + + auto it = dependenciesMap.begin(); + while (it != dependenciesMap.end()) { + mFilterDependencyList(it.value().dependencies, commands); + it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + } + + return dependenciesMap; +} + +void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT Memspec FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + QString memSpecJson = sqlQuery.value(0).toString(); + sqlQuery.finish(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + mMemspecJson = jsonDocument.object()["memspec"].toObject(); + +} + +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { + std::vector newDepList(dependencyList.size()); + + std::copy_if( + dependencyList.begin(), + dependencyList.end(), + newDepList.begin(), + [ commands ](const TimeDependency& dep) { + return dep.phaseDep == "NAW" + || ( + std::find_if( + commands.begin(), + commands.end(), + [ dep ](const QString& cmd) { + return dep.phaseDep == cmd; + } + ) != commands.end() ) + ; + } + ); + + newDepList.shrink_to_fit(); + + dependencyList = newDepList; + +} + +void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { + // TODO +} + +size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { + auto maxElement = std::max_element( + dependencyList.begin(), + dependencyList.end(), + [](const TimeDependency& dep1, const TimeDependency& dep2) { + return dep1.timeValue < dep2.timeValue; + } + ); + + if (maxElement == dependencyList.end()) return 0; + + return maxElement->timeValue; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h new file mode 100644 index 00000000..7234090d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -0,0 +1,44 @@ + +#pragma once + +#include +#include +#include +#include + +#include "data/tracedb.h" +#include "businessObjects/phases/phasedependency.h" + +struct TimeDependency { + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; +}; + +struct PhaseTimeDependencies { + QString phaseName; + std::vector dependencies; + size_t maxTime; +}; + +class DRAMTimeDependenciesIF { +public: + DRAMTimeDependenciesIF(const TraceDB& tdb); + virtual ~DRAMTimeDependenciesIF() = default; + + QMap getDependencies(const std::vector& commands) const; + +protected: + void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; + void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + size_t mFindVectorMaximum(const std::vector& dependencyList) const; + +protected: + QJsonObject mMemspecJson; + virtual void mInitializeValues() = 0; + virtual QMap mSpecializedGetDependencies() const = 0; + +private: + void mGetMemspec(const TraceDB& tdb); +}; From 5d2e48b40312c6686ef4b93157a5dd62f017b2db Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 12:43:19 +0100 Subject: [PATCH 079/121] Finished interface class for auto-generated time dependencies code. --- .../timedependenciesIF.cpp | 88 ++++++++++++++----- .../dramTimeDependencies/timedependenciesIF.h | 15 ++-- 2 files changed, 77 insertions(+), 26 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 89cb4052..8f6c8c7f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,18 +8,26 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -QMap -DRAMTimeDependenciesIF::getDependencies(const std::vector& commands) const { - QMap dependenciesMap; +std::map +DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { + std::map dependenciesMap; + + std::sort( + dependencyFilter.begin(), + dependencyFilter.end(), + [](const QString& s1, const QString& s2) { + return s1.compare(s2); + } + ); dependenciesMap = mSpecializedGetDependencies(); - mFilterDependencyMap(dependenciesMap, commands); + mFilterDependencyMap(dependenciesMap, dependencyFilter); auto it = dependenciesMap.begin(); while (it != dependenciesMap.end()) { - mFilterDependencyList(it.value().dependencies, commands); - it.value().maxTime = mFindVectorMaximum(it.value().dependencies); + mFilterDependencyList(it->second.dependencies, dependencyFilter); + it->second.maxTime = mFindVectorMaximum(it->second.dependencies); } return dependenciesMap; @@ -39,24 +47,26 @@ void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const { +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); std::copy_if( dependencyList.begin(), dependencyList.end(), newDepList.begin(), - [ commands ](const TimeDependency& dep) { - return dep.phaseDep == "NAW" - || ( - std::find_if( - commands.begin(), - commands.end(), - [ dep ](const QString& cmd) { - return dep.phaseDep == cmd; - } - ) != commands.end() ) - ; + [ dependencyFilter ](const TimeDependency& dep) { + auto it = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dep.phaseDep, + [](const QString& cmd, const QString& value) { + return value.compare(cmd); + } + ); + + if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; + + return false; } ); @@ -66,8 +76,46 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const { - // TODO +void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { + if (!dependencyMap.empty()) { + + auto itFilter = dependencyFilter.begin(); + auto itFilterLast = std::lower_bound( + dependencyFilter.begin(), + dependencyFilter.end(), + dependencyMap.rbegin()->first + ); + + auto itDependencyMap = dependencyMap.begin(); + + while (true) { + + auto pair = std::mismatch( + itFilter, + itFilterLast, + itDependencyMap, + [](const QString& cmd, const std::pair& vpair) { + return cmd == vpair.first; + } + ); + + if (pair.first == dependencyFilter.end() || pair.second == dependencyMap.end()) { + dependencyMap.erase(pair.second, dependencyMap.end()); + break; + + } else if (pair.first->compare(pair.second->first) < 0) { + ++(pair.first); + + } else { + pair.second = dependencyMap.erase(pair.second); + + } + + itFilter = pair.first; + itDependencyMap = pair.second; + + } + } } size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 7234090d..2d0c657f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "data/tracedb.h" @@ -27,17 +27,20 @@ public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - QMap getDependencies(const std::vector& commands) const; + std::map getDependencies(std::vector& dependencyFilter) const; protected: - void mFilterDependencyList(std::vector& dependencyList, const std::vector& commands) const; - void mFilterDependencyMap(QMap& dependencyList, const std::vector& commands) const; + void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; - + protected: QJsonObject mMemspecJson; + +// To be implemented +protected: virtual void mInitializeValues() = 0; - virtual QMap mSpecializedGetDependencies() const = 0; + virtual std::map mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); From 96cd0e1f588406e797c734d191234a4672c70490 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 13:29:06 +0100 Subject: [PATCH 080/121] Added stl map QString comparator. --- .../timedependenciesIF.cpp | 22 +++++++++++-------- .../dramTimeDependencies/timedependenciesIF.h | 16 +++++++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp index 8f6c8c7f..692c87c4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp @@ -8,16 +8,14 @@ DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { } -std::map +DependencyMap DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { - std::map dependenciesMap; + DependencyMap dependenciesMap; std::sort( dependencyFilter.begin(), dependencyFilter.end(), - [](const QString& s1, const QString& s2) { - return s1.compare(s2); - } + QStringsComparator::compareQStrings ); dependenciesMap = mSpecializedGetDependencies(); @@ -59,9 +57,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - [](const QString& cmd, const QString& value) { - return value.compare(cmd); - } + QStringsComparator::compareQStrings ); if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; @@ -76,7 +72,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -131,3 +127,11 @@ size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vectortimeValue; } + +bool QStringsComparator::operator()(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} + +bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h index 2d0c657f..a9bbde13 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h @@ -22,16 +22,24 @@ struct PhaseTimeDependencies { size_t maxTime; }; + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2); + static bool compareQStrings(const QString& s1, const QString& s2); +}; + +typedef std::map DependencyMap; + class DRAMTimeDependenciesIF { public: DRAMTimeDependenciesIF(const TraceDB& tdb); virtual ~DRAMTimeDependenciesIF() = default; - std::map getDependencies(std::vector& dependencyFilter) const; + DependencyMap getDependencies(std::vector& dependencyFilter) const; protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; - void mFilterDependencyMap(std::map& dependencyMap, const std::vector& dependencyFilter) const; + void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; size_t mFindVectorMaximum(const std::vector& dependencyList) const; protected: @@ -40,8 +48,10 @@ protected: // To be implemented protected: virtual void mInitializeValues() = 0; - virtual std::map mSpecializedGetDependencies() const = 0; + virtual DependencyMap mSpecializedGetDependencies() const = 0; private: void mGetMemspec(const TraceDB& tdb); + }; + From 06e6cbf7d81642792a365313fb989599ac7848a8 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 9 Dec 2021 15:50:26 +0100 Subject: [PATCH 081/121] Started adding manual code for DDR3 time dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 7 +- .../timedependenciesIF.cpp | 137 ------------------ .../dramTimeDependencies/timedependenciesIF.h | 57 -------- 3 files changed, 5 insertions(+), 196 deletions(-) delete mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp delete mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index bd22f0a3..a5cb7db4 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -99,11 +99,9 @@ add_executable(TraceAnalyzer businessObjects/pythoncaller.cpp businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp - businessObjects/phasedependenciestracker.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp businessObjects/phases/dependencyinfos.cpp - businessObjects/dramTimeDependencies/timedependenciesIF.cpp presentation/tracedrawingproperties.cpp presentation/util/traceplotline.cpp presentation/util/traceplotlinecache.cpp @@ -119,6 +117,11 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp businessObjects/phasedependenciestracker.cpp + businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp + businessObjects/phasedependenciestracker.cpp + selectmetrics.ui preferences.ui evaluationtool.ui diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp deleted file mode 100644 index 692c87c4..00000000 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.cpp +++ /dev/null @@ -1,137 +0,0 @@ - -#include "timedependenciesIF.h" - -#include - -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const TraceDB& tdb) { - mGetMemspec(tdb); - -} - -DependencyMap -DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { - DependencyMap dependenciesMap; - - std::sort( - dependencyFilter.begin(), - dependencyFilter.end(), - QStringsComparator::compareQStrings - ); - - dependenciesMap = mSpecializedGetDependencies(); - - mFilterDependencyMap(dependenciesMap, dependencyFilter); - - auto it = dependenciesMap.begin(); - while (it != dependenciesMap.end()) { - mFilterDependencyList(it->second.dependencies, dependencyFilter); - it->second.maxTime = mFindVectorMaximum(it->second.dependencies); - } - - return dependenciesMap; -} - -void DRAMTimeDependenciesIF::mGetMemspec(const TraceDB& tdb) { - QSqlDatabase db = tdb.getDatabase(); - QString query = "SELECT Memspec FROM GeneralInfo"; - QSqlQuery sqlQuery = db.exec(query); - - sqlQuery.next(); - QString memSpecJson = sqlQuery.value(0).toString(); - sqlQuery.finish(); - - QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); - mMemspecJson = jsonDocument.object()["memspec"].toObject(); - -} - -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { - std::vector newDepList(dependencyList.size()); - - std::copy_if( - dependencyList.begin(), - dependencyList.end(), - newDepList.begin(), - [ dependencyFilter ](const TimeDependency& dep) { - auto it = std::lower_bound( - dependencyFilter.begin(), - dependencyFilter.end(), - dep.phaseDep, - QStringsComparator::compareQStrings - ); - - if (it != dependencyFilter.end() && *it == dep.phaseDep) return true; - - return false; - } - ); - - newDepList.shrink_to_fit(); - - dependencyList = newDepList; - -} - -void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { - if (!dependencyMap.empty()) { - - auto itFilter = dependencyFilter.begin(); - auto itFilterLast = std::lower_bound( - dependencyFilter.begin(), - dependencyFilter.end(), - dependencyMap.rbegin()->first - ); - - auto itDependencyMap = dependencyMap.begin(); - - while (true) { - - auto pair = std::mismatch( - itFilter, - itFilterLast, - itDependencyMap, - [](const QString& cmd, const std::pair& vpair) { - return cmd == vpair.first; - } - ); - - if (pair.first == dependencyFilter.end() || pair.second == dependencyMap.end()) { - dependencyMap.erase(pair.second, dependencyMap.end()); - break; - - } else if (pair.first->compare(pair.second->first) < 0) { - ++(pair.first); - - } else { - pair.second = dependencyMap.erase(pair.second); - - } - - itFilter = pair.first; - itDependencyMap = pair.second; - - } - } -} - -size_t DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { - auto maxElement = std::max_element( - dependencyList.begin(), - dependencyList.end(), - [](const TimeDependency& dep1, const TimeDependency& dep2) { - return dep1.timeValue < dep2.timeValue; - } - ); - - if (maxElement == dependencyList.end()) return 0; - - return maxElement->timeValue; -} - -bool QStringsComparator::operator()(const QString& s1, const QString& s2) { - return s1.compare(s2) < 0; -} - -bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { - return s1.compare(s2) < 0; -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h deleted file mode 100644 index a9bbde13..00000000 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependenciesIF.h +++ /dev/null @@ -1,57 +0,0 @@ - -#pragma once - -#include -#include -#include -#include - -#include "data/tracedb.h" -#include "businessObjects/phases/phasedependency.h" - -struct TimeDependency { - size_t timeValue; - QString phaseDep; - DependencyType depType; - QString timeDepName; -}; - -struct PhaseTimeDependencies { - QString phaseName; - std::vector dependencies; - size_t maxTime; -}; - - -struct QStringsComparator { - bool operator()(const QString& s1, const QString& s2); - static bool compareQStrings(const QString& s1, const QString& s2); -}; - -typedef std::map DependencyMap; - -class DRAMTimeDependenciesIF { -public: - DRAMTimeDependenciesIF(const TraceDB& tdb); - virtual ~DRAMTimeDependenciesIF() = default; - - DependencyMap getDependencies(std::vector& dependencyFilter) const; - -protected: - void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; - void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; - size_t mFindVectorMaximum(const std::vector& dependencyList) const; - -protected: - QJsonObject mMemspecJson; - -// To be implemented -protected: - virtual void mInitializeValues() = 0; - virtual DependencyMap mSpecializedGetDependencies() const = 0; - -private: - void mGetMemspec(const TraceDB& tdb); - -}; - From 6e569ebe1187e93f6d1322b07127b51628c92cd1 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 10 Dec 2021 15:14:39 +0100 Subject: [PATCH 082/121] Added main calculation loop and other modifications and corrections. Still missing table data storing and test. --- .../dramTimeDependencies/dramtimedependenciesIF.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index bd495583..de20bc48 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -48,6 +48,9 @@ public: const uint getClk() const { return clk; } const uint getNAW() const { return nActivateWindow; }; + const uint getClk() const { return clk; } + const uint getNAW() const { return nActivateWindow; }; + protected: void mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const; void mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const; From f5f4d38b7009265b8d14d570ce191bffaf38033d Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 13 Dec 2021 16:30:45 +0100 Subject: [PATCH 083/121] Added interface for dependency calculation. --- DRAMSys/traceAnalyzer/tracefiletab.ui | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index affaa7b4..8beed4a5 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -209,16 +209,20 @@ - - - Calculate Dependencies + + + true - - - true + + + + + + + Calculate Dependencies From 9d6ceca4fccfea50c046544f5c16f72b71837fec Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 16 Dec 2021 13:58:10 +0100 Subject: [PATCH 084/121] Changed command bus dependencies to Inter-Rank. --- .../businessObjects/phasedependenciestracker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index aaf0e285..280eb02c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -186,7 +186,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: if ( dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank - || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? + || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? Check if this holds on all devices ) { continue; } @@ -233,7 +233,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: entries.emplace_back(DBDependencyEntry{ phase->id, phase->phaseName, - PhaseDependency::dependencyTypeName(DependencyType::IntraRank), + PhaseDependency::dependencyTypeName(DependencyType::InterRank), "CommandBus", otherPhase->id, otherPhase->phaseName @@ -242,6 +242,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } + if (nawCount >= device->getNAW()) { entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); } From 6d7a1726059015cf2aeded7836d5006032c2c743 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 10 Jan 2022 11:38:00 +0100 Subject: [PATCH 085/121] Added copyright message to files. --- .../businessObjects/configmodels.cpp | 1 - .../businessObjects/dependencymodels.cpp | 34 +++++++++++++++++++ .../businessObjects/dependencymodels.h | 34 +++++++++++++++++++ .../DDR3TimeDependencies.cpp | 34 +++++++++++++++++++ .../DDR3TimeDependencies.h | 34 +++++++++++++++++++ .../dramtimedependenciesIF.cpp | 34 +++++++++++++++++++ .../dramtimedependenciesIF.h | 34 +++++++++++++++++++ .../dramtimedependencyfactory.cpp | 34 +++++++++++++++++++ .../dramtimedependencyfactory.h | 34 +++++++++++++++++++ .../phasedependenciestracker.cpp | 34 +++++++++++++++++++ .../phasedependenciestracker.h | 34 +++++++++++++++++++ 11 files changed, 340 insertions(+), 1 deletion(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp index 439f85f1..94fe6ddd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp @@ -31,7 +31,6 @@ * * Authors: * Derek Christ - * Iron Prando da Silva */ #include "configmodels.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp index cbc39b65..3f398928 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "dependencymodels.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h index 02736e13..65c364c2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dependencymodels.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index fca581e0..790f5d4a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR3TimeDependencies.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 47d15f9a..15f746a3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index dd01353d..ae3521d4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "dramtimedependenciesIF.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index de20bc48..4562504c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp index a71e0eed..0377fe3b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "dramtimedependencyfactory.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h index 7a30dec4..566d378b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 280eb02c..f3b6b91b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "phasedependenciestracker.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index 17d5ecda..caf1acbd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once From bd1f7b55866cf6300c03db7617b07979451bbd96 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 10 Jan 2022 12:42:46 +0100 Subject: [PATCH 086/121] Corrected 'unable to fetch row' exception after removing dependencies database, reopening file and calculating new dependencies. --- .../DDR3TimeDependencies.cpp | 16 ++--- .../phasedependenciestracker.cpp | 21 +++--- .../phasedependenciestracker.h | 2 +- DRAMSys/traceAnalyzer/data/tracedb.cpp | 68 +++++++++++-------- DRAMSys/traceAnalyzer/tracefiletab.cpp | 3 +- 5 files changed, 61 insertions(+), 49 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 790f5d4a..83b45c18 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -282,14 +282,14 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { std::forward_as_tuple("PDEP"), std::forward_as_tuple( std::initializer_list{ - {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, - {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, - {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, - {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, - {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, - {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, - {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index f3b6b91b..2180549f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -41,17 +41,20 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector 0) { - mCreateTable(tdb); - - auto& phases = mGetAllPhases(tdb, commands); + if (commands.size() > 0) { + auto& phases = mGetFilteredPhases(tdb, commands); if (phases.size() != 0) { auto& entries = mCalculateDependencies(tdb, phases, commands); + + if (entries.size() > 0) { + mCreateTable(tdb); + } + mInsertIntoTable(tdb, entries); } else { - // TODO - not sure if necessary. Still here as a possibility + // TODO - not sure if necessary. Still, a possibility // mRollbackChanges(tdb); // return; } @@ -118,7 +121,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " @@ -148,7 +151,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector if (!query.first()) { throw sqlException( ("Query:\n " + tdb.queryToString(query) + "\n failed. Error: \n" - "Could not safely retrieve number of rows\n").toStdString(), + "Could not retrieve number of rows safely\n").toStdString(), tdb.pathToDB.toStdString()); } @@ -170,7 +173,7 @@ PhaseDependenciesTracker::mGetAllPhases(TraceDB& tdb, const std::vector } while (query.next()); if (rowIt != nrows) { - throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetAllPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); + throw std::runtime_error("An error occurred while fetching phases in 'PhaseDependenciesTracker::mGetFilteredPhases': expected " + std::to_string(nrows) + " rows, but found " + std::to_string(rowIt) + "\n"); } query.finish(); @@ -287,7 +290,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } QSqlQuery PhaseDependenciesTracker::mExecuteQuery(TraceDB& tdb, const QString queryStr) { - QSqlQuery query(tdb.getDatabase()); + QSqlQuery query(tdb.database); query.prepare(queryStr); tdb.executeQuery(query); diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h index caf1acbd..5726a6fb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h @@ -70,7 +70,7 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetAllPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index 079351d5..f11cf7ee 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -103,21 +103,6 @@ void TraceDB::prepareQueries() if (!selectDependenciesByTimespan.prepare(queryTexts.selectDependenciesByTimespan)) qDebug() << database.lastError().text(); - selectDependencyTypePercentages = QSqlQuery(database); - if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) - qDebug() << database.lastError().text(); - - selectTimeDependencyPercentages = QSqlQuery(database); - if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) - qDebug() << database.lastError().text(); - - selectDelayedPhasePercentages = QSqlQuery(database); - if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) - qDebug() << database.lastError().text(); - - selectDependencyPhasePercentages = QSqlQuery(database); - if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) - qDebug() << database.lastError().text(); } void TraceDB::updateComments(const std::vector &comments) @@ -487,30 +472,53 @@ std::vector TraceDB::getDebugMessagesInTimespan(const Tim DependencyInfos TraceDB::getDependencyInfos(DependencyInfos::Type infoType) { DependencyInfos dummy; - executeQuery(checkDependenciesExist); - if (!checkDependenciesExist.next() || checkDependenciesExist.value(0).toInt() != 1) + if (!checkDependencyTableExists()) { - checkDependenciesExist.finish(); return dummy; } switch (infoType) { - case DependencyInfos::Type::DependencyType: - executeQuery(selectDependencyTypePercentages); - return parseDependencyInfos(selectDependencyTypePercentages, infoType); + case DependencyInfos::Type::DependencyType: + { + selectDependencyTypePercentages = QSqlQuery(database); + if (!selectDependencyTypePercentages.prepare(queryTexts.selectDependencyTypePercentages)) + qDebug() << database.lastError().text(); - case DependencyInfos::Type::TimeDependency: - executeQuery(selectTimeDependencyPercentages); - return parseDependencyInfos(selectTimeDependencyPercentages, infoType); + executeQuery(selectDependencyTypePercentages); + return parseDependencyInfos(selectDependencyTypePercentages, infoType); + } - case DependencyInfos::Type::DelayedPhase: - executeQuery(selectDelayedPhasePercentages); - return parseDependencyInfos(selectDelayedPhasePercentages, infoType); + case DependencyInfos::Type::TimeDependency: + { + selectTimeDependencyPercentages = QSqlQuery(database); + if (!selectTimeDependencyPercentages.prepare(queryTexts.selectTimeDependencyPercentages)) + qDebug() << database.lastError().text(); + + executeQuery(selectTimeDependencyPercentages); + return parseDependencyInfos(selectTimeDependencyPercentages, infoType); + } + + case DependencyInfos::Type::DelayedPhase: + { + selectDelayedPhasePercentages = QSqlQuery(database); + if (!selectDelayedPhasePercentages.prepare(queryTexts.selectDelayedPhasePercentages)) + qDebug() << database.lastError().text(); + + executeQuery(selectDelayedPhasePercentages); + return parseDependencyInfos(selectDelayedPhasePercentages, infoType); + } + + case DependencyInfos::Type::DependencyPhase: + { + selectDependencyPhasePercentages = QSqlQuery(database); + if (!selectDependencyPhasePercentages.prepare(queryTexts.selectDependencyPhasePercentages)) + qDebug() << database.lastError().text(); + + executeQuery(selectDependencyPhasePercentages); + return parseDependencyInfos(selectDependencyPhasePercentages, infoType); + } - case DependencyInfos::Type::DependencyPhase: - executeQuery(selectDependencyPhasePercentages); - return parseDependencyInfos(selectDependencyPhasePercentages, infoType); } return dummy; diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index fcd287d2..52ddf73b 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -357,7 +357,8 @@ void TraceFileTab::on_calculateDependencies_clicked() { if (item->checkState() == Qt::Checked) dependencyFilter.push_back(item->text()); } - + + savingChangesToDB = true; PhaseDependenciesTracker::calculateDependencies(navigator->TraceFile(), dependencyFilter); depInfosView = new DependencyInfosModel(navigator->TraceFile(), this); ui->depInfosView->setModel(depInfosView); From 11bc43739d14e66a94f774d7482d8fc28c8ebdf1 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 11 Jan 2022 11:36:48 +0100 Subject: [PATCH 087/121] Added InterRank variable for skip checking when phases are within the same rank. --- .../dramtimedependenciesIF.h | 11 +++++++++- .../phasedependenciestracker.cpp | 20 ++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index 4562504c..ef2ff05b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -47,11 +47,20 @@ #include "data/tracedb.h" #include "businessObjects/phases/phasedependency.h" -struct TimeDependency { +class TimeDependency { +public: + TimeDependency() = default; + TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, + QString timeDepName, bool considerIntraRank = false) + : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, + timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + size_t timeValue; QString phaseDep; DependencyType depType; QString timeDepName; + bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + }; struct PhaseTimeDependencies { diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp index 2180549f..dba1523d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp @@ -220,11 +220,21 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: for (const auto& dep : deps.dependencies) { if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; - if ( - dep.depType == DependencyType::IntraBank && cmdBank != otherPhase->tBank - || dep.depType == DependencyType::IntraRank && cmdRank != otherPhase->tRank - || dep.depType == DependencyType::InterRank && cmdRank == otherPhase->tRank // TODO - is this last comparison correct? Check if this holds on all devices - ) { + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && cmdBank != otherPhase->tBank + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && cmdRank != otherPhase->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && cmdRank == otherPhase->tRank + && !dep.considerIntraRank + }; + + if (skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank) { continue; } From 2bf1d9a30597b8608498a32ed71ff7e6dbefa46f Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 13 Jan 2022 13:45:32 +0100 Subject: [PATCH 088/121] Corrected rainbow transaction color selection indicator. --- DRAMSys/traceAnalyzer/presentation/traceplot.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp index 86c5869f..07243e1c 100644 --- a/DRAMSys/traceAnalyzer/presentation/traceplot.cpp +++ b/DRAMSys/traceAnalyzer/presentation/traceplot.cpp @@ -151,6 +151,7 @@ void TracePlot::setUpActions() SLOT(on_colorGroupingTransaction())); setColorGroupingRainbowTransaction = new QAction("Group by Transaction - Rainbow Colored", this); + setColorGroupingRainbowTransaction->setCheckable(true); addAction(setColorGroupingRainbowTransaction); QObject::connect(setColorGroupingRainbowTransaction, SIGNAL(triggered()), this, SLOT(on_colorGroupingRainbowTransaction())); @@ -164,6 +165,7 @@ void TracePlot::setUpActions() QActionGroup *colorGroupingGroup = new QActionGroup(this); colorGroupingGroup->addAction(setColorGroupingPhase); colorGroupingGroup->addAction(setColorGroupingTransaction); + colorGroupingGroup->addAction(setColorGroupingRainbowTransaction); colorGroupingGroup->addAction(setColorGroupingThread); exportToPdf = new QAction("Export to SVG", this); From 922b77820e2c02ae325937b4375ff8e721530d59 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 17 Jan 2022 14:00:35 +0100 Subject: [PATCH 089/121] Renamed variable clk to tCk. --- .../DDR3TimeDependencies.cpp | 62 +++++++++---------- .../DDR3TimeDependencies.h | 4 +- .../dramtimedependenciesIF.cpp | 8 +-- .../dramtimedependenciesIF.h | 8 +-- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index 83b45c18..f09f3cfc 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -35,7 +35,7 @@ #include "DDR3TimeDependencies.h" -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint clk) : DRAMTimeDependenciesIF(memspec, clk) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { mInitializeValues(); } @@ -44,43 +44,43 @@ void DDR3TimeDependencies::mInitializeValues() { dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; - tRP = clk * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); - tRAS = clk * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); - tRC = clk * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); - tRTP = clk * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); - tRRD = clk * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); - tCCD = clk * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); - tRCD = clk * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); - tNAW = clk * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); - tRL = clk * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); - tWL = clk * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); - tWR = clk * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); - tWTR = clk * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); - tCKESR = clk * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); - tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); - tXP = clk * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); - tXPDLL = clk * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); - tXS = clk * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); - tXSDLL = clk * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); - tAL = clk * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); - tRFC = clk * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); - tREFI = clk * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); - tRTRS = clk * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); - tACTPDEN = clk * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); - tPRPDEN = clk * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); - tREFPDEN = clk * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); - tCKE = clk * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tNAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = tCK * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXPDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XPDLL"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRFC = tCK * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); tPD = tCKE; - tBURST = (uint) ((burstLength / (float) dataRate) * clk); - tRDWR = tRL + tBURST + 2 * clk - tWL; + tBURST = (uint) ((burstLength / (float) dataRate) * tCK); + tRDWR = tRL + tBURST + 2 * tCK - tWL; tRDWR_R = tRL + tBURST + tRTRS - tWL; tWRRD = tWL + tBURST + tWTR; tWRRD_R = tWL + tBURST + tRTRS - tRL; tWRPRE = tWL + tBURST + tWR; - tRDPDEN = tRL + tBURST + clk; + tRDPDEN = tRL + tBURST + tCK; tWRPDEN = tWL + tBURST + tWR; - tWRAPDEN = tWL + tBURST + tWR + clk; + tWRAPDEN = tWL + tBURST + tWR + tCK; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 15f746a3..98daf4f6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -37,9 +37,9 @@ #include "dramtimedependenciesIF.h" -class DDR3TimeDependencies : public DRAMTimeDependenciesIF { +class DDR3TimeDependencies final : public DRAMTimeDependenciesIF { public: - DDR3TimeDependencies(const QJsonObject& memspec, const uint clk); + DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK); static const std::vector getPossiblePhases(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index ae3521d4..16132ec3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -37,9 +37,9 @@ #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inClk) { +DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inTCK) { mMemspecJson = memspec; - clk = inClk; + tCK = inTCK; } @@ -69,13 +69,13 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& clk) { +const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& tCK) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT clk, Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); sqlQuery.next(); - clk = sqlQuery.value(0).toInt(); + tCK = sqlQuery.value(0).toInt(); QString memSpecJson = sqlQuery.value(1).toString(); sqlQuery.finish(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index ef2ff05b..016c52e2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -81,14 +81,14 @@ typedef std::map DependencyM class DRAMTimeDependenciesIF { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint clk); + DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint tCK); virtual ~DRAMTimeDependenciesIF() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb, uint& clk); + static const QJsonObject getMemspec(const TraceDB& tdb, uint& tCK); - const uint getClk() const { return clk; } + const uint getClk() const { return tCK; } const uint getNAW() const { return nActivateWindow; }; const uint getClk() const { return clk; } @@ -107,7 +107,7 @@ protected: virtual void mInitializeValues() {} ; virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; - uint clk = 0; + uint tCK = 0; uint nActivateWindow = 0; }; From ee3bea7f9235ae7393819717c76738086f6defa1 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 19 Jan 2022 12:32:03 +0100 Subject: [PATCH 090/121] Added auxiliar class for multiple activate window pool capturing. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 3 +- .../DDR3TimeDependencies.cpp | 7 +- .../DDR3TimeDependencies.h | 2 +- .../activatewindowpoolcontroller.cpp | 84 ++++++++++++++++ .../activatewindowpoolcontroller.h | 56 +++++++++++ .../dramTimeDependencies/commonstructures.h | 97 +++++++++++++++++++ .../dramtimedependenciesIF.cpp | 8 +- .../phasedependenciestracker.cpp | 27 +++--- .../phasedependenciestracker.h | 22 +---- DRAMSys/traceAnalyzer/tracefiletab.cpp | 2 +- 10 files changed, 267 insertions(+), 41 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h rename DRAMSys/traceAnalyzer/businessObjects/{ => dramTimeDependencies}/phasedependenciestracker.cpp (93%) rename DRAMSys/traceAnalyzer/businessObjects/{ => dramTimeDependencies}/phasedependenciestracker.h (87%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index a5cb7db4..d2aad098 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -112,10 +112,11 @@ add_executable(TraceAnalyzer simulationdialog.cpp businessObjects/dependencymodels.cpp + businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp - businessObjects/phasedependenciestracker.cpp + businessObjects/dramTimeDependencies/phasedependenciestracker.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index f09f3cfc..b2d1174a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -44,6 +44,9 @@ void DDR3TimeDependencies::mInitializeValues() { dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); nActivateWindow = 4; + + mPoolSizes.insert({"FAW", 4}); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); @@ -51,7 +54,7 @@ void DDR3TimeDependencies::mInitializeValues() { tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); - tNAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); @@ -120,7 +123,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tNAW, "NAW", DependencyType::IntraRank, "tNAW"} + {tFAW, "FAW_POOL", DependencyType::IntraRank, "tFAW"} } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h index 98daf4f6..8aff95e9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h @@ -58,7 +58,7 @@ protected: uint tRRD; uint tCCD; uint tRCD; - uint tNAW; + uint tFAW; uint tRL; uint tWL; uint tWR; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp new file mode 100644 index 00000000..e8961b4a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#include "activatewindowpoolcontroller.h" + +ActivateWindowPoolController::ActivateWindowPoolController(const std::map& poolSizes) { + mPoolSizes = poolSizes; + + for (const auto& p : poolSizes) { + mPools.insert({p.first, {}}); + mCounts.insert({p.first, 0}); + mPools[p.first].reserve(32); + } + +} + +void ActivateWindowPoolController::clear() { + for (auto& p : mPools) { + p.second.clear(); + mCounts[p.first] = 0; + } + +} + +void ActivateWindowPoolController::push(const QString& poolName, DBDependencyEntry dep) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + pool->second.push_back(dep); + mCounts[poolName]++; + + } else { + // TODO throw? + } +} + +void ActivateWindowPoolController::increment(const QString& poolName) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + mCounts[poolName]++; + + } else { + // TODO throw? + } +} + +void ActivateWindowPoolController::merge(std::vector& depEntries) { + for (const auto& p : mPools) { + if(mCounts[p.first] >= mPoolSizes[p.first]) { + depEntries.insert( depEntries.end(), p.second.begin(), p.second.end() ); + } + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h new file mode 100644 index 00000000..1fb349a7 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#pragma once + +#include "commonstructures.h" + +// TODO +class ActivateWindowPoolController { +public: + ActivateWindowPoolController(const std::map& poolSizes); + ~ActivateWindowPoolController() = default; + + void clear(); + void push(const QString& poolName, DBDependencyEntry); + void increment(const QString& poolName); + void merge(std::vector& depEntries); + +protected: + std::map, QStringsComparator> mPools; + std::map mCounts; + std::map mPoolSizes; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h new file mode 100644 index 00000000..768b49c0 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +#include "businessObjects/phases/phasedependency.h" + +class TimeDependency { +public: + TimeDependency() = default; + TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, + QString timeDepName, bool considerIntraRank = false) + : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, + timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; + bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + +}; + +struct PhaseTimeDependencies { + explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} + + std::vector dependencies; + size_t maxTime; +}; + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2); + static bool compareQStrings(const QString& s1, const QString& s2); +}; + +typedef std::map DependencyMap; + + +struct DBPhaseEntry { + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; + size_t tRank; +}; + +struct DBDependencyEntry { + size_t delayedPhaseID; + QString delayedPhaseName; + QString dependencyType; + QString timeDependency; + size_t dependencyPhaseID; + QString dependencyPhaseName; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp index 16132ec3..c101f468 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp @@ -69,6 +69,10 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } +ActivateWindowPoolController DRAMTimeDependenciesIF::getAWPools() const { + return ActivateWindowPoolController(mPoolSizes); +} + const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& tCK) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT clk, Memspec FROM GeneralInfo"; @@ -101,11 +105,11 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.end(), dep.phaseDep, [](const QString& cmd, const QString& depName){ - return depName == "NAW" || QStringsComparator::compareQStrings(cmd, depName); + return depName.indexOf("_POOL", 3) != -1 || QStringsComparator::compareQStrings(cmd, depName); } ); - if (dep.phaseDep == "NAW" || it != dependencyFilter.end() && *it == dep.phaseDep) + if (dep.phaseDep.indexOf("_POOL", 3) != -1 || it != dependencyFilter.end() && *it == dep.phaseDep) return true; return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp similarity index 93% rename from DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index dba1523d..f9cbb420 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -191,12 +191,10 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: DependencyMap deviceDependencies = device->getDependencies(commands); // Tries to find all timing dependencies for each phase on the trace - std::vector tmpPotentialNAW; - tmpPotentialNAW.reserve(16); + ActivateWindowPoolController poolController = device->getAWPools(); for (size_t i = 1; i < phases.size(); i++) { // NAW dependencies variables reset - tmpPotentialNAW.clear(); - size_t nawCount = 0; + poolController.clear(); // Auxiliary variables const auto& phase = phases[i]; @@ -218,7 +216,8 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: // For each possible dependency for the current phase, // checks if otherPhase would match as a dependency for (const auto& dep : deps.dependencies) { - if (dep.phaseDep != "NAW" && dep.phaseDep != otherPhase->phaseName) continue; + int poolSubstrPos = dep.phaseDep.indexOf("_POOL", 3); + if (poolSubstrPos == -1 && dep.phaseDep != otherPhase->phaseName) continue; bool const skipOnIntraBankAndDifferentBanks = { dep.depType == DependencyType::IntraBank @@ -238,12 +237,15 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: continue; } - if (dep.phaseDep == "NAW") { + // Captures activate window dependencies + if (poolSubstrPos != -1) { if (otherPhase->phaseName == "ACT") { + QString poolName = dep.phaseDep.left(poolSubstrPos); + if (timeDiff == dep.timeValue) { - // Captures only the first (or exactly matching time) ACT in + // Captures only the first (exactly matching time) ACT in // the ACT window as a dependency - tmpPotentialNAW.emplace_back(DBDependencyEntry{ + poolController.push(poolName, DBDependencyEntry{ phase->id, phase->phaseName, PhaseDependency::dependencyTypeName(dep.depType), @@ -253,8 +255,8 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: }); } - if (timeDiff <= dep.timeValue) { - nawCount++; + if (timeDiff < dep.timeValue) { + poolController.increment(poolName); } @@ -289,10 +291,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } - - if (nawCount >= device->getNAW()) { - entries.insert( entries.end(), tmpPotentialNAW.begin(), tmpPotentialNAW.end() ); - } + poolController.merge(entries); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h similarity index 87% rename from DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 5726a6fb..9edfebf0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -40,26 +40,8 @@ #include #include "data/tracedb.h" -#include "dramTimeDependencies/dramtimedependencyfactory.h" - -struct DBPhaseEntry { - size_t id; - QString phaseName; - size_t phaseBegin; - size_t phaseEnd; - size_t transact; - size_t tBank; - size_t tRank; -}; - -struct DBDependencyEntry { - size_t delayedPhaseID; - QString delayedPhaseName; - QString dependencyType; - QString timeDependency; - size_t dependencyPhaseID; - QString dependencyPhaseName; -}; +#include "dramtimedependencyfactory.h" +#include "commonstructures.h" class PhaseDependenciesTracker { public: diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 52ddf73b..0aa87b3e 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -42,7 +42,7 @@ #include "businessObjects/commentmodel.h" #include "businessObjects/configmodels.h" #include "businessObjects/pythoncaller.h" -#include "businessObjects/phasedependenciestracker.h" +#include "businessObjects/dramTimeDependencies/phasedependenciestracker.h" #include "presentation/traceselector.h" #include "qmessagebox.h" #include "queryeditor.h" From 06d083752e5c85abb2f2bf596ff74536eb8e7c85 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 20 Jan 2022 11:59:11 +0100 Subject: [PATCH 091/121] Removed unused variables. --- .../dramTimeDependencies/DDR3TimeDependencies.cpp | 2 -- .../dramTimeDependencies/dramtimedependenciesIF.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index b2d1174a..b1076ae5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -43,8 +43,6 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - nActivateWindow = 4; - mPoolSizes.insert({"FAW", 4}); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h index 016c52e2..4153545c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h @@ -89,7 +89,6 @@ public: static const QJsonObject getMemspec(const TraceDB& tdb, uint& tCK); const uint getClk() const { return tCK; } - const uint getNAW() const { return nActivateWindow; }; const uint getClk() const { return clk; } const uint getNAW() const { return nActivateWindow; }; @@ -108,7 +107,6 @@ protected: virtual DependencyMap mSpecializedGetDependencies() const { DependencyMap map; return map; } ; uint tCK = 0; - uint nActivateWindow = 0; }; From 9ec3e323f6f221ebd2ebd70fe17ded4a9a2bd88e Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 24 Jan 2022 10:41:34 +0100 Subject: [PATCH 092/121] Added using namespace std to dependency source file. --- .../DDR3TimeDependencies.cpp | 120 +++++++++--------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp index b1076ae5..a30f6d2c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp @@ -35,6 +35,8 @@ #include "DDR3TimeDependencies.h" +using namespace std; + DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { mInitializeValues(); } @@ -85,7 +87,7 @@ void DDR3TimeDependencies::mInitializeValues() { } -const std::vector DDR3TimeDependencies::getPossiblePhases() { +const vector DDR3TimeDependencies::getPossiblePhases() { return {"ACT", "RD", "RDA", @@ -107,10 +109,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { DependencyMap dmap; dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("ACT"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ {tRC, "ACT", DependencyType::IntraBank, "tRC"}, {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, @@ -127,10 +129,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("RD"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, @@ -147,10 +149,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("RDA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tWRPRE - tRTP, "WR", DependencyType::IntraBank, "tWRPRE - tRTP"}, {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, @@ -168,10 +170,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("WR"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, @@ -188,10 +190,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("WRA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, @@ -208,10 +210,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PREPB"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, @@ -221,10 +223,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PREAB"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, @@ -236,10 +238,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("REFAB"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ {tRC, "ACT", DependencyType::IntraRank, "tRC"}, {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, @@ -253,10 +255,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDEA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, @@ -269,20 +271,20 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDXA"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ {tPD, "PDEA", DependencyType::IntraRank, "tPD"} } ) ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDEP"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, @@ -296,23 +298,23 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("PDXP"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ {tPD, "PDEP", DependencyType::IntraRank, "tPD"} } ) ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("SREFEN"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ {tRC, "ACT", DependencyType::IntraRank, "tRC"}, - {std::max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, - {std::max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, @@ -323,10 +325,10 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { ); dmap.emplace( - std::piecewise_construct, - std::forward_as_tuple("SREFEX"), - std::forward_as_tuple( - std::initializer_list{ + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} } ) From e3f60933585cb5a8f73e1204211840e0d29ff6b3 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 2 Feb 2022 10:36:37 +0100 Subject: [PATCH 093/121] Started refactoring for dependency calculation skipping. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../activatewindowpoolcontroller.h | 1 - .../dramTimeDependencies/commonstructures.h | 29 +-------------- .../dbEntries/DDR3dbphaseentry.cpp | 33 +++++++++++++++++ .../dbEntries/DDR3dbphaseentry.h | 14 +++++++ .../dbEntries/dbphaseentryIF.h | 22 +++++++++++ .../dramTimeDependencies/dbEntries/includes.h | 5 +++ .../phasedependenciestracker.cpp | 37 ++++--------------- .../phasedependenciestracker.h | 4 +- .../dramTimeDependencies/timedependency.h | 23 ++++++++++++ 10 files changed, 109 insertions(+), 60 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index d2aad098..9a56cd93 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -114,6 +114,7 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h index 1fb349a7..778f1af3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h @@ -37,7 +37,6 @@ #include "commonstructures.h" -// TODO class ActivateWindowPoolController { public: ActivateWindowPoolController(const std::map& poolSizes); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h index 768b49c0..42365aa5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h @@ -45,22 +45,8 @@ #include #include "businessObjects/phases/phasedependency.h" - -class TimeDependency { -public: - TimeDependency() = default; - TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, - QString timeDepName, bool considerIntraRank = false) - : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, - timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} - - size_t timeValue; - QString phaseDep; - DependencyType depType; - QString timeDepName; - bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies - -}; +#include "timedependency.h" +#include "businessObjects/dramTimeDependencies/dbEntries/includes.h" struct PhaseTimeDependencies { explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} @@ -76,17 +62,6 @@ struct QStringsComparator { typedef std::map DependencyMap; - -struct DBPhaseEntry { - size_t id; - QString phaseName; - size_t phaseBegin; - size_t phaseEnd; - size_t transact; - size_t tBank; - size_t tRank; -}; - struct DBDependencyEntry { size_t delayedPhaseID; QString delayedPhaseName; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp new file mode 100644 index 00000000..c58a336e --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp @@ -0,0 +1,33 @@ + +#include "DDR3dbphaseentry.h" + +DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = query.value(1).toString(); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + // tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + }; + + return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h new file mode 100644 index 00000000..fd7b6b99 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "dbphaseentryIF.h" + +class DDR3DBPhaseEntry : public DBPhaseEntryIF { + public: + DDR3DBPhaseEntry(const QSqlQuery&); + + // size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h new file mode 100644 index 00000000..3711cd28 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -0,0 +1,22 @@ + +#pragma once + +#include + +#include "businessObjects/phases/phasedependency.h" +#include "businessObjects/dramTimeDependencies/timedependency.h" + +class DBPhaseEntryIF { + public: + DBPhaseEntryIF() = default; + ~DBPhaseEntryIF() = default; + + virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } + + size_t id; + QString phaseName; + size_t phaseBegin; + size_t phaseEnd; + size_t transact; + size_t tBank; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h new file mode 100644 index 00000000..0fe63cf4 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h @@ -0,0 +1,5 @@ + +#pragma once + +#include "dbphaseentryIF.h" +#include "DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index f9cbb420..1ca19c6b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -120,11 +120,11 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } -const std::vector> +const std::vector> PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector& commands) { - std::vector> phases; + std::vector> phases; - QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TRank " + QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TBankgroup, Transactions.TRank " " FROM Phases " " INNER JOIN Transactions " " ON Phases.Transact=Transactions.ID " @@ -159,16 +159,9 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector(query); - phases[rowIt] = std::make_shared(phase); ++rowIt; } while (query.next()); @@ -182,7 +175,7 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { +PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { std::vector entries; entries.reserve((size_t) (0.4 * phases.size())); @@ -198,8 +191,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: // Auxiliary variables const auto& phase = phases[i]; - const size_t cmdBank = phase->tBank; - const size_t cmdRank = phase->tRank; // Get time dependency descriptions for the current phase const auto& deps = deviceDependencies.at(phase->phaseName); @@ -219,21 +210,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: int poolSubstrPos = dep.phaseDep.indexOf("_POOL", 3); if (poolSubstrPos == -1 && dep.phaseDep != otherPhase->phaseName) continue; - bool const skipOnIntraBankAndDifferentBanks = { - dep.depType == DependencyType::IntraBank - && cmdBank != otherPhase->tBank - }; - bool const skipOnIntraRankAndDifferentRanks = { - dep.depType == DependencyType::IntraRank - && cmdRank != otherPhase->tRank - }; - bool const skipOnInterRankAndSameRank = { - dep.depType == DependencyType::InterRank - && cmdRank == otherPhase->tRank - && !dep.considerIntraRank - }; - - if (skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank) { + if (!phase->potentialDependency(dep, otherPhase)) { continue; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 9edfebf0..074c5503 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -52,8 +52,8 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); + static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h new file mode 100644 index 00000000..f012353f --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h @@ -0,0 +1,23 @@ + +#pragma once + +#include + +#include "businessObjects/phases/phasedependency.h" + +class TimeDependency { +public: + TimeDependency() = default; + TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, + QString timeDepName, bool considerIntraRank = false) + : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, + timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + + size_t timeValue; + QString phaseDep; + DependencyType depType; + QString timeDepName; + bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + +}; + From b0a22ba1339affa9e18e6dc873f10b791d4b8990 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 2 Feb 2022 11:51:10 +0100 Subject: [PATCH 094/121] Organizing files. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 8 ++++---- .../{commonstructures.h => common/common.h} | 4 ++-- .../dramTimeDependencies/{ => common}/timedependency.h | 5 +---- .../dramTimeDependencies/dbEntries/dbphaseentryIF.h | 2 +- .../dbEntries/{includes.h => dbphaseentryTypes.h} | 0 .../{ => devices}/DDR3TimeDependencies.cpp | 0 .../{ => devices}/DDR3TimeDependencies.h | 0 .../{ => devices}/activatewindowpoolcontroller.cpp | 0 .../{ => devices}/activatewindowpoolcontroller.h | 2 +- .../{ => devices}/dramtimedependenciesIF.cpp | 0 .../{ => devices}/dramtimedependenciesIF.h | 0 .../{ => devices}/dramtimedependencyfactory.cpp | 0 .../{ => devices}/dramtimedependencyfactory.h | 0 .../dramTimeDependencies/phasedependenciestracker.cpp | 3 ++- .../dramTimeDependencies/phasedependenciestracker.h | 4 ++-- 15 files changed, 13 insertions(+), 15 deletions(-) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{commonstructures.h => common/common.h} (96%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => common}/timedependency.h (91%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{includes.h => dbphaseentryTypes.h} (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/DDR3TimeDependencies.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/DDR3TimeDependencies.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/activatewindowpoolcontroller.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/activatewindowpoolcontroller.h (97%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependenciesIF.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependenciesIF.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependencyfactory.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{ => devices}/dramtimedependencyfactory.h (100%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 9a56cd93..e3bfe98f 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -112,11 +112,11 @@ add_executable(TraceAnalyzer simulationdialog.cpp businessObjects/dependencymodels.cpp - businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp - businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp - businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp + businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp + businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h similarity index 96% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index 42365aa5..e0edd71d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/commonstructures.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -46,7 +46,7 @@ #include "businessObjects/phases/phasedependency.h" #include "timedependency.h" -#include "businessObjects/dramTimeDependencies/dbEntries/includes.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h" struct PhaseTimeDependencies { explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} @@ -69,4 +69,4 @@ struct DBDependencyEntry { QString timeDependency; size_t dependencyPhaseID; QString dependencyPhaseName; -}; +}; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h similarity index 91% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h index f012353f..85de5e7b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/timedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h @@ -3,8 +3,6 @@ #include -#include "businessObjects/phases/phasedependency.h" - class TimeDependency { public: TimeDependency() = default; @@ -19,5 +17,4 @@ public: QString timeDepName; bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies -}; - +}; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index 3711cd28..4b342b09 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -4,7 +4,7 @@ #include #include "businessObjects/phases/phasedependency.h" -#include "businessObjects/dramTimeDependencies/timedependency.h" +#include "businessObjects/dramTimeDependencies/common/common.h" class DBPhaseEntryIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/includes.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/DDR3TimeDependencies.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h similarity index 97% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h index 778f1af3..1c2aced7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/activatewindowpoolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h @@ -35,7 +35,7 @@ #pragma once -#include "commonstructures.h" +#include "businessObjects/dramTimeDependencies/common/common.h" class ActivateWindowPoolController { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dramtimedependencyfactory.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 1ca19c6b..58f2a650 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -215,7 +215,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } // Captures activate window dependencies - if (poolSubstrPos != -1) { + if (poolSubstrPos != -1) { if (otherPhase->phaseName == "ACT") { QString poolName = dep.phaseDep.left(poolSubstrPos); @@ -255,6 +255,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } + // Capture command bus dependencies if (timeDiff == device->getClk()) { entries.emplace_back(DBDependencyEntry{ phase->id, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 074c5503..0a552abe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -40,8 +40,8 @@ #include #include "data/tracedb.h" -#include "dramtimedependencyfactory.h" -#include "commonstructures.h" +#include "devices/dramtimedependencyfactory.h" +#include "common/common.h" class PhaseDependenciesTracker { public: From a9e3f54bd386d45daa0a5f73bd81c9936e0c6ead Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 4 Feb 2022 09:36:47 +0100 Subject: [PATCH 095/121] Finished refactoring. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 10 ++-- .../configurations/DDR3Configuration.cpp | 11 ++++ .../configurations/DDR3Configuration.h | 14 +++++ .../configurations/configurationIF.cpp | 53 +++++++++++++++++++ .../configurations/configurationIF.h | 29 ++++++++++ .../configurationfactory.cpp} | 31 +++++------ .../configurationfactory.h} | 12 ++--- .../dbEntries/dbphaseentryIF.h | 2 +- .../DDR3TimeDependencies.cpp | 0 .../DDR3TimeDependencies.h | 0 .../activatewindowpoolcontroller.cpp | 0 .../activatewindowpoolcontroller.h | 0 .../dramtimedependenciesIF.cpp | 16 ------ .../dramtimedependenciesIF.h | 2 - .../phasedependenciestracker.cpp | 26 ++++----- .../phasedependenciestracker.h | 6 +-- DRAMSys/traceAnalyzer/tracefiletab.cpp | 4 +- 17 files changed, 152 insertions(+), 64 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices/dramtimedependencyfactory.cpp => configurations/configurationfactory.cpp} (67%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices/dramtimedependencyfactory.h => configurations/configurationfactory.h} (87%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/DDR3TimeDependencies.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/DDR3TimeDependencies.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/activatewindowpoolcontroller.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/activatewindowpoolcontroller.h (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/dramtimedependenciesIF.cpp (92%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/{devices => deviceDependencies}/dramtimedependenciesIF.h (98%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index e3bfe98f..7bf8a772 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -113,10 +113,12 @@ add_executable(TraceAnalyzer businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp - businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp - businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp + businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp + businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp + businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp + businessObjects/dramTimeDependencies/configurations/configurationIF.cpp + businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp new file mode 100644 index 00000000..d9ab5d36 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp @@ -0,0 +1,11 @@ + +#include "DDR3Configuration.h" + +DDR3Configuration::DDR3Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr DDR3Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h new file mode 100644 index 00000000..f1e64fa2 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h" +#include "businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h" + +class DDR3Configuration : public ConfigurationIF { + public: + DDR3Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp new file mode 100644 index 00000000..a2fb31e5 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp @@ -0,0 +1,53 @@ + +#include "configurationIF.h" + +const uint ConfigurationIF::getClk() const { + if (!mDeviceDeps) + throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getClk'."); + + return mDeviceDeps->getClk(); +} + +DependencyMap ConfigurationIF::getDependencies(std::vector& commands) const { + if (!mDeviceDeps) + throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getDependencies'."); + + return mDeviceDeps->getDependencies(commands); +} + +ActivateWindowPoolController ConfigurationIF::getAWPools() const { + if (!mDeviceDeps) + throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getAWPools'."); + + return mDeviceDeps->getAWPools(); +} + +const QString ConfigurationIF::getDeviceName(const TraceDB& tdb) { + return mGetMemspec(tdb)["memoryType"].toString(); +} + +const uint ConfigurationIF::mGetClk(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT clk FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + uint clock = sqlQuery.value(0).toLongLong(); + sqlQuery.finish(); + + return clock; +} + +const QJsonObject ConfigurationIF::mGetMemspec(const TraceDB& tdb) { + QSqlDatabase db = tdb.getDatabase(); + QString query = "SELECT Memspec FROM GeneralInfo"; + QSqlQuery sqlQuery = db.exec(query); + + sqlQuery.next(); + QString memSpecJson = sqlQuery.value(0).toString(); + sqlQuery.finish(); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); + + return jsonDocument.object()["memspec"].toObject(); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h new file mode 100644 index 00000000..26563123 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h @@ -0,0 +1,29 @@ + +#pragma once + +#include + +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class ConfigurationIF { + public: + ConfigurationIF() {}; + virtual ~ConfigurationIF() = default; + + virtual std::shared_ptr makePhaseEntry(const QSqlQuery&) const { return nullptr; } + + // Delegated methods + const uint getClk() const; + DependencyMap getDependencies(std::vector& commands) const; + ActivateWindowPoolController getAWPools() const; + + static const QString getDeviceName(const TraceDB& tdb); + + protected: + std::shared_ptr mDeviceDeps = nullptr; + + static const uint mGetClk(const TraceDB& tdb); + static const QJsonObject mGetMemspec(const TraceDB& tdb); + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp similarity index 67% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 0377fe3b..154e18e0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -33,46 +33,41 @@ * Iron Prando da Silva */ -#include "dramtimedependencyfactory.h" +#include "configurationfactory.h" -std::shared_ptr DRAMTimeDependencyFactory::make(const TraceDB& tdb) { - uint clk = 0; - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); - QString deviceType = memspec["memoryType"].toString(); +std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) { + const QString deviceName = ConfigurationIF::getDeviceName(tdb); - if (deviceType == "DDR3") { - return std::make_shared(memspec, clk); + if (deviceName == "DDR3") { + return std::make_shared(tdb); } else { // TODO maybe throw? - throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); } } -const std::vector DRAMTimeDependencyFactory::possiblePhases(const TraceDB& tdb) { - uint clk; // Not used - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); - QString deviceType = memspec["memoryType"].toString(); +const std::vector ConfigurationFactory::possiblePhases(const TraceDB& tdb) { + const QString deviceName = ConfigurationIF::getDeviceName(tdb); - if (deviceType == "DDR3") { + if (deviceName == "DDR3") { return DDR3TimeDependencies::getPossiblePhases(); } else { // TODO maybe throw? - throw std::invalid_argument("Could not find the device type '" + deviceType.toStdString() + '\''); + throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); } } -bool DRAMTimeDependencyFactory::deviceSupported(const TraceDB& tdb) { +bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { uint clk; // Not used - const QJsonObject& memspec = DRAMTimeDependenciesIF::getMemspec(tdb, clk); - QString deviceType = memspec["memoryType"].toString(); + const QString deviceName = ConfigurationIF::getDeviceName(tdb); - if (deviceType == "DDR3") { + if (deviceName == "DDR3") { return true; } else { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h similarity index 87% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index 566d378b..f732e83b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependencyfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -37,19 +37,19 @@ #include -#include "dramtimedependenciesIF.h" -#include "DDR3TimeDependencies.h" +#include "configurationIF.h" +#include "DDR3Configuration.h" #include "data/tracedb.h" -class DRAMTimeDependencyFactory { +class ConfigurationFactory { public: - static std::shared_ptr make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); static const std::vector possiblePhases(const TraceDB& tdb); static bool deviceSupported(const TraceDB& tdb); private: - DRAMTimeDependencyFactory() = delete; - ~DRAMTimeDependencyFactory() = delete; + ConfigurationFactory() = delete; + ~ConfigurationFactory() = delete; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index 4b342b09..d86593c1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -9,7 +9,7 @@ class DBPhaseEntryIF { public: DBPhaseEntryIF() = default; - ~DBPhaseEntryIF() = default; + virtual ~DBPhaseEntryIF() = default; virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/DDR3TimeDependencies.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/activatewindowpoolcontroller.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp similarity index 92% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index c101f468..133b5655 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -73,22 +73,6 @@ ActivateWindowPoolController DRAMTimeDependenciesIF::getAWPools() const { return ActivateWindowPoolController(mPoolSizes); } -const QJsonObject DRAMTimeDependenciesIF::getMemspec(const TraceDB& tdb, uint& tCK) { - QSqlDatabase db = tdb.getDatabase(); - QString query = "SELECT clk, Memspec FROM GeneralInfo"; - QSqlQuery sqlQuery = db.exec(query); - - sqlQuery.next(); - tCK = sqlQuery.value(0).toInt(); - QString memSpecJson = sqlQuery.value(1).toString(); - sqlQuery.finish(); - - QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8()); - - return jsonDocument.object()["memspec"].toObject(); - -} - void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h similarity index 98% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h index 4153545c..1e0d2178 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/devices/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h @@ -86,8 +86,6 @@ public: DependencyMap getDependencies(std::vector& dependencyFilter) const; - static const QJsonObject getMemspec(const TraceDB& tdb, uint& tCK); - const uint getClk() const { return tCK; } const uint getClk() const { return clk; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 58f2a650..5272d774 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -37,15 +37,17 @@ void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { + auto deviceConfig = ConfigurationFactory::make(tdb); + mBeginTransaction(tdb); mDropTable(tdb); - if (commands.size() > 0) { - auto& phases = mGetFilteredPhases(tdb, commands); + if (commands.size() > 0) { + auto& phases = mGetFilteredPhases(deviceConfig, tdb, commands); if (phases.size() != 0) { - auto& entries = mCalculateDependencies(tdb, phases, commands); + auto& entries = mCalculateDependencies(deviceConfig, phases, commands); if (entries.size() > 0) { mCreateTable(tdb); @@ -121,7 +123,7 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } const std::vector> -PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector& commands) { +PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr deviceConfig, TraceDB& tdb, const std::vector& commands) { std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TBankgroup, Transactions.TRank " @@ -160,7 +162,7 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector(query); + phases[rowIt] = deviceConfig->makePhaseEntry(query); ++rowIt; } while (query.next()); @@ -175,22 +177,22 @@ PhaseDependenciesTracker::mGetFilteredPhases(TraceDB& tdb, const std::vector -PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands) { +PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr deviceConfig, const std::vector>& phases, std::vector& commands) { std::vector entries; entries.reserve((size_t) (0.4 * phases.size())); - // Get dependencies for tdb device - auto device = DRAMTimeDependencyFactory::make(tdb); - DependencyMap deviceDependencies = device->getDependencies(commands); + // Get dependencies for device + DependencyMap deviceDependencies = deviceConfig->getDependencies(commands); // Tries to find all timing dependencies for each phase on the trace - ActivateWindowPoolController poolController = device->getAWPools(); + ActivateWindowPoolController poolController = deviceConfig->getAWPools(); for (size_t i = 1; i < phases.size(); i++) { // NAW dependencies variables reset poolController.clear(); // Auxiliary variables - const auto& phase = phases[i]; + const auto phase = phases[i]; + if (phase == nullptr) continue; // Get time dependency descriptions for the current phase const auto& deps = deviceDependencies.at(phase->phaseName); @@ -256,7 +258,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const TraceDB& tdb, const std:: } // Capture command bus dependencies - if (timeDiff == device->getClk()) { + if (timeDiff == deviceConfig->getClk()) { entries.emplace_back(DBDependencyEntry{ phase->id, phase->phaseName, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index 0a552abe..b4ce10bf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -40,7 +40,7 @@ #include #include "data/tracedb.h" -#include "devices/dramtimedependencyfactory.h" +#include "configurations/configurationfactory.h" #include "common/common.h" class PhaseDependenciesTracker { @@ -52,8 +52,8 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetFilteredPhases(TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const TraceDB& tdb, const std::vector>& phases, std::vector& commands); + static const std::vector> mGetFilteredPhases(const std::shared_ptr, TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::shared_ptr, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 0aa87b3e..23e61f20 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -193,7 +193,7 @@ void TraceFileTab::setUpCommentView() } void TraceFileTab::setUpPossiblePhases() { - const auto possiblePhases = DRAMTimeDependencyFactory::possiblePhases(navigator->TraceFile()); + const auto possiblePhases = ConfigurationFactory::possiblePhases(navigator->TraceFile()); for (auto p : possiblePhases) { auto item = new QListWidgetItem(p, ui->depTabPossiblePhases); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag @@ -201,7 +201,7 @@ void TraceFileTab::setUpPossiblePhases() { } - ui->calculateDependencies->setEnabled(DRAMTimeDependencyFactory::deviceSupported(navigator->TraceFile())); + ui->calculateDependencies->setEnabled(ConfigurationFactory::deviceSupported(navigator->TraceFile())); } void TraceFileTab::tracefileChanged() From 8ad9cb05f7f0a934345e992aa536fbf7f3d5f29d Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 15 Feb 2022 09:51:21 +0100 Subject: [PATCH 096/121] Added more DependencyType enumerators. --- .../phasedependenciestracker.cpp | 10 ++++++---- .../businessObjects/phases/phasedependency.cpp | 15 +++++++++++++++ .../businessObjects/phases/phasedependency.h | 7 ++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 5272d774..6f99fab5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -216,11 +216,13 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName)) { if (otherPhase->phaseName == "ACT") { - QString poolName = dep.phaseDep.left(poolSubstrPos); - if (timeDiff == dep.timeValue) { // Captures only the first (exactly matching time) ACT in // the ACT window as a dependency diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index de6c65ff..0cd7ec0e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -136,12 +136,27 @@ QString PhaseDependency::dependencyTypeName(DependencyType dtype) { case IntraBank: return "IntraBank"; + case IntraBankGroup: + return "IntraBankGroup"; + case IntraRank: return "IntraRank"; + case IntraLogicalRank: + return "IntraLogicalRank"; + + case IntraPhysicalRank: + return "IntraPhysicalRank"; + + case IntraDIMMRank: + return "IntraDIMMRank"; + case InterRank: return "InterRank"; + case InterDIMMRank: + return "InterDIMMRank"; + default: // TODO - maybe throw? return ""; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index 439f973c..a29a67dd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -49,8 +49,13 @@ class Phase; enum DependencyType { IntraBank, + IntraBankGroup, IntraRank, - InterRank + IntraLogicalRank, + IntraPhysicalRank, + IntraDIMMRank, + InterRank, + InterDIMMRank, }; class PhaseDependency From 8c3f4349ba3bfc50fd3a1fb63881cbcb5ed26c8c Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 15 Feb 2022 10:45:54 +0100 Subject: [PATCH 097/121] Refactored PoolControllerMap. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 +- .../dramTimeDependencies/common/common.cpp | 10 ++++ .../dramTimeDependencies/common/common.h | 1 + .../configurations/configurationIF.cpp | 4 +- .../configurations/configurationIF.h | 2 +- .../DDR3TimeDependencies.cpp | 2 +- .../dramtimedependenciesIF.cpp | 12 +---- .../deviceDependencies/poolcontroller.cpp | 47 +++++++++++++++++++ .../deviceDependencies/poolcontroller.h | 26 ++++++++++ ...olcontroller.cpp => poolcontrollermap.cpp} | 45 +++++++++--------- ...owpoolcontroller.h => poolcontrollermap.h} | 14 +++--- .../phasedependenciestracker.cpp | 11 ++--- 12 files changed, 128 insertions(+), 50 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{activatewindowpoolcontroller.cpp => poolcontrollermap.cpp} (67%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{activatewindowpoolcontroller.h => poolcontrollermap.h} (80%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 7bf8a772..75c6b2b3 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -112,8 +112,10 @@ add_executable(TraceAnalyzer simulationdialog.cpp businessObjects/dependencymodels.cpp + businessObjects/dramTimeDependencies/common/common.cpp businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp + businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp + businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp new file mode 100644 index 00000000..856ca631 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp @@ -0,0 +1,10 @@ + +#include "common.h" + +bool QStringsComparator::operator()(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} + +bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { + return s1.compare(s2) < 0; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index e0edd71d..689da366 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -39,6 +39,7 @@ #include #include +#include #include #include #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp index a2fb31e5..35c96028 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp @@ -15,11 +15,11 @@ DependencyMap ConfigurationIF::getDependencies(std::vector& commands) c return mDeviceDeps->getDependencies(commands); } -ActivateWindowPoolController ConfigurationIF::getAWPools() const { +PoolControllerMap ConfigurationIF::getPools() const { if (!mDeviceDeps) throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getAWPools'."); - return mDeviceDeps->getAWPools(); + return mDeviceDeps->getPools(); } const QString ConfigurationIF::getDeviceName(const TraceDB& tdb) { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h index 26563123..38595563 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h @@ -16,7 +16,7 @@ class ConfigurationIF { // Delegated methods const uint getClk() const; DependencyMap getDependencies(std::vector& commands) const; - ActivateWindowPoolController getAWPools() const; + PoolControllerMap getPools() const; static const QString getDeviceName(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp index a30f6d2c..143ce25f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp @@ -45,7 +45,7 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPoolSizes.insert({"FAW", 4}); + mPools.insert({"FAW", {4, {"ACT"}}}); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index 133b5655..0528d8d6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -69,8 +69,8 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -ActivateWindowPoolController DRAMTimeDependenciesIF::getAWPools() const { - return ActivateWindowPoolController(mPoolSizes); +PoolControllerMap DRAMTimeDependenciesIF::getPools() const { + return PoolControllerMap(mPools); } void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { @@ -172,11 +172,3 @@ uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vectortimeValue; } - -bool QStringsComparator::operator()(const QString& s1, const QString& s2) { - return s1.compare(s2) < 0; -} - -bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { - return s1.compare(s2) < 0; -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp new file mode 100644 index 00000000..b86d5aef --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -0,0 +1,47 @@ + +#include "poolcontroller.h" +#include + +PoolController::PoolController(const uint poolSize, const std::vector& dependencies) +: mDependencies(mAuxSortInput(dependencies)) +{ + mPoolSize = poolSize; + +} + +void PoolController::clear() { + mPool.clear(); + mCount = 0; + +} + +void PoolController::push(DBDependencyEntry dep) { + mPool.push_back(dep); + mCount++; + +} + +void PoolController::increment() { + mCount++; +} + +void PoolController::merge(std::vector& depEntries) { + if(mCount >= mPoolSize) { + depEntries.insert( depEntries.end(), mPool.begin(), mPool.end() ); + } +} + +bool PoolController::isDependency(const QString& phaseName) { + return std::binary_search( + mDependencies.begin(), + mDependencies.end(), + phaseName, + QStringsComparator::compareQStrings + ); +} + +std::vector PoolController::mAuxSortInput(std::vector vec) { + std::sort(vec.begin(), vec.end(), QStringsComparator::compareQStrings); + + return vec; +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h new file mode 100644 index 00000000..7a6cf713 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -0,0 +1,26 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/common/common.h" + +class PoolController { +public: + PoolController(const uint poolSize, const std::vector& dependencies); + ~PoolController() = default; + + void clear(); + void push(DBDependencyEntry); + void increment(); + void merge(std::vector& depEntries); + + bool isDependency(const QString& phaseName); + +protected: + const std::vector mDependencies; + std::vector mPool; + uint mCount = 0; + uint mPoolSize = 0; + +protected: + static std::vector mAuxSortInput(std::vector vec); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp similarity index 67% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index e8961b4a..a16dd6c6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -33,52 +33,53 @@ * Iron Prando da Silva */ -#include "activatewindowpoolcontroller.h" - -ActivateWindowPoolController::ActivateWindowPoolController(const std::map& poolSizes) { - mPoolSizes = poolSizes; - - for (const auto& p : poolSizes) { - mPools.insert({p.first, {}}); - mCounts.insert({p.first, 0}); - mPools[p.first].reserve(32); - } +#include "poolcontrollermap.h" +PoolControllerMap::PoolControllerMap(const std::map& pools) { + mPools = pools; } -void ActivateWindowPoolController::clear() { +void PoolControllerMap::clear() { for (auto& p : mPools) { p.second.clear(); - mCounts[p.first] = 0; } } -void ActivateWindowPoolController::push(const QString& poolName, DBDependencyEntry dep) { +void PoolControllerMap::push(const QString& poolName, DBDependencyEntry dep) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { - pool->second.push_back(dep); - mCounts[poolName]++; + pool->second.push(dep); } else { // TODO throw? } } -void ActivateWindowPoolController::increment(const QString& poolName) { +void PoolControllerMap::increment(const QString& poolName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { - mCounts[poolName]++; + pool->second.increment(); } else { // TODO throw? } } -void ActivateWindowPoolController::merge(std::vector& depEntries) { - for (const auto& p : mPools) { - if(mCounts[p.first] >= mPoolSizes[p.first]) { - depEntries.insert( depEntries.end(), p.second.begin(), p.second.end() ); - } +void PoolControllerMap::merge(std::vector& depEntries) { + for (auto& p : mPools) { + p.second.merge(depEntries); + } +} + +bool PoolControllerMap::isDependency(const QString& poolName, const QString& phaseName) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + return pool->second.isDependency(phaseName); + + } else { + // TODO throw? + return false; + } } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h similarity index 80% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index 1c2aced7..0de8d5f9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/activatewindowpoolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -35,21 +35,21 @@ #pragma once -#include "businessObjects/dramTimeDependencies/common/common.h" +#include "poolcontroller.h" -class ActivateWindowPoolController { +class PoolControllerMap { public: - ActivateWindowPoolController(const std::map& poolSizes); - ~ActivateWindowPoolController() = default; + PoolControllerMap(const std::map& pools); + ~PoolControllerMap() = default; void clear(); void push(const QString& poolName, DBDependencyEntry); void increment(const QString& poolName); void merge(std::vector& depEntries); + bool isDependency(const QString& poolName, const QString& phaseName); + protected: - std::map, QStringsComparator> mPools; - std::map mCounts; - std::map mPoolSizes; + std::map mPools; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 6f99fab5..2590518b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -185,7 +185,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetDependencies(commands); // Tries to find all timing dependencies for each phase on the trace - ActivateWindowPoolController poolController = deviceConfig->getAWPools(); + PoolControllerMap poolController = deviceConfig->getPools(); for (size_t i = 1; i < phases.size(); i++) { // NAW dependencies variables reset poolController.clear(); @@ -220,12 +220,10 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName)) { - if (otherPhase->phaseName == "ACT") { + if (poolController.isDependency(poolName, otherPhase->phaseName)) { if (timeDiff == dep.timeValue) { - // Captures only the first (exactly matching time) ACT in - // the ACT window as a dependency + // Captures only the first (exactly matching time) phase in + // the pool window as a dependency poolController.push(poolName, DBDependencyEntry{ phase->id, phase->phaseName, @@ -259,6 +257,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetClk()) { entries.emplace_back(DBDependencyEntry{ From 7e7b2097f99b1810b96e8da8399059b3bbb61e75 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 16 Feb 2022 10:55:57 +0100 Subject: [PATCH 098/121] Refactoring and command bus pooling. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 8 ++- .../configurations/configurationfactory.h | 2 +- .../{ => specialized}/DDR3Configuration.cpp | 0 .../{ => specialized}/DDR3Configuration.h | 6 +- .../dbEntries/dbphaseentryTypes.h | 2 +- .../{ => specialized}/DDR3dbphaseentry.cpp | 3 + .../{ => specialized}/DDR3dbphaseentry.h | 2 +- .../DDR3TimeDependencies.cpp | 64 ++++++++++++++----- .../{ => specialized}/DDR3TimeDependencies.h | 2 +- .../phasedependenciestracker.cpp | 15 +---- 10 files changed, 65 insertions(+), 39 deletions(-) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{ => specialized}/DDR3Configuration.cpp (100%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{ => specialized}/DDR3Configuration.h (56%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{ => specialized}/DDR3dbphaseentry.cpp (94%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{ => specialized}/DDR3dbphaseentry.h (79%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{ => specialized}/DDR3TimeDependencies.cpp (88%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{ => specialized}/DDR3TimeDependencies.h (96%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 75c6b2b3..4306349e 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -113,14 +113,16 @@ add_executable(TraceAnalyzer businessObjects/dependencymodels.cpp businessObjects/dramTimeDependencies/common/common.cpp - businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/configurations/configurationIF.cpp - businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp + + businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp + businessObjects/dramTimeDependencies/phasedependenciestracker.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index f732e83b..d3d4fb08 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -38,7 +38,7 @@ #include #include "configurationIF.h" -#include "DDR3Configuration.h" +#include "specialized/DDR3Configuration.h" #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp similarity index 100% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h similarity index 56% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index f1e64fa2..c25dd87b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -1,9 +1,9 @@ #pragma once -#include "configurationIF.h" -#include "businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h" -#include "businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" class DDR3Configuration : public ConfigurationIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h index 0fe63cf4..1a809fa7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h @@ -2,4 +2,4 @@ #pragma once #include "dbphaseentryIF.h" -#include "DDR3dbphaseentry.h" +#include "specialized/DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp similarity index 94% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index c58a336e..c2ef1dde 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -16,6 +16,8 @@ bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; + bool isCmdPool = dep.phaseDep == "CMD_BUS_POOL"; + bool const skipOnIntraBankAndDifferentBanks = { dep.depType == DependencyType::IntraBank && tBank != other->tBank @@ -27,6 +29,7 @@ bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: bool const skipOnInterRankAndSameRank = { dep.depType == DependencyType::InterRank && tRank == other->tRank + && !isCmdPool }; return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h similarity index 79% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h index fd7b6b99..b312e59f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/DDR3dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h @@ -1,7 +1,7 @@ #pragma once -#include "dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" class DDR3DBPhaseEntry : public DBPhaseEntryIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp similarity index 88% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index 143ce25f..eb9d0638 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -45,7 +45,27 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({"FAW", {4, {"ACT"}}}); + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + } + } + }); + mPools.insert({"NAW", {4, {"ACT"}}}); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); @@ -123,7 +143,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tFAW, "FAW_POOL", DependencyType::IntraRank, "tFAW"} + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tFAW, "NAW_POOL", DependencyType::IntraRank, "tFAW"}, } ) ); @@ -143,7 +164,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, - {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -164,7 +186,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, - {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"} + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -184,7 +207,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, - {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -204,7 +228,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, - {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"} + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -217,7 +242,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, - {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -232,7 +258,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, - {tXP, "PDXA", DependencyType::IntraRank, "tXP"} + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -249,7 +276,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -265,7 +293,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, - {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"} + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -275,7 +304,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple("PDXA"), forward_as_tuple( initializer_list{ - {tPD, "PDEA", DependencyType::IntraRank, "tPD"} + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -292,7 +322,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -302,7 +333,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple("PDXP"), forward_as_tuple( initializer_list{ - {tPD, "PDEP", DependencyType::IntraRank, "tPD"} + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -319,7 +351,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, - {tXS, "SREFEX", DependencyType::IntraRank, "tXS"} + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -329,7 +362,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple("SREFEX"), forward_as_tuple( initializer_list{ - {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"} + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h similarity index 96% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h index 8aff95e9..1d7f777e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h @@ -35,7 +35,7 @@ #pragma once -#include "dramtimedependenciesIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" class DDR3TimeDependencies final : public DRAMTimeDependenciesIF { public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 2590518b..7d05ae65 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -187,7 +187,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetPools(); for (size_t i = 1; i < phases.size(); i++) { - // NAW dependencies variables reset + // Pool dependencies variables reset poolController.clear(); // Auxiliary variables @@ -257,19 +257,6 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetClk()) { - entries.emplace_back(DBDependencyEntry{ - phase->id, - phase->phaseName, - PhaseDependency::dependencyTypeName(DependencyType::InterRank), - "CommandBus", - otherPhase->id, - otherPhase->phaseName - }); - } - } poolController.merge(entries); From bf1641e80ad205eb9138bf54d2c962a956a65b3a Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 16 Feb 2022 11:27:49 +0100 Subject: [PATCH 099/121] Corrected dependency drawing of PREAB and REFA. --- .../traceAnalyzer/businessObjects/phases/phase.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp index 7ce91e98..5fb94d63 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phase.cpp @@ -71,16 +71,12 @@ void Phase::draw(QPainter *painter, const QwtScaleMap &xMap, drawPhaseSymbol(span.Begin(), span.End(), line->getYVal(), drawingProperties.drawText, getPhaseSymbol(), painter, xMap, yMap, drawingProperties.textColor); - if (getGranularity() == Granularity::Bankwise) + DependencyOptions drawDependenciesOptions = drawingProperties.drawDependenciesOption; + if (drawDependenciesOptions.draw == DependencyOption::All || + (drawDependenciesOptions.draw == DependencyOption::Selected && highlight)) { - - DependencyOptions drawDependenciesOptions = drawingProperties.drawDependenciesOption; - if (drawDependenciesOptions.draw == DependencyOption::All || - (drawDependenciesOptions.draw == DependencyOption::Selected && highlight)) - { - drawPhaseDependencies(span.Begin(), span.End(), line->getYVal(), drawingProperties, painter, xMap, - yMap); - } + drawPhaseDependencies(span.Begin(), span.End(), line->getYVal(), drawingProperties, painter, xMap, + yMap); } } } From b2581bbce3cd99a360a7159d919f697369195953 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 1 Mar 2022 11:57:23 +0100 Subject: [PATCH 100/121] Refactored string comparisons out of the main loop. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 3 +- .../{common.cpp => QStringComparator.cpp} | 6 +- .../common/QStringComparator.h | 9 ++ .../common/StringMapper.cpp | 109 ++++++++++++++++++ .../common/StringMapper.h | 66 +++++++++++ .../dramTimeDependencies/common/common.h | 7 +- .../common/timedependency.h | 7 +- .../dbEntries/dbphaseentryIF.h | 2 +- .../specialized/DDR3dbphaseentry.cpp | 4 +- .../dramtimedependenciesIF.cpp | 29 ++--- .../deviceDependencies/poolcontroller.cpp | 12 +- .../deviceDependencies/poolcontroller.h | 8 +- .../deviceDependencies/poolcontrollermap.cpp | 8 +- .../deviceDependencies/poolcontrollermap.h | 10 +- .../specialized/DDR3TimeDependencies.cpp | 30 ++--- .../phasedependenciestracker.cpp | 23 ++-- 16 files changed, 257 insertions(+), 76 deletions(-) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/{common.cpp => QStringComparator.cpp} (80%) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 4306349e..7d7667ae 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -112,7 +112,8 @@ add_executable(TraceAnalyzer simulationdialog.cpp businessObjects/dependencymodels.cpp - businessObjects/dramTimeDependencies/common/common.cpp + businessObjects/dramTimeDependencies/common/QStringComparator.cpp + businessObjects/dramTimeDependencies/common/StringMapper.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp similarity index 80% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp index 856ca631..a56a891c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp @@ -1,10 +1,10 @@ -#include "common.h" +#include "QStringComparator.h" -bool QStringsComparator::operator()(const QString& s1, const QString& s2) { +bool QStringsComparator::operator()(const QString& s1, const QString& s2) const { return s1.compare(s2) < 0; } bool QStringsComparator::compareQStrings(const QString& s1, const QString& s2) { return s1.compare(s2) < 0; -} +} \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h new file mode 100644 index 00000000..4f6fc913 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h @@ -0,0 +1,9 @@ + +#pragma once + +#include + +struct QStringsComparator { + bool operator()(const QString& s1, const QString& s2) const; + static bool compareQStrings(const QString& s1, const QString& s2); +}; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp new file mode 100644 index 00000000..ddc0cfe3 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -0,0 +1,109 @@ + +#include "StringMapper.h" + +StringMapper::StringMapper(const QString& name) { + mIDEnum = getIDEnum(name); + mIDStr = name; + mIsPool = mAuxIsPool(mIDEnum); + +} + +QString StringMapper::getIDStr(StringMapper::Identifier id) { + static const std::map enumToStr { + {StringMapper::Identifier::CMD_BUS, "CMD_BUS"}, + {StringMapper::Identifier::NAW, "NAW"}, + {StringMapper::Identifier::FAW, "FAW"}, + {StringMapper::Identifier::_32AW, "32AW"}, + {StringMapper::Identifier::FAW_LOGICAL, "FAW_LOGICAL"}, + {StringMapper::Identifier::FAW_PHYSICAL, "FAW_PHYSICAL"}, + {StringMapper::Identifier::REFAB, "REFAB"}, + {StringMapper::Identifier::PREAB, "PREAB"}, + {StringMapper::Identifier::PDEP, "PDEP"}, + {StringMapper::Identifier::PDXP, "PDXP"}, + {StringMapper::Identifier::SREFEN, "SREFEN"}, + {StringMapper::Identifier::SREFEX, "SREFEX"}, + {StringMapper::Identifier::PDEA, "PDEA"}, + {StringMapper::Identifier::PDXA, "PDXA"}, + {StringMapper::Identifier::SRPDEN, "SRPDEN"}, + {StringMapper::Identifier::SRPDEX, "SRPDEX"}, + {StringMapper::Identifier::ACT, "ACT"}, + {StringMapper::Identifier::RD, "RD"}, + {StringMapper::Identifier::WR, "WR"}, + {StringMapper::Identifier::PREPB, "PREPB"}, + {StringMapper::Identifier::RDA, "RDA"}, + {StringMapper::Identifier::WRA, "WRA"}, + {StringMapper::Identifier::REFPB, "REFPB"}, + }; + + auto it = enumToStr.find(id); + if (it != enumToStr.end()) return it->second; + else throw std::invalid_argument("The provided StringMapper::StringMapper::Identifier is not valid."); + +} + +StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { + static const std::map strToEnum { + {"CMD_BUS", StringMapper::Identifier::CMD_BUS}, + {"NAW", StringMapper::Identifier::NAW}, + {"FAW", StringMapper::Identifier::FAW}, + {"32AW", StringMapper::Identifier::_32AW}, + {"FAW_LOGICAL", StringMapper::Identifier::FAW_LOGICAL}, + {"FAW_PHYSICAL", StringMapper::Identifier::FAW_PHYSICAL}, + {"REFAB", StringMapper::Identifier::REFAB}, + {"PREAB", StringMapper::Identifier::PREAB}, + {"PDEP", StringMapper::Identifier::PDEP}, + {"PDXP", StringMapper::Identifier::PDXP}, + {"SREFEN", StringMapper::Identifier::SREFEN}, + {"SREFEX", StringMapper::Identifier::SREFEX}, + {"PDEA", StringMapper::Identifier::PDEA}, + {"PDXA", StringMapper::Identifier::PDXA}, + {"SRPDEN", StringMapper::Identifier::SRPDEN}, + {"SRPDEX", StringMapper::Identifier::SRPDEX}, + {"ACT", StringMapper::Identifier::ACT}, + {"RD", StringMapper::Identifier::RD}, + {"WR", StringMapper::Identifier::WR}, + {"PREPB", StringMapper::Identifier::PREPB}, + {"RDA", StringMapper::Identifier::RDA}, + {"WRA", StringMapper::Identifier::WRA}, + {"REFPB", StringMapper::Identifier::REFPB}, + }; + + auto it = strToEnum.find(id); + if (it != strToEnum.end()) return it->second; + else throw std::invalid_argument("The provided StringMapper::Identifier '" + id.toStdString() + "' is not valid."); + +} + +bool StringMapper::mAuxIsPool(StringMapper::Identifier id) { + return id == StringMapper::Identifier::CMD_BUS + || id == StringMapper::Identifier::NAW + || id == StringMapper::Identifier::FAW + || id == StringMapper::Identifier::_32AW + || id == StringMapper::Identifier::FAW_LOGICAL + || id == StringMapper::Identifier::FAW_PHYSICAL; + +} + +bool StringMapper::operator==(const StringMapper& str2) const { + return mIDEnum == str2.mIDEnum; +} + +bool StringMapper::operator!=(const StringMapper& str2) const { + return mIDEnum != str2.mIDEnum; +} + +bool StringMapper::operator<(const StringMapper& str2) const { + return mIDEnum < str2.mIDEnum; +} + +bool StringMapper::compare(const StringMapper& str1, const StringMapper& str2) { + return str1.getIDEnum() < str2.getIDEnum(); +} + +bool StringMapper::operator==(const StringMapper::Identifier& id) const { + return mIDEnum == id; +} + +bool StringMapper::operator!=(const StringMapper::Identifier& id) const { + return mIDEnum != id; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h new file mode 100644 index 00000000..aaaa5968 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -0,0 +1,66 @@ + +#pragma once + +#include +#include "QStringComparator.h" + +class StringMapper { + public: + enum Identifier { + None, + CMD_BUS, + NAW, + FAW, + _32AW, + FAW_LOGICAL, + FAW_PHYSICAL, + REFAB, + PREAB, + PDEP, + PDXP, + SREFEN, + SREFEX, + PDEA, + PDXA, + SRPDEN, + SRPDEX, + ACT, + RD, + WR, + PREPB, + RDA, + WRA, + REFPB + }; + + public: + StringMapper() = default; + StringMapper(const QString& id); + StringMapper(const char* str) : StringMapper(std::forward(str)) {} + ~StringMapper() = default; + + Identifier getIDEnum() const { return mIDEnum; } + const QString getIDStr() const { return mIDStr; } + + bool isPool() const { return mIsPool; } + + static QString getIDStr(Identifier); + static Identifier getIDEnum(const QString&); + + bool operator==(const StringMapper&) const; + bool operator!=(const StringMapper&) const; + bool operator<(const StringMapper&) const; + + bool operator==(const Identifier&) const; + bool operator!=(const Identifier&) const; + + static bool compare(const StringMapper&, const StringMapper&); + + protected: + Identifier mIDEnum = None; + QString mIDStr = ""; + bool mIsPool = false; + + protected: + static bool mAuxIsPool(Identifier); +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index 689da366..687073af 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -56,12 +56,7 @@ struct PhaseTimeDependencies { size_t maxTime; }; -struct QStringsComparator { - bool operator()(const QString& s1, const QString& s2); - static bool compareQStrings(const QString& s1, const QString& s2); -}; - -typedef std::map DependencyMap; +typedef std::map DependencyMap; struct DBDependencyEntry { size_t delayedPhaseID; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h index 85de5e7b..06a4750f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h @@ -2,6 +2,7 @@ #pragma once #include +#include "StringMapper.h" class TimeDependency { public: @@ -9,12 +10,12 @@ public: TimeDependency(size_t timeValue, QString phaseDep, DependencyType depType, QString timeDepName, bool considerIntraRank = false) : timeValue{timeValue}, phaseDep{phaseDep}, depType{depType}, - timeDepName{timeDepName}, considerIntraRank{considerIntraRank} {} + timeDepName{timeDepName} {} size_t timeValue; - QString phaseDep; + StringMapper phaseDep; DependencyType depType; QString timeDepName; - bool considerIntraRank = false; // Used only for InterRank skip check in PhaseDependenciesTracker::mCalculateDependencies + bool isPool() { return phaseDep.isPool(); } }; \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index d86593c1..3d61939e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -14,7 +14,7 @@ class DBPhaseEntryIF { virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } size_t id; - QString phaseName; + StringMapper phaseName; size_t phaseBegin; size_t phaseEnd; size_t transact; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index c2ef1dde..61a22bb9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -3,7 +3,7 @@ DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query) { id = query.value(0).toLongLong(); - phaseName = query.value(1).toString(); + phaseName = StringMapper(query.value(1).toString()); phaseBegin = query.value(2).toLongLong(); phaseEnd = query.value(3).toLongLong(); transact = query.value(4).toLongLong(); @@ -16,7 +16,7 @@ bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; - bool isCmdPool = dep.phaseDep == "CMD_BUS_POOL"; + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; bool const skipOnIntraBankAndDifferentBanks = { dep.depType == DependencyType::IntraBank diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index 0528d8d6..420fdde3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -47,19 +47,19 @@ DependencyMap DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { DependencyMap dependenciesMap; + std::vector dependencyFilterStrMapper(dependencyFilter.begin(), dependencyFilter.end()); std::sort( - dependencyFilter.begin(), - dependencyFilter.end(), - QStringsComparator::compareQStrings + dependencyFilterStrMapper.begin(), + dependencyFilterStrMapper.end() ); dependenciesMap = mSpecializedGetDependencies(); - mFilterDependencyMap(dependenciesMap, dependencyFilter); + mFilterDependencyMap(dependenciesMap, dependencyFilterStrMapper); auto it = dependenciesMap.begin(); while (it != dependenciesMap.end()) { - mFilterDependencyList(it->second.dependencies, dependencyFilter); + mFilterDependencyList(it->second.dependencies, dependencyFilterStrMapper); it->second.maxTime = mFindVectorMaximum(it->second.dependencies); ++it; @@ -73,7 +73,7 @@ PoolControllerMap DRAMTimeDependenciesIF::getPools() const { return PoolControllerMap(mPools); } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); // TODO - probably there is a smarter way to filter these values, @@ -88,12 +88,12 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyFilter.begin(), dependencyFilter.end(), dep.phaseDep, - [](const QString& cmd, const QString& depName){ - return depName.indexOf("_POOL", 3) != -1 || QStringsComparator::compareQStrings(cmd, depName); + [](const StringMapper& cmd, const StringMapper& depName){ + return depName.isPool() || cmd < depName; } ); - if (dep.phaseDep.indexOf("_POOL", 3) != -1 || it != dependencyFilter.end() && *it == dep.phaseDep) + if (dep.phaseDep.isPool() || it != dependencyFilter.end() && *it == dep.phaseDep) return true; return false; @@ -114,7 +114,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -132,8 +132,8 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, itFilter, itFilterLast, itDependencyMap, - [](const QString& cmd, const std::pair& vpair) { - return cmd.compare(vpair.first) == 0; + [](const StringMapper& cmd, const std::pair& vpair) { + return cmd == vpair.first; } ); @@ -141,11 +141,12 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, dependencyMap.erase(pair.second, dependencyMap.end()); break; - } else if (pair.first->compare(pair.second->first) < 0) { + } else if (*(pair.first) < pair.second->first < 0) { ++(pair.first); - } else if (pair.first->compare(pair.second->first) == 0) { + } else if (*(pair.first) == pair.second->first == 0) { ++(pair.second); + } else { pair.second = dependencyMap.erase(pair.second); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp index b86d5aef..813fc687 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -2,7 +2,7 @@ #include "poolcontroller.h" #include -PoolController::PoolController(const uint poolSize, const std::vector& dependencies) +PoolController::PoolController(const uint poolSize, const std::vector& dependencies) : mDependencies(mAuxSortInput(dependencies)) { mPoolSize = poolSize; @@ -31,17 +31,17 @@ void PoolController::merge(std::vector& depEntries) { } } -bool PoolController::isDependency(const QString& phaseName) { +bool PoolController::isDependency(const StringMapper& phaseName) { return std::binary_search( mDependencies.begin(), mDependencies.end(), - phaseName, - QStringsComparator::compareQStrings + phaseName, + StringMapper::compare ); } -std::vector PoolController::mAuxSortInput(std::vector vec) { - std::sort(vec.begin(), vec.end(), QStringsComparator::compareQStrings); +std::vector PoolController::mAuxSortInput(std::vector vec) { + std::sort(vec.begin(), vec.end()); return vec; } \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index 7a6cf713..262d4997 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -5,7 +5,7 @@ class PoolController { public: - PoolController(const uint poolSize, const std::vector& dependencies); + PoolController(const uint poolSize, const std::vector& dependencies); ~PoolController() = default; void clear(); @@ -13,14 +13,14 @@ public: void increment(); void merge(std::vector& depEntries); - bool isDependency(const QString& phaseName); + bool isDependency(const StringMapper& phaseName); protected: - const std::vector mDependencies; + const std::vector mDependencies; std::vector mPool; uint mCount = 0; uint mPoolSize = 0; protected: - static std::vector mAuxSortInput(std::vector vec); + static std::vector mAuxSortInput(std::vector vec); }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index a16dd6c6..95ba8ebe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -35,7 +35,7 @@ #include "poolcontrollermap.h" -PoolControllerMap::PoolControllerMap(const std::map& pools) { +PoolControllerMap::PoolControllerMap(const std::map& pools) { mPools = pools; } @@ -46,7 +46,7 @@ void PoolControllerMap::clear() { } -void PoolControllerMap::push(const QString& poolName, DBDependencyEntry dep) { +void PoolControllerMap::push(const StringMapper& poolName, DBDependencyEntry dep) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { pool->second.push(dep); @@ -56,7 +56,7 @@ void PoolControllerMap::push(const QString& poolName, DBDependencyEntry dep) { } } -void PoolControllerMap::increment(const QString& poolName) { +void PoolControllerMap::increment(const StringMapper& poolName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { pool->second.increment(); @@ -72,7 +72,7 @@ void PoolControllerMap::merge(std::vector& depEntries) { } } -bool PoolControllerMap::isDependency(const QString& poolName, const QString& phaseName) { +bool PoolControllerMap::isDependency(const StringMapper& poolName, const StringMapper& phaseName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { return pool->second.isDependency(phaseName); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index 0de8d5f9..b7d247f1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -39,17 +39,17 @@ class PoolControllerMap { public: - PoolControllerMap(const std::map& pools); + PoolControllerMap(const std::map& pools); ~PoolControllerMap() = default; void clear(); - void push(const QString& poolName, DBDependencyEntry); - void increment(const QString& poolName); + void push(const StringMapper& poolName, DBDependencyEntry); + void increment(const StringMapper& poolName); void merge(std::vector& depEntries); - bool isDependency(const QString& poolName, const QString& phaseName); + bool isDependency(const StringMapper& poolName, const StringMapper& phaseName); protected: - std::map mPools; + std::map mPools; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index eb9d0638..4cdf2562 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -143,8 +143,8 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, - {tFAW, "NAW_POOL", DependencyType::IntraRank, "tFAW"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, } ) ); @@ -165,7 +165,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -187,7 +187,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -208,7 +208,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -229,7 +229,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -243,7 +243,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -259,7 +259,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -277,7 +277,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -294,7 +294,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -305,7 +305,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -323,7 +323,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -334,7 +334,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -352,7 +352,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); @@ -363,7 +363,7 @@ DependencyMap DDR3TimeDependencies::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, - {tCK, "CMD_BUS_POOL", DependencyType::InterRank, "CMD_BUS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CMD_BUS"}, } ) ); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 7d05ae65..62a18aae 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -209,33 +209,32 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName) continue; - + bool isPoolDep = dep.phaseDep.isPool(); + if (!isPoolDep && dep.phaseDep != otherPhase->phaseName) continue; + if (!phase->potentialDependency(dep, otherPhase)) { continue; } - if (poolSubstrPos != -1) { + if (isPoolDep) { // Captures activate window dependencies - QString poolName = dep.phaseDep.left(poolSubstrPos); - if (poolController.isDependency(poolName, otherPhase->phaseName)) { + if (poolController.isDependency(dep.phaseDep, otherPhase->phaseName)) { if (timeDiff == dep.timeValue) { // Captures only the first (exactly matching time) phase in // the pool window as a dependency - poolController.push(poolName, DBDependencyEntry{ + poolController.push(dep.phaseDep, DBDependencyEntry{ phase->id, - phase->phaseName, + phase->phaseName.getIDStr(), PhaseDependency::dependencyTypeName(dep.depType), dep.timeDepName, otherPhase->id, - otherPhase->phaseName + otherPhase->phaseName.getIDStr() }); } if (timeDiff < dep.timeValue) { - poolController.increment(poolName); + poolController.increment(dep.phaseDep); } @@ -247,11 +246,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrid, - phase->phaseName, + phase->phaseName.getIDStr(), PhaseDependency::dependencyTypeName(dep.depType), dep.timeDepName, otherPhase->id, - otherPhase->phaseName + otherPhase->phaseName.getIDStr() }); } From d0ecbb78359ebe603c583ad9fce1aeccac46652b Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 3 Mar 2022 10:26:47 +0100 Subject: [PATCH 101/121] Added DDR3 generated dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 1 + .../specialized/DDR3Configuration.cpp | 3 +- .../specialized/DDR3Configuration.h | 1 + .../specialized/TimeDependenciesInfoDDR3.cpp | 354 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR3.h | 58 +++ 5 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 7d7667ae..887d2fb7 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -122,6 +122,7 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp index d9ab5d36..abe11bf8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp @@ -2,7 +2,8 @@ #include "DDR3Configuration.h" DDR3Configuration::DDR3Configuration(const TraceDB& tdb) { - mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + // mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index c25dd87b..84f59974 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -3,6 +3,7 @@ #include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" class DDR3Configuration : public ConfigurationIF { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp new file mode 100644 index 00000000..0bc82412 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -0,0 +1,354 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoDDR3.h" + +using namespace std; + +TimeDependenciesInfoDDR3::TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoDDR3::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + } + } + }); + + tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tCL = tCK * mMemspecJson["memtimingspec"].toObject()["CL"].toInt(); + tCWL = tCK * mMemspecJson["memtimingspec"].toObject()["CWL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWTR = tCK * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRFC = tCK * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + + tPD = tCKE; + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDWR = tRL + tBURST + 2 * tCK - tWL; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tBURST + tWTR - tAL; + tWRPRE = tWL + tBURST + tWR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tRDPDEN = tRL + tBURST + tCK; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + tCK; + +} + +const std::vector TimeDependenciesInfoDDR3::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoDDR3::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraBank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD, "WR", DependencyType::IntraBank, "tWRRD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {max({tWRRD, tWRPRE - tRTP - tAL}), "WR", DependencyType::IntraBank, "max(tWRRD, tWRPRE - tRTP - tAL)"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tAL + tRTP + tRP, "RDA", DependencyType::IntraRank, "tAL + tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h new file mode 100644 index 00000000..28d36a87 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h @@ -0,0 +1,58 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoDDR3 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tCCD; + uint tRCD; + uint tRP; + uint tRAS; + uint tCL; + uint tCWL; + uint tAL; + uint tRL; + uint tWL; + uint tRTP; + uint tWTR; + uint tRRD; + uint tWR; + uint tFAW; + uint tRFC; + uint tRC; + uint tXP; + uint tXS; + uint tXSDLL; + uint tCKE; + uint tCKESR; + uint tPD; + uint tREFPDEN; + uint tACTPDEN; + uint tPRPDEN; + uint tRTRS; + + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRPRE; + uint tWRRD_R; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + +}; From 8ed42d62f20ec5d4b50e2f599dfbb2e88727bda9 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 3 Mar 2022 13:55:47 +0100 Subject: [PATCH 102/121] Corrected time dependency filtering with StringMapper. Added DDR4 dependency tracking. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 9 +- .../common/StringMapper.h | 2 +- .../dramTimeDependencies/common/common.h | 1 - .../configurations/configurationfactory.cpp | 12 +- .../configurations/configurationfactory.h | 1 + .../specialized/DDR4Configuration.cpp | 11 + .../specialized/DDR4Configuration.h | 14 + .../dbEntries/dbphaseentryTypes.h | 5 - .../specialized/DDR4dbphaseentry.cpp | 45 ++ .../dbEntries/specialized/DDR4dbphaseentry.h | 14 + .../dramtimedependenciesIF.cpp | 5 +- .../specialized/TimeDependenciesInfoDDR4.cpp | 387 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR4.h | 66 +++ 13 files changed, 559 insertions(+), 13 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h delete mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 887d2fb7..2ef09e90 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -117,14 +117,19 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/configurations/configurationIF.cpp businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp - businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp + # businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp + + businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp + businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp + + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp businessObjects/dramTimeDependencies/dramtimedependenciesIF.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index aaaa5968..2ecf89c3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -27,7 +27,7 @@ class StringMapper { ACT, RD, WR, - PREPB, + PREPB, RDA, WRA, REFPB diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h index 687073af..6b673bbf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/common.h @@ -47,7 +47,6 @@ #include "businessObjects/phases/phasedependency.h" #include "timedependency.h" -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h" struct PhaseTimeDependencies { explicit PhaseTimeDependencies(std::initializer_list d) : dependencies(d) {} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 154e18e0..0c5036ef 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -41,6 +41,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) if (deviceName == "DDR3") { return std::make_shared(tdb); + } else if (deviceName == "DDR4") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -53,7 +56,11 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t const QString deviceName = ConfigurationIF::getDeviceName(tdb); if (deviceName == "DDR3") { - return DDR3TimeDependencies::getPossiblePhases(); + // return DDR3TimeDependencies::getPossiblePhases(); + return TimeDependenciesInfoDDR3::getPossiblePhases(); + + } else if (deviceName == "DDR4") { + return TimeDependenciesInfoDDR4::getPossiblePhases(); } else { // TODO maybe throw? @@ -70,6 +77,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { if (deviceName == "DDR3") { return true; + } else if (deviceName == "DDR4") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index d3d4fb08..c38877f5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -39,6 +39,7 @@ #include "configurationIF.h" #include "specialized/DDR3Configuration.h" +#include "specialized/DDR4Configuration.h" #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp new file mode 100644 index 00000000..ce696152 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp @@ -0,0 +1,11 @@ + +#include "DDR4Configuration.h" + +DDR4Configuration::DDR4Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr DDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h new file mode 100644 index 00000000..992e8df2 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h" + +class DDR4Configuration : public ConfigurationIF { + public: + DDR4Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h deleted file mode 100644 index 1a809fa7..00000000 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryTypes.h +++ /dev/null @@ -1,5 +0,0 @@ - -#pragma once - -#include "dbphaseentryIF.h" -#include "specialized/DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp new file mode 100644 index 00000000..611ac9b7 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp @@ -0,0 +1,45 @@ + +#include "DDR4dbphaseentry.h" + +DDR4DBPhaseEntry::DDR4DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool DDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraRankAndDifferentRanks + || skipOnInterRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h new file mode 100644 index 00000000..7f53fe6c --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class DDR4DBPhaseEntry : public DBPhaseEntryIF { + public: + DDR4DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp index 420fdde3..df67097c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp @@ -65,7 +65,6 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) ++it; } - return dependenciesMap; } @@ -141,10 +140,10 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, dependencyMap.erase(pair.second, dependencyMap.end()); break; - } else if (*(pair.first) < pair.second->first < 0) { + } else if (*(pair.first) < pair.second->first) { ++(pair.first); - } else if (*(pair.first) == pair.second->first == 0) { + } else if (*(pair.first) == pair.second->first) { ++(pair.second); } else { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp new file mode 100644 index 00000000..287239af --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -0,0 +1,387 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoDDR4.h" + +using namespace std; + +TimeDependenciesInfoDDR4::TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoDDR4::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + } + } + }); + + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tCL = tCK * mMemspecJson["memtimingspec"].toObject()["CL"].toInt(); + tCWL = tCK * mMemspecJson["memtimingspec"].toObject()["CWL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tRPRE = tCK * mMemspecJson["memtimingspec"].toObject()["RPRE"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tCCD_S = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S"].toInt(); + tCCD_L = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L"].toInt(); + tRRD_S = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_S"].toInt(); + tRRD_L = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_L"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tWTR_S = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_S"].toInt(); + tWTR_L = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_L"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + + tPD = tCKE; + tRFC = tCK * ( + (mMemspecJson["memtimingspec"].toObject()["REFM"].toInt() == 4) ? + (mMemspecJson["memtimingspec"].toObject()["RFC4"].toInt(1)) : + ( + (mMemspecJson["memtimingspec"].toObject()["REFM"].toInt() == 2) ? + (mMemspecJson["memtimingspec"].toObject()["RFC2"].toInt(1)) : + (mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(1)) + ) + ); + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDWR = tRL + tBURST + tCK - tWL + tWPRE; + tRDWR_R = tRL + tBURST + tRTRS - tWL + tWPRE; + tWRRD_S = tWL + tBURST + tWTR_S - tAL; + tWRRD_L = tWL + tBURST + tWTR_L - tAL; + tWRRD_R = tWL + tBURST + tRTRS - tRL + tRPRE; + tRDAACT = tAL + tRTP + tRP; + tWRPRE = tWL + tBURST + tWR; + tWRAACT = tWRPRE + tRP; + tRDPDEN = tRL + tBURST + tCK; + tWRPDEN = tWL + tBURST + tWR; + tWRAPDEN = tWL + tBURST + tWR + tCK; + +} + +const std::vector TimeDependenciesInfoDDR4::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoDDR4::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRD_L, "ACT", DependencyType::IntraBankGroup, "tRRD_L"}, + {tRRD_S, "ACT", DependencyType::IntraRank, "tRRD_S"}, + {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, + {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD_L, "RD", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "RD", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RD", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "RDA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RDA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD_L, "WR", DependencyType::IntraBank, "tWRRD_L"}, + {tWRRD_L, "WR", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WR", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_L, "WRA", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WRA", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD_L, "WR", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "WR", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WR", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "WRA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WRA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraBank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraBank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tCCD_L, "RD", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "RD", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RD", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "RDA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "RDA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {max({tWRRD_L, tWRPRE - tRTP - tAL}), "WR", DependencyType::IntraBank, "max(tWRRD_L, tWRPRE - tRTP - tAL)"}, + {tWRRD_L, "WR", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WR", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD_L, "WRA", DependencyType::IntraBankGroup, "tWRRD_L"}, + {tWRRD_S, "WRA", DependencyType::IntraRank, "tWRRD_S"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD_L, "WR", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "WR", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WR", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD_L, "WRA", DependencyType::IntraBankGroup, "tCCD_L"}, + {tCCD_S, "WRA", DependencyType::IntraRank, "tCCD_S"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXSDLL, "SREFEX", DependencyType::IntraRank, "tXSDLL"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {tRDAACT, "RDA", DependencyType::IntraRank, "tRDAACT"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS, "ACT", DependencyType::IntraRank, "tRAS"}, + {tAL + tRTP, "RD", DependencyType::IntraRank, "tAL + tRTP"}, + {tAL + tRTP, "RDA", DependencyType::IntraRank, "tAL + tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraRank, "tRC"}, + {max({tRDPDEN, tAL + tRTP + tRP}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tAL + tRTP + tRP)"}, + {max({tWRAPDEN, tWRPRE + tRP}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRP)"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h new file mode 100644 index 00000000..5b89e31a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h @@ -0,0 +1,66 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoDDR4 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tRCD; + uint tRP; + uint tRAS; + uint tRC; + uint tCL; + uint tCWL; + uint tAL; + uint tRL; + uint tRPRE; + uint tWPRE; + uint tWL; + uint tCCD_S; + uint tCCD_L; + uint tRRD_S; + uint tRRD_L; + uint tFAW; + uint tWTR_S; + uint tWTR_L; + uint tRTP; + uint tWR; + uint tRFC; + uint tXS; + uint tXSDLL; + uint tXP; + uint tCKE; + uint tCKESR; + uint tPD; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; + uint tRTRS; + + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD_S; + uint tWRRD_L; + uint tWRRD_R; + uint tRDAACT; + uint tWRPRE; + uint tWRAACT; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + +}; From c2508a668142a00141ef844a234efa23624d985f Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 08:07:17 +0100 Subject: [PATCH 103/121] Adding time keeping for dependencies tracker. --- .../phasedependenciestracker.cpp | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 62a18aae..58936c95 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -35,26 +35,49 @@ #include "phasedependenciestracker.h" +#include +#include + void PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector& commands) { - auto deviceConfig = ConfigurationFactory::make(tdb); + using std::chrono::high_resolution_clock; + using std::chrono::duration_cast; + using std::chrono::duration; + using std::chrono::microseconds; + + + auto deviceInstantiationTimeStart = high_resolution_clock::now(); + auto deviceConfig = ConfigurationFactory::make(tdb); + auto deviceInstantiationTimeEnd = high_resolution_clock::now(); + auto deviceInstantiationTimeDuration = duration_cast(deviceInstantiationTimeEnd - deviceInstantiationTimeStart); mBeginTransaction(tdb); mDropTable(tdb); if (commands.size() > 0) { - auto& phases = mGetFilteredPhases(deviceConfig, tdb, commands); - + auto phasesLoadingTimeStart = high_resolution_clock::now(); + auto& phases = mGetFilteredPhases(deviceConfig, tdb, commands); + auto phasesLoadingTimeEnd = high_resolution_clock::now(); + auto phasesLoadingTimeDuration = duration_cast(phasesLoadingTimeEnd - phasesLoadingTimeStart); + if (phases.size() != 0) { - auto& entries = mCalculateDependencies(deviceConfig, phases, commands); - + auto dependenciesCalcTimeStart = high_resolution_clock::now(); + auto& entries = mCalculateDependencies(deviceConfig, phases, commands); + auto dependenciesCalcTimeEnd = high_resolution_clock::now(); + auto dependenciesCalcTimeDuration = duration_cast(dependenciesCalcTimeEnd - dependenciesCalcTimeStart); + if (entries.size() > 0) { mCreateTable(tdb); } mInsertIntoTable(tdb, entries); + std::cout << "PhaseDependenciesTracker times (us):" << std::endl + << "\tDevice instantiation: " << deviceInstantiationTimeDuration.count() << std::endl + << "\tPhase loading: " << phasesLoadingTimeDuration.count() << std::endl + << "\tDependencies calculation: " << dependenciesCalcTimeDuration.count() << std::endl; + } else { // TODO - not sure if necessary. Still, a possibility // mRollbackChanges(tdb); From 6393eafb8f6eb21217ae186917a0311336379c12 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 09:17:15 +0100 Subject: [PATCH 104/121] Added re-prepare of queries to eliminate 'parameter mismatch' exception. --- .../phasedependenciestracker.cpp | 15 +++++++++++---- .../phasedependenciestracker.h | 4 ++-- DRAMSys/traceAnalyzer/data/tracedb.cpp | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 58936c95..9c0fb5fe 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -45,7 +45,6 @@ PhaseDependenciesTracker::calculateDependencies(TraceDB& tdb, std::vector(tableInsertionTimeEnd - tableInsertionTimeStart); + + auto totalTime = deviceInstantiationTimeDuration + phasesLoadingTimeDuration + dependenciesCalcTimeDuration + tableInsertionTimeDuration; + std::cout << "PhaseDependenciesTracker times (us):" << std::endl << "\tDevice instantiation: " << deviceInstantiationTimeDuration.count() << std::endl << "\tPhase loading: " << phasesLoadingTimeDuration.count() << std::endl - << "\tDependencies calculation: " << dependenciesCalcTimeDuration.count() << std::endl; + << "\tDependencies calculation: " << dependenciesCalcTimeDuration.count() << std::endl + << "\tDB table population: " << tableInsertionTimeDuration.count() << std::endl + << " - Total time: " << totalTime.count() << std::endl; } else { // TODO - not sure if necessary. Still, a possibility @@ -104,7 +111,7 @@ void PhaseDependenciesTracker::mCreateTable(TraceDB& tdb) { } void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector& entries) { - static const size_t bulkInsertionSize = 200; + static const size_t bulkInsertionSize = 30; auto numberOfEntries = entries.size(); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index b4ce10bf..ebd7e16a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -65,7 +65,7 @@ private: static void mRollbackChanges(TraceDB& tdb); static void mCommitTransaction(TraceDB& tdb); - static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); - static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); + inline static void mAddFirstEntryCommandString(QString& command, const DBDependencyEntry& entry); + inline static void mAddEntryCommandString(QString& command, const DBDependencyEntry& entry); }; diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index f11cf7ee..f325f864 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -130,6 +130,7 @@ void TraceDB::updateFileDescription(const QString &description) void TraceDB::refreshData() { + prepareQueries(); generalInfo = getGeneralInfoFromDB(); } From 3a0f56f2b22524041fb87e0d99ebad2c5d2969ea Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 09:50:09 +0100 Subject: [PATCH 105/121] Removed throw from ConfigurationFactory::possiblePhases. --- .../configurations/configurationfactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 0c5036ef..e75607f0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -64,8 +64,8 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else { // TODO maybe throw? - throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); - + // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); + return {""}; } } From 20f783ad38c708f15774836cbfa7aba5c25e06ca Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 10:28:39 +0100 Subject: [PATCH 106/121] Added HBM2 dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 + .../common/StringMapper.cpp | 6 + .../common/StringMapper.h | 2 + .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 1 + .../specialized/HBM2Configuration.cpp | 11 + .../specialized/HBM2Configuration.h | 14 + .../specialized/HBM2dbphaseentry.cpp | 45 ++ .../dbEntries/specialized/HBM2dbphaseentry.h | 14 + .../specialized/TimeDependenciesInfoHBM2.cpp | 398 ++++++++++++++++++ .../specialized/TimeDependenciesInfoHBM2.h | 57 +++ 11 files changed, 561 insertions(+) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 2ef09e90..f3051aa5 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -127,6 +127,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp + + businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp + businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index ddc0cfe3..450410bf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -11,6 +11,8 @@ StringMapper::StringMapper(const QString& name) { QString StringMapper::getIDStr(StringMapper::Identifier id) { static const std::map enumToStr { {StringMapper::Identifier::CMD_BUS, "CMD_BUS"}, + {StringMapper::Identifier::RAS_BUS, "RAS_BUS"}, + {StringMapper::Identifier::CAS_BUS, "CAS_BUS"}, {StringMapper::Identifier::NAW, "NAW"}, {StringMapper::Identifier::FAW, "FAW"}, {StringMapper::Identifier::_32AW, "32AW"}, @@ -44,6 +46,8 @@ QString StringMapper::getIDStr(StringMapper::Identifier id) { StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { static const std::map strToEnum { {"CMD_BUS", StringMapper::Identifier::CMD_BUS}, + {"RAS_BUS", StringMapper::Identifier::RAS_BUS}, + {"CAS_BUS", StringMapper::Identifier::CAS_BUS}, {"NAW", StringMapper::Identifier::NAW}, {"FAW", StringMapper::Identifier::FAW}, {"32AW", StringMapper::Identifier::_32AW}, @@ -76,6 +80,8 @@ StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { bool StringMapper::mAuxIsPool(StringMapper::Identifier id) { return id == StringMapper::Identifier::CMD_BUS + || id == StringMapper::Identifier::RAS_BUS + || id == StringMapper::Identifier::CAS_BUS || id == StringMapper::Identifier::NAW || id == StringMapper::Identifier::FAW || id == StringMapper::Identifier::_32AW diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index 2ecf89c3..b4034cd1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -9,6 +9,8 @@ class StringMapper { enum Identifier { None, CMD_BUS, + RAS_BUS, + CAS_BUS, NAW, FAW, _32AW, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index e75607f0..ee0fa3e2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -44,6 +44,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } else if (deviceName == "DDR4") { return std::make_shared(tdb); + } else if (deviceName == "HBM2") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -62,6 +65,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "DDR4") { return TimeDependenciesInfoDDR4::getPossiblePhases(); + } else if (deviceName == "HBM2") { + return TimeDependenciesInfoHBM2::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -80,6 +86,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "DDR4") { return true; + } else if (deviceName == "HBM2") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index c38877f5..b7b006a4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -40,6 +40,7 @@ #include "configurationIF.h" #include "specialized/DDR3Configuration.h" #include "specialized/DDR4Configuration.h" +#include "specialized/HBM2Configuration.h" #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp new file mode 100644 index 00000000..0ba89bae --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp @@ -0,0 +1,11 @@ + +#include "HBM2Configuration.h" + +HBM2Configuration::HBM2Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr HBM2Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h new file mode 100644 index 00000000..5abbaa37 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h" + +class HBM2Configuration : public ConfigurationIF { + public: + HBM2Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp new file mode 100644 index 00000000..09e2a38a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp @@ -0,0 +1,45 @@ + +#include "HBM2dbphaseentry.h" + +HBM2DBPhaseEntry::HBM2DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraRankAndDifferentRanks + || skipOnInterRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h new file mode 100644 index 00000000..541693fd --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class HBM2DBPhaseEntry : public DBPhaseEntryIF { + public: + HBM2DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp new file mode 100644 index 00000000..977de023 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -0,0 +1,398 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoHBM2.h" + +using namespace std; + +TimeDependenciesInfoHBM2::TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoHBM2::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "RAS_BUS", { + 1, { + "ACT", + "PREPB", + "PREAB", + "REFPB", + "REFAB", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + } + } + }); + + mPools.insert({ + "CAS_BUS", { + 1, { + "RD", + "RDA", + "WR", + "WRA", + "PDEA", + "PDXA", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + "REFPB", + } + } + }); + + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); + tRCDRD = tCK * mMemspecJson["memtimingspec"].toObject()["RCDRD"].toInt(); + tRCDWR = tCK * mMemspecJson["memtimingspec"].toObject()["RCDWR"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRRDS = tCK * mMemspecJson["memtimingspec"].toObject()["RRDS"].toInt(); + tRRDL = tCK * mMemspecJson["memtimingspec"].toObject()["RRDL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tPL = tCK * mMemspecJson["memtimingspec"].toObject()["PL"].toInt(); + tCCDS = tCK * mMemspecJson["memtimingspec"].toObject()["CCDS"].toInt(); + tCCDL = tCK * mMemspecJson["memtimingspec"].toObject()["CCDL"].toInt(); + tRTW = tCK * mMemspecJson["memtimingspec"].toObject()["RTW"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTRS = tCK * mMemspecJson["memtimingspec"].toObject()["WTRS"].toInt(); + tWTRL = tCK * mMemspecJson["memtimingspec"].toObject()["WTRL"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tRFC = tCK * mMemspecJson["memtimingspec"].toObject()["RFC"].toInt(); + tRFCSB = tCK * mMemspecJson["memtimingspec"].toObject()["RFCSB"].toInt(); + tRREFD = tCK * mMemspecJson["memtimingspec"].toObject()["RREFD"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + + tPD = tCKE; + tCKESR = tCKE + tCK; + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDPDE = tRL + tPL + tBURST + tCK; + tRDSRE = tRDPDE; + tWRPRE = tWL + tBURST + tWR; + tWRPDE = tWL + tPL + tBURST + tCK + tWR; + tWRAPDE = tWL + tPL + tBURST + tCK + tWR; + tWRRDS = tWL + tBURST + tWTRS; + tWRRDL = tWL + tBURST + tWTRL; + +} + +const std::vector TimeDependenciesInfoHBM2::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFPB", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoHBM2::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRDL, "ACT", DependencyType::IntraBankGroup, "tRRDL"}, + {tRRDS, "ACT", DependencyType::IntraRank, "tRRDS"}, + {tRTP + tRP - tCK, "RDA", DependencyType::IntraBank, "tRTP + tRP - tCK"}, + {tWRPRE + tRP - tCK, "WRA", DependencyType::IntraBank, "tWRPRE + tRP - tCK"}, + {tRP - tCK, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, + {tRP - tCK, "PREAB", DependencyType::IntraRank, "tRP - tCK"}, + {tXP - tCK, "PDXA", DependencyType::IntraRank, "tXP - tCK"}, + {tXP - tCK, "PDXP", DependencyType::IntraRank, "tXP - tCK"}, + {tRFC - tCK, "REFAB", DependencyType::IntraRank, "tRFC - tCK"}, + {tRFCSB - tCK, "REFPB", DependencyType::IntraBank, "tRFCSB - tCK"}, + {tRREFD - tCK, "REFPB", DependencyType::IntraBankGroup, "tRREFD - tCK"}, + {tRREFD - tCK, "REFPB", DependencyType::IntraRank, "tRREFD - tCK"}, + {tXS - tCK, "SREFEX", DependencyType::IntraRank, "tXS - tCK"}, + {2 * tCK, "RAS_BUS", DependencyType::InterRank, "2 * tCK"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCDRD + tCK, "ACT", DependencyType::IntraBank, "tRCDRD + tCK"}, + {tCCDL, "RD", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "RD", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RD", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "RDA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RDA", DependencyType::IntraRank, "tCCDS"}, + {tWRRDL, "WR", DependencyType::IntraBank, "tWRRDL"}, + {tWRRDL, "WR", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WR", DependencyType::IntraRank, "tWRRDS"}, + {tWRRDL, "WRA", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WRA", DependencyType::IntraRank, "tWRRDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCDWR + tCK, "ACT", DependencyType::IntraBank, "tRCDWR + tCK"}, + {tRTW, "RD", DependencyType::IntraBank, "tRTW"}, + {tRTW, "RD", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RD", DependencyType::IntraRank, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraRank, "tRTW"}, + {tCCDL, "WR", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "WR", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WR", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "WRA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WRA", DependencyType::IntraRank, "tCCDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {tRTP, "RD", DependencyType::IntraBank, "tRTP"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCDRD + tCK, "ACT", DependencyType::IntraBank, "tRCDRD + tCK"}, + {tCCDL, "RD", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "RD", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RD", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "RDA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "RDA", DependencyType::IntraRank, "tCCDS"}, + {tWL + tBURST + max({tWR - tRTP, tWTRL}), "WR", DependencyType::IntraBank, "tWL + tBURST + max(tWR - tRTP, tWTRL)"}, + {tWRRDL, "WR", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WR", DependencyType::IntraRank, "tWRRDS"}, + {tWRRDL, "WRA", DependencyType::IntraBankGroup, "tWRRDL"}, + {tWRRDS, "WRA", DependencyType::IntraRank, "tWRRDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCDWR + tCK, "ACT", DependencyType::IntraBank, "tRCDWR + tCK"}, + {tRTW, "RD", DependencyType::IntraBank, "tRTW"}, + {tRTW, "RD", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RD", DependencyType::IntraRank, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraBankGroup, "tRTW"}, + {tRTW, "RDA", DependencyType::IntraRank, "tRTW"}, + {tCCDL, "WR", DependencyType::IntraBank, "tCCDL"}, + {tCCDL, "WR", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WR", DependencyType::IntraRank, "tCCDS"}, + {tCCDL, "WRA", DependencyType::IntraBankGroup, "tCCDL"}, + {tCCDS, "WRA", DependencyType::IntraRank, "tCCDS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFPB"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraBank, "tRC + tCK"}, + {tRRDL + tCK, "ACT", DependencyType::IntraBankGroup, "tRRDL + tCK"}, + {tRRDS + tCK, "ACT", DependencyType::IntraRank, "tRRDS + tCK"}, + {tRTP + tRP, "RDA", DependencyType::IntraBank, "tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraBank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraBank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tRFCSB, "REFPB", DependencyType::IntraBank, "tRFCSB"}, + {tRREFD, "REFPB", DependencyType::IntraBankGroup, "tRREFD"}, + {tRREFD, "REFPB", DependencyType::IntraRank, "tRREFD"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraRank, "tRC + tCK"}, + {tRTP + tRP, "RDA", DependencyType::IntraRank, "tRTP + tRP"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tRFCSB, "REFPB", DependencyType::IntraRank, "tRFCSB"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraRank, "tRAS + tCK"}, + {tRTP, "RD", DependencyType::IntraRank, "tRTP"}, + {tRTP, "RDA", DependencyType::IntraRank, "tRTP"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tRFCSB, "REFPB", DependencyType::IntraRank, "tRFCSB"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDE, "RD", DependencyType::IntraRank, "tRDPDE"}, + {tRDPDE, "RDA", DependencyType::IntraRank, "tRDPDE"}, + {tWRAPDE, "WRA", DependencyType::IntraRank, "tWRAPDE"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEP", DependencyType::IntraRank, "tPD"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraRank, "tRC + tCK"}, + {max({tRTP + tRP, tRDSRE}), "RDA", DependencyType::IntraRank, "max(tRTP + tRP, tRDSRE)"}, + {tWRPRE + tRP, "WRA", DependencyType::IntraRank, "tWRPRE + tRP"}, + {tRP, "PREPB", DependencyType::IntraRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraRank, "tRP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFC, "REFAB", DependencyType::IntraRank, "tRFC"}, + {tRFCSB, "REFPB", DependencyType::IntraRank, "tRFCSB"}, + {tXS, "SREFEX", DependencyType::IntraRank, "tXS"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tCKESR, "SREFEN", DependencyType::IntraRank, "tCKESR"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tRDPDE, "RD", DependencyType::IntraRank, "tRDPDE"}, + {tRDPDE, "RDA", DependencyType::IntraRank, "tRDPDE"}, + {tWRPDE, "WR", DependencyType::IntraRank, "tWRPDE"}, + {tWRAPDE, "WRA", DependencyType::IntraRank, "tWRAPDE"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tPD, "PDEA", DependencyType::IntraRank, "tPD"}, + {tCK, "RAS_BUS", DependencyType::InterRank, "tCK"}, + {tCK, "CAS_BUS", DependencyType::InterRank, "tCK"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h new file mode 100644 index 00000000..f4c9f523 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h @@ -0,0 +1,57 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoHBM2 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tRP; + uint tRAS; + uint tRC; + uint tRCDRD; + uint tRCDWR; + uint tRTP; + uint tRRDS; + uint tRRDL; + uint tRL; + uint tPL; + uint tCCDS; + uint tCCDL; + uint tRTW; + uint tWL; + uint tWR; + uint tWTRS; + uint tWTRL; + uint tCKE; + uint tPD; + uint tXP; + uint tRFC; + uint tRFCSB; + uint tRREFD; + uint tXS; + uint tCKESR; + uint tFAW; + + uint tBURST; + uint tRDPDE; + uint tRDSRE; + uint tWRPRE; + uint tWRPDE; + uint tWRAPDE; + uint tWRRDS; + uint tWRRDL; + +}; From 9eda19eb0042cd96bda31d0fc2332d8a32f0ee4e Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Tue, 8 Mar 2022 10:50:26 +0100 Subject: [PATCH 107/121] Added LPDDR4 dependencies. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 5 +- .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 3 + .../specialized/DDR3Configuration.h | 2 +- .../specialized/LPDDR4Configuration.cpp | 12 + .../specialized/LPDDR4Configuration.h | 14 + .../specialized/LPDDR4dbphaseentry.cpp | 36 ++ .../specialized/LPDDR4dbphaseentry.h | 14 + .../TimeDependenciesInfoLPDDR4.cpp | 409 ++++++++++++++++++ .../specialized/TimeDependenciesInfoLPDDR4.h | 68 +++ 10 files changed, 570 insertions(+), 2 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index f3051aa5..13130e54 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -131,7 +131,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp - + + businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp + businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index ee0fa3e2..6700934b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -47,6 +47,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } else if (deviceName == "HBM2") { return std::make_shared(tdb); + } else if (deviceName == "LPDDR4") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -68,6 +71,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "HBM2") { return TimeDependenciesInfoHBM2::getPossiblePhases(); + } else if (deviceName == "LPDDR4") { + return TimeDependenciesInfoLPDDR4::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -89,6 +95,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "HBM2") { return true; + } else if (deviceName == "LPDDR4") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index b7b006a4..4198a68a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -38,9 +38,12 @@ #include #include "configurationIF.h" + #include "specialized/DDR3Configuration.h" #include "specialized/DDR4Configuration.h" #include "specialized/HBM2Configuration.h" +#include "specialized/LPDDR4Configuration.h" + #include "data/tracedb.h" class ConfigurationFactory { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index 84f59974..8b0e5abd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -2,7 +2,7 @@ #pragma once #include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" -#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" +// #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp new file mode 100644 index 00000000..a091c516 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp @@ -0,0 +1,12 @@ + +#include "LPDDR4Configuration.h" + +LPDDR4Configuration::LPDDR4Configuration(const TraceDB& tdb) { + // mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr LPDDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { + return std::make_shared(query); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h new file mode 100644 index 00000000..448d7ddb --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h" + +class LPDDR4Configuration : public ConfigurationIF { + public: + LPDDR4Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp new file mode 100644 index 00000000..4bd416d7 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp @@ -0,0 +1,36 @@ + +#include "LPDDR4dbphaseentry.h" + +LPDDR4DBPhaseEntry::LPDDR4DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + // tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool LPDDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h new file mode 100644 index 00000000..4bec8806 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class LPDDR4DBPhaseEntry : public DBPhaseEntryIF { + public: + LPDDR4DBPhaseEntry(const QSqlQuery&); + + // size_t tBankgroup; + size_t tRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp new file mode 100644 index 00000000..57c5a94b --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -0,0 +1,409 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoLPDDR4.h" + +using namespace std; + +TimeDependenciesInfoLPDDR4::TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoLPDDR4::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "RDA", + "WRA", + "PREPB", + "PREAB", + "REFAB", + "SREFEN", + "SREFEX", + "REFPB", + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + "ACT", + "REFPB", + } + } + }); + + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tRPpb = tCK * mMemspecJson["memtimingspec"].toObject()["RPpb"].toInt(); + tRPab = tCK * mMemspecJson["memtimingspec"].toObject()["RPab"].toInt(); + tRCpb = tCK * mMemspecJson["memtimingspec"].toObject()["RCpb"].toInt(); + tRCab = tCK * mMemspecJson["memtimingspec"].toObject()["RCab"].toInt(); + tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tWTR = tCK * mMemspecJson["memtimingspec"].toObject()["WTR"].toInt(); + tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tRPST = tCK * mMemspecJson["memtimingspec"].toObject()["RPST"].toInt(); + tDQSCK = tCK * mMemspecJson["memtimingspec"].toObject()["DQSCK"].toInt(); + tDQSS = tCK * mMemspecJson["memtimingspec"].toObject()["DQSS"].toInt(); + tDQS2DQ = tCK * mMemspecJson["memtimingspec"].toObject()["DQS2DQ"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tRFCab = tCK * mMemspecJson["memtimingspec"].toObject()["RFCab"].toInt(); + tRFCpb = tCK * mMemspecJson["memtimingspec"].toObject()["RFCpb"].toInt(); + tESCKE = tCK * mMemspecJson["memtimingspec"].toObject()["ESCKE"].toInt(); + tSR = tCK * mMemspecJson["memtimingspec"].toObject()["SR"].toInt(); + tXSR = tCK * mMemspecJson["memtimingspec"].toObject()["XSR"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCMDCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CMDCKE"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + + tBURST = (uint) (burstLength / (float) dataRate) * tCK; + tRDWR = tRL + tDQSCK + tBURST - tWL + tWPRE + tRPST; + tRDWR_R = tRL + tBURST + tRTRS - tWL; + tWRRD = tWL + tCK + tBURST + tWTR; + tWRRD_R = tWL + tBURST + tRTRS - tRL; + tRDPRE = tRTP + tBURST - 6 * tCK; + tRDAACT = tRTP + tRPpb + tBURST - 8 * tCK; + tWRPRE = 2 * tCK + tWL + tCK + tBURST + tWR; + tWRAACT = tWL + tBURST + tWR + tCK + tRPpb; + tACTPDEN = 3 * tCK + tCMDCKE; + tPRPDEN = tCK + tCMDCKE; + tRDPDEN = 3 * tCK + tRL + tDQSCK + tBURST + tRPST; + tWRPDEN = 3 * tCK + tWL + (ceil((uint) (tDQSS / (float) tCK)) + ceil((uint) (tDQS2DQ / (float) tCK))) * tCK + tBURST + tWR; + tWRAPDEN = 3 * tCK + tWL + (ceil((uint) (tDQSS / (float) tCK)) + ceil((uint) (tDQS2DQ / (float) tCK))) * tCK + tBURST + tWR + 2 * tCK; + tREFPDEN = tCK + tCMDCKE; + tSREFPDEN = tCK + tESCKE; + +} + +const std::vector TimeDependenciesInfoLPDDR4::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFPB", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + "SRPDEN", + "SRPDEX", + }; +} + +DependencyMap TimeDependenciesInfoLPDDR4::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRCpb, "ACT", DependencyType::IntraBank, "tRCpb"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, + {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, + {tRPpb - 2 * tCK, "PREPB", DependencyType::IntraBank, "tRPpb - 2 * tCK"}, + {tRPab - 2 * tCK, "PREAB", DependencyType::IntraRank, "tRPab - 2 * tCK"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFCab - 2 * tCK, "REFAB", DependencyType::IntraRank, "tRFCab - 2 * tCK"}, + {tRFCpb - 2 * tCK, "REFPB", DependencyType::IntraBank, "tRFCpb - 2 * tCK"}, + {tRRD - 2 * tCK, "REFPB", DependencyType::IntraRank, "tRRD - 2 * tCK"}, + {tXSR - 2 * tCK, "SREFEX", DependencyType::IntraRank, "tXSR - 2 * tCK"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tWRRD, "WR", DependencyType::IntraBank, "tWRRD"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + 2 * tCK, "ACT", DependencyType::IntraBank, "tRAS + 2 * tCK"}, + {tRDPRE, "RD", DependencyType::IntraBank, "tRDPRE"}, + {tWRPRE, "WR", DependencyType::IntraBank, "tWRPRE"}, + {tPPD, "PREPB", DependencyType::IntraRank, "tPPD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, + {max({tWRRD, tWRPRE - tRDPRE}), "WR", DependencyType::IntraBank, "max(tWRRD, tWRPRE - tRDPRE)"}, + {tWRRD, "WR", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, + {tWRRD, "WRA", DependencyType::IntraRank, "tWRRD"}, + {tWRRD_R, "WRA", DependencyType::InterRank, "tWRRD_R"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, + {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, + {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, + {tCCD, "WR", DependencyType::IntraBank, "tCCD"}, + {tCCD, "WR", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, + {tCCD, "WRA", DependencyType::IntraRank, "tCCD"}, + {tBURST + tRTRS, "WRA", DependencyType::InterRank, "tBURST + tRTRS"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {4 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFPB"), + forward_as_tuple( + initializer_list{ + {tRCpb + 2 * tCK, "ACT", DependencyType::IntraBank, "tRCpb + 2 * tCK"}, + {tRRD + 2 * tCK, "ACT", DependencyType::IntraRank, "tRRD + 2 * tCK"}, + {tRDPRE + tRPpb, "RDA", DependencyType::IntraBank, "tRDPRE + tRPpb"}, + {tWRPRE + tRPpb, "WRA", DependencyType::IntraBank, "tWRPRE + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraBank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {tRFCpb, "REFPB", DependencyType::IntraBank, "tRFCpb"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + {tFAW, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRCpb + 2 * tCK, "ACT", DependencyType::IntraRank, "tRCpb + 2 * tCK"}, + {tRDPRE + tRPpb, "RDA", DependencyType::IntraRank, "tRDPRE + tRPpb"}, + {tWRPRE + tRPpb, "WRA", DependencyType::IntraRank, "tWRPRE + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraRank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + 2 * tCK, "ACT", DependencyType::IntraRank, "tRAS + 2 * tCK"}, + {tRDPRE, "RD", DependencyType::IntraRank, "tRDPRE"}, + {tRDPRE, "RDA", DependencyType::IntraRank, "tRDPRE"}, + {tWRPRE, "WR", DependencyType::IntraRank, "tWRPRE"}, + {tWRPRE, "WRA", DependencyType::IntraRank, "tWRPRE"}, + {tPPD, "PREPB", DependencyType::IntraRank, "tPPD"}, + {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEP"), + forward_as_tuple( + initializer_list{ + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tPRPDEN, "PREAB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXP", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFAB", DependencyType::IntraRank, "tREFPDEN"}, + {tREFPDEN, "REFPB", DependencyType::IntraRank, "tREFPDEN"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXP"), + forward_as_tuple( + initializer_list{ + {tCKE, "PDEP", DependencyType::IntraRank, "tCKE"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEN"), + forward_as_tuple( + initializer_list{ + {tRCpb + 2 * tCK, "ACT", DependencyType::IntraRank, "tRCpb + 2 * tCK"}, + {max({tRDPDEN, tRDPRE + tRPpb}), "RDA", DependencyType::IntraRank, "max(tRDPDEN, tRDPRE + tRPpb)"}, + {max({tWRAPDEN, tWRPRE + tRPpb}), "WRA", DependencyType::IntraRank, "max(tWRAPDEN, tWRPRE + tRPpb)"}, + {tRPpb, "PREPB", DependencyType::IntraRank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, + {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SREFEX"), + forward_as_tuple( + initializer_list{ + {tSR, "SREFEN", DependencyType::IntraRank, "tSR"}, + {tXP, "SRPDEX", DependencyType::IntraRank, "tXP"}, + {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDEA"), + forward_as_tuple( + initializer_list{ + {tACTPDEN, "ACT", DependencyType::IntraRank, "tACTPDEN"}, + {tRDPDEN, "RD", DependencyType::IntraRank, "tRDPDEN"}, + {tRDPDEN, "RDA", DependencyType::IntraRank, "tRDPDEN"}, + {tWRPDEN, "WR", DependencyType::IntraRank, "tWRPDEN"}, + {tWRAPDEN, "WRA", DependencyType::IntraRank, "tWRAPDEN"}, + {tPRPDEN, "PREPB", DependencyType::IntraRank, "tPRPDEN"}, + {tCKE, "PDXA", DependencyType::IntraRank, "tCKE"}, + {tREFPDEN, "REFPB", DependencyType::IntraRank, "tREFPDEN"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PDXA"), + forward_as_tuple( + initializer_list{ + {tCKE, "PDEA", DependencyType::IntraRank, "tCKE"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SRPDEN"), + forward_as_tuple( + initializer_list{ + {tSREFPDEN, "SREFEN", DependencyType::IntraRank, "tSREFPDEN"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("SRPDEX"), + forward_as_tuple( + initializer_list{ + {tCKE, "SRPDEN", DependencyType::IntraRank, "tCKE"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h new file mode 100644 index 00000000..93e4406b --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h @@ -0,0 +1,68 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoLPDDR4 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + + uint tRRD; + uint tRCD; + uint tRAS; + uint tFAW; + uint tRPpb; + uint tRPab; + uint tRCpb; + uint tRCab; + uint tCCD; + uint tRTP; + uint tWR; + uint tWTR; + uint tPPD; + uint tWPRE; + uint tRPST; + uint tDQSCK; + uint tDQSS; + uint tDQS2DQ; + uint tRL; + uint tWL; + uint tRFCab; + uint tRFCpb; + uint tESCKE; + uint tSR; + uint tXSR; + uint tXP; + uint tCKE; + uint tCMDCKE; + uint tRTRS; + + uint tBURST; + uint tRDWR; + uint tRDWR_R; + uint tWRRD; + uint tWRRD_R; + uint tRDPRE; + uint tRDAACT; + uint tWRPRE; + uint tWRAACT; + uint tACTPDEN; + uint tPRPDEN; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + uint tREFPDEN; + uint tSREFPDEN; + +}; From addb7aae31c1be00845c96b705a39315c25ecc69 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Fri, 11 Mar 2022 10:00:24 +0100 Subject: [PATCH 108/121] Added DDR5 dependencies. Must be double checked. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 + .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 1 + .../specialized/DDR5Configuration.cpp | 16 + .../specialized/DDR5Configuration.h | 14 + .../specialized/DDR5dbphaseentry.cpp | 55 +++ .../dbEntries/specialized/DDR5dbphaseentry.h | 18 + .../specialized/TimeDependenciesInfoDDR5.cpp | 373 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR5.h | 109 +++++ .../phasedependenciestracker.cpp | 2 +- 10 files changed, 600 insertions(+), 1 deletion(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 13130e54..e9b0da4e 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -136,6 +136,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp + businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp + businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 6700934b..9d731976 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -50,6 +50,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } else if (deviceName == "LPDDR4") { return std::make_shared(tdb); + } else if (deviceName == "DDR5") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -74,6 +77,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "LPDDR4") { return TimeDependenciesInfoLPDDR4::getPossiblePhases(); + } else if (deviceName == "DDR5") { + return TimeDependenciesInfoDDR5::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -98,6 +104,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "LPDDR4") { return true; + } else if (deviceName == "DDR5") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index 4198a68a..7b252277 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -43,6 +43,7 @@ #include "specialized/DDR4Configuration.h" #include "specialized/HBM2Configuration.h" #include "specialized/LPDDR4Configuration.h" +#include "specialized/DDR5Configuration.h" #include "data/tracedb.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp new file mode 100644 index 00000000..a5b412ee --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -0,0 +1,16 @@ + +#include "DDR5Configuration.h" +#include + +DDR5Configuration::DDR5Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { + auto phase = std::make_shared(query); + + std::dynamic_pointer_cast(mDeviceDeps)->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); + + return phase; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h new file mode 100644 index 00000000..e1ca0634 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h @@ -0,0 +1,14 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h" + +class DDR5Configuration : public ConfigurationIF { + public: + DDR5Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp new file mode 100644 index 00000000..b7533b8f --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -0,0 +1,55 @@ + +#include "DDR5dbphaseentry.h" + +DDR5DBPhaseEntry::DDR5DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && tBank != other->tBank + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraLogRankAndDifferentRanks = { + dep.depType == DependencyType::IntraLogicalRank + && tLogicalRank != other->tLogicalRank + }; + bool const skipOnIntraPhysRankAndDifferentRanks = { + dep.depType == DependencyType::IntraPhysicalRank + && tPhysicalRank != other->tPhysicalRank + }; + bool const skipOnIntraDIMMRankAndDifferentRanks = { + dep.depType == DependencyType::IntraDIMMRank + && tDIMMRank != other->tDIMMRank + }; + bool const skipOnInterDIMMRankAndSameRank = { + dep.depType == DependencyType::InterDIMMRank + && tDIMMRank == other->tDIMMRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraLogRankAndDifferentRanks + || skipOnIntraPhysRankAndDifferentRanks + || skipOnIntraDIMMRankAndDifferentRanks + || skipOnInterDIMMRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h new file mode 100644 index 00000000..19b35540 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -0,0 +1,18 @@ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" + +class DDR5DBPhaseEntry : public DBPhaseEntryIF { + public: + DDR5DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + + size_t tLogicalRank; + size_t tPhysicalRank; + size_t tDIMMRank; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp new file mode 100644 index 00000000..098b973d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -0,0 +1,373 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoDDR5.h" +#include + +using namespace std; + +TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { + mInitializeValues(); + + mBitsDIMMRanks = ceil(log2(mNumOfDIMMRanks)); + mBitsPhysicalRanks = ceil(log2(mNumOfPhysicalRanks)); + mBitsLogicalRanks = ceil(log2(mNumOfLogicalRanks)); + + mLogRankMask = (1 << mBitsLogicalRanks) - 1; + mPhysRankMask = ((1 << mBitsPhysicalRanks) - 1) << mBitsLogicalRanks; + mDIMMRankMask = ((1 << mBitsDIMMRanks) - 1) << mBitsPhysicalRanks << mBitsLogicalRanks; +} + +void TimeDependenciesInfoDDR5::rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const { + logRID = (rankID & mLogRankMask); + physRID = (rankID & mPhysRankMask) >> mBitsLogicalRanks; + dimmRID = (rankID & mDIMMRankMask) >> mBitsPhysicalRanks >> mBitsLogicalRanks; +} + +void TimeDependenciesInfoDDR5::mInitializeValues() { + mNumOfRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfRanks"].toInt(); + mNumOfDIMMRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfDIMMRanks"].toInt(); + mNumOfPhysicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfPhysicalRanks"].toInt(); + mNumOfLogicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfLogicalRanks"].toInt(); + + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + refMode = mMemspecJson["memarchitecturespec"].toObject()["refMode"].toInt(); + + mPools.insert({ + "CMD_BUS", { + 1, { + "ACT", + "RD", + "WR", + "RDA", + "WRA", + "PREPB", + "PREAB", + "REFAB", + } + } + }); + + mPools.insert({ + "FAW_LOGICAL", { + 4, { + "ACT", + } + } + }); + + mPools.insert({ + "FAW_PHYSICAL", { + 4, { + "ACT", + } + } + }); + + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); + tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + RBL = tCK * mMemspecJson["memtimingspec"].toObject()["BL"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tRPRE = tCK * mMemspecJson["memtimingspec"].toObject()["RPRE"].toInt(); + tRPST = tCK * mMemspecJson["memtimingspec"].toObject()["RPST"].toInt(); + tRDDQS = tCK * mMemspecJson["memtimingspec"].toObject()["RDDQS"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + WBL = tCK * mMemspecJson["memtimingspec"].toObject()["BL"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tWPST = tCK * mMemspecJson["memtimingspec"].toObject()["WPST"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tCCD_L_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L_slr"].toInt(); + tCCD_L_WR_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L_WR_slr"].toInt(); + tCCD_S_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S_slr"].toInt(); + tCCD_S_WR_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S_WR_slr"].toInt(); + tCCD_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_dlr"].toInt(); + tCCD_WR_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_WR_dlr"].toInt(); + tCCD_WR_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_WR_dpr"].toInt(); + tRRD_S_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_S_slr"].toInt(); + tRRD_L_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_L_slr"].toInt(); + tRRD_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RRD_dlr"].toInt(); + tFAW_slr = tCK * mMemspecJson["memtimingspec"].toObject()["FAW_slr"].toInt(); + tFAW_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["FAW_dlr"].toInt(); + tWTR_L = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_L"].toInt(); + tWTR_S = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_S"].toInt(); + tRFC_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC_slr"].toInt(); + tRFC_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC_dlr"].toInt(); + tRFC_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC_dpr"].toInt(); + tRFCsb_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFCsb_slr"].toInt(); + tRFCsb_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFCsb_dlr"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI"].toInt(); + tREFSBRD_slr = tCK * mMemspecJson["memtimingspec"].toObject()["REFSBRD_slr"].toInt(); + tREFSBRD_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["REFSBRD_dlr"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + UNKNOWN = tCK * mMemspecJson["memtimingspec"].toObject()["NKNOWN"].toInt(); + tCPDED = tCK * mMemspecJson["memtimingspec"].toObject()["CPDED"].toInt(); + tPD = tCK * mMemspecJson["memtimingspec"].toObject()["PD"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tACTPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["ACTPDEN"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + + tRC = tRAS + tRP; + + if (refMode == 1) { + tRFC_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC1_slr"].toInt(); + tRFC_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC1_dlr"].toInt(); + tRFC_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC1_dpr"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI1"].toInt(); + } else { + tRFC_slr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC2_slr"].toInt(); + tRFC_dlr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC2_dlr"].toInt(); + tRFC_dpr = tCK * mMemspecJson["memtimingspec"].toObject()["RFC2_dpr"].toInt(); + tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI2"].toInt(); + } + + tRD_BURST = (uint) (RBL / (float) dataRate) * tCK; + tWR_BURST = (uint) (WBL / (float) dataRate) * tCK; + tWTRA = tWR - tRTP; + tWRRDA = tWL + tWR_BURST + tWTRA; + tWRPRE = tWL + tWR_BURST + tWR; + tRDAACT = tRTP + tRP; + tWRAACT = tWRPRE + tRP; + tCCD_L_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_S_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_RTW_dlr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tRDRD_dpr = tRD_BURST + tRTRS; + tRDRD_ddr = tRD_BURST + tRTRS; + tRDWR_dpr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; + tRDWR_ddr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; + tCCD_L_WTR_slr = tWL + tWR_BURST + tWTR_L; + tCCD_S_WTR_slr = tWL + tWR_BURST + tWTR_S; + tCCD_WTR_dlr = tWL + tWR_BURST + tWTR_S; + tWRWR_dpr = max(tCCD_WR_dpr, tWR_BURST + tRTRS); + tWRWR_ddr = tWR_BURST + tRTRS; + tWRRD_dpr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; + tWRRD_ddr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; + tRDPDEN = tRL + tRD_BURST + tCK; + tWRPDEN = tWL + tWR_BURST + tWR + tCK; + tWRAPDEN = tWL + tWR_BURST + tWR + tCK; + +} + +const std::vector TimeDependenciesInfoDDR5::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFAB", + "PREAB", + "PDEP", + "PDXP", + "SREFEN", + "SREFEX", + "PDEA", + "PDXA", + }; +} + +DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRC, "ACT", DependencyType::IntraBank, "tRC"}, + {tRRD_L_slr, "ACT", DependencyType::IntraBankGroup, "tRRD_L_slr"}, + {tRRD_S_slr, "ACT", DependencyType::IntraLogicalRank, "tRRD_S_slr"}, + {tRRD_dlr, "ACT", DependencyType::IntraPhysicalRank, "tRRD_dlr"}, + {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, + {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, + {tRP - tCK, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, + {tRP - tCK, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, + {tRFC_slr - tCK, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + {tFAW_slr, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {tRTP + tCK, "RD", DependencyType::IntraBank, "tRTP + tCK"}, + {tWRPRE + tCK, "WR", DependencyType::IntraBank, "tWRPRE + tCK"}, + {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, + {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, + {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tWRRDA, "WR", DependencyType::IntraBank, "tWRRDA"}, + {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, + {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, + {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRC + tCK, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, + {tRDAACT + tCK, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, + {tWRPRE + tRP + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tRP, "PREPB", DependencyType::IntraLogicalRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraLogicalRank, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraLogicalRank, "tRAS + tCK"}, + {tRTP + tCK, "RD", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tRTP + tCK, "RDA", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tWRPRE + tCK, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tWRPRE + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h new file mode 100644 index 00000000..a243090e --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -0,0 +1,109 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesIF.h" + +class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesIF { + public: + TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + void rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const; + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint mNumOfRanks; + uint mNumOfDIMMRanks; + uint mNumOfPhysicalRanks; + uint mNumOfLogicalRanks; + + uint burstLength; + uint dataRate; + uint refMode; + + uint tRCD; + uint tPPD; + uint tRP; + uint tRAS; + uint tRC; + uint tRL; + uint RBL; + uint tRTP; + uint tRPRE; + uint tRPST; + uint tRDDQS; + uint tWL; + uint WBL; + uint tWPRE; + uint tWPST; + uint tWR; + uint tCCD_L_slr; + uint tCCD_L_WR_slr; + uint tCCD_S_slr; + uint tCCD_S_WR_slr; + uint tCCD_dlr; + uint tCCD_WR_dlr; + uint tCCD_WR_dpr; + uint tRRD_S_slr; + uint tRRD_L_slr; + uint tRRD_dlr; + uint tFAW_slr; + uint tFAW_dlr; + uint tWTR_L; + uint tWTR_S; + uint tRFC_slr; + uint tRFC_dlr; + uint tRFC_dpr; + uint tRFCsb_slr; + uint tRFCsb_dlr; + uint tREFI; + uint tREFSBRD_slr; + uint tREFSBRD_dlr; + uint tRTRS; + uint UNKNOWN; + uint tCPDED; + uint tPD; + uint tXP; + uint tACTPDEN; + uint tPRPDEN; + uint tREFPDEN; + + uint tRD_BURST; + uint tWR_BURST; + uint tWTRA; + uint tWRRDA; + uint tWRPRE; + uint tRDAACT; + uint tWRAACT; + uint tCCD_L_RTW_slr; + uint tCCD_S_RTW_slr; + uint tCCD_RTW_dlr; + uint tRDRD_dpr; + uint tRDRD_ddr; + uint tRDWR_dpr; + uint tRDWR_ddr; + uint tCCD_L_WTR_slr; + uint tCCD_S_WTR_slr; + uint tCCD_WTR_dlr; + uint tWRWR_dpr; + uint tWRWR_ddr; + uint tWRRD_dpr; + uint tWRRD_ddr; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + + protected: + uint mBitsDIMMRanks; + uint mBitsPhysicalRanks; + uint mBitsLogicalRanks; + uint mLogRankMask; + uint mPhysRankMask; + uint mDIMMRankMask; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index 9c0fb5fe..a5334f19 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -212,7 +212,7 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrgetDependencies(commands); + const DependencyMap deviceDependencies = deviceConfig->getDependencies(commands); // Tries to find all timing dependencies for each phase on the trace PoolControllerMap poolController = deviceConfig->getPools(); From 866ccd77643e5278c65d4a62947d0e3620345c78 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Wed, 16 Mar 2022 10:42:22 +0100 Subject: [PATCH 109/121] Modified DDR5 to comply with time checker. --- .../common/StringMapper.cpp | 8 + .../common/StringMapper.h | 56 ++-- .../specialized/TimeDependenciesInfoDDR5.cpp | 274 ++++++++++++++++-- .../specialized/TimeDependenciesInfoDDR5.h | 9 + 4 files changed, 290 insertions(+), 57 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index 450410bf..c6cd1e33 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -35,6 +35,10 @@ QString StringMapper::getIDStr(StringMapper::Identifier id) { {StringMapper::Identifier::RDA, "RDA"}, {StringMapper::Identifier::WRA, "WRA"}, {StringMapper::Identifier::REFPB, "REFPB"}, + {StringMapper::Identifier::PRESB, "PRESB"}, + {StringMapper::Identifier::RFMAB, "RFMAB"}, + {StringMapper::Identifier::REFSB, "REFSB"}, + {StringMapper::Identifier::RFMSB, "RFMSB"}, }; auto it = enumToStr.find(id); @@ -70,6 +74,10 @@ StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { {"RDA", StringMapper::Identifier::RDA}, {"WRA", StringMapper::Identifier::WRA}, {"REFPB", StringMapper::Identifier::REFPB}, + {"PRESB", StringMapper::Identifier::PRESB}, + {"RFMAB", StringMapper::Identifier::RFMAB}, + {"REFSB", StringMapper::Identifier::REFSB}, + {"RFMSB", StringMapper::Identifier::RFMSB}, }; auto it = strToEnum.find(id); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index b4034cd1..b372c0c2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -7,32 +7,36 @@ class StringMapper { public: enum Identifier { - None, - CMD_BUS, - RAS_BUS, - CAS_BUS, - NAW, - FAW, - _32AW, - FAW_LOGICAL, - FAW_PHYSICAL, - REFAB, - PREAB, - PDEP, - PDXP, - SREFEN, - SREFEX, - PDEA, - PDXA, - SRPDEN, - SRPDEX, - ACT, - RD, - WR, - PREPB, - RDA, - WRA, - REFPB + None, + CMD_BUS, + RAS_BUS, + CAS_BUS, + NAW, + FAW, + _32AW, + FAW_LOGICAL, + FAW_PHYSICAL, + REFAB, + PREAB, + PDEP, + PDXP, + SREFEN, + SREFEX, + PDEA, + PDXA, + SRPDEN, + SRPDEX, + ACT, + RD, + WR, + PREPB, + RDA, + WRA, + REFPB, + PRESB, + RFMAB, + REFSB, + RFMSB }; public: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 098b973d..1033f910 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -32,6 +32,8 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); refMode = mMemspecJson["memarchitecturespec"].toObject()["refMode"].toInt(); + cmdMode = mMemspecJson["memarchitecturespec"].toObject()["cmdMode"].toInt(); + bitWidth = mMemspecJson["memarchitecturespec"].toObject()["width"].toInt(); mPools.insert({ "CMD_BUS", { @@ -44,6 +46,10 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { "PREPB", "PREAB", "REFAB", + "PRESB", + "RFMAB", + "REFSB", + "RFMSB", } } }); @@ -52,6 +58,8 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { "FAW_LOGICAL", { 4, { "ACT", + "REFSB", + "RFMSB", } } }); @@ -60,6 +68,8 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { "FAW_PHYSICAL", { 4, { "ACT", + "REFSB", + "RFMSB", } } }); @@ -124,30 +134,45 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { tREFI = tCK * mMemspecJson["memtimingspec"].toObject()["REFI2"].toInt(); } + if (cmdMode == 2) { + shortCmdOffset = 1 * tCK; + longCmdOffset = 3 * tCK; + } else { + shortCmdOffset = 0 * tCK; + longCmdOffset = 1 * tCK; + } + + cmdLengthDiff = tCK * mMemspecJson["memarchitecturespec"].toObject()["cmdMode"].toInt(); + if (!(burstLength == 16 && bitWidth == 4)) + tCCD_L_WR_slr = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L_WR2_slr"].toInt(); + + tBURST16 = 8 * tCK; + tBURST32 = 16 * tCK; + tRD_BURST = (uint) (RBL / (float) dataRate) * tCK; tWR_BURST = (uint) (WBL / (float) dataRate) * tCK; tWTRA = tWR - tRTP; - tWRRDA = tWL + tWR_BURST + tWTRA; - tWRPRE = tWL + tWR_BURST + tWR; + tWRRDA = tWL + tBURST16 + tWTRA; + tWRPRE = tWL + tBURST16 + tWR; tRDAACT = tRTP + tRP; tWRAACT = tWRPRE + tRP; - tCCD_L_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; - tCCD_S_RTW_slr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; - tCCD_RTW_dlr = tRL - tWL + tRD_BURST + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_L_RTW_slr = tRL - tWL + tBURST16 + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_S_RTW_slr = tRL - tWL + tBURST16 + 2 * tCK - tRDDQS + tRPST + tWPRE; + tCCD_RTW_dlr = tRL - tWL + tBURST16 + 2 * tCK - tRDDQS + tRPST + tWPRE; tRDRD_dpr = tRD_BURST + tRTRS; tRDRD_ddr = tRD_BURST + tRTRS; tRDWR_dpr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; tRDWR_ddr = tRL - tWL + tRD_BURST + tRTRS - tRDDQS + tRPST + tWPRE; - tCCD_L_WTR_slr = tWL + tWR_BURST + tWTR_L; - tCCD_S_WTR_slr = tWL + tWR_BURST + tWTR_S; - tCCD_WTR_dlr = tWL + tWR_BURST + tWTR_S; - tWRWR_dpr = max(tCCD_WR_dpr, tWR_BURST + tRTRS); - tWRWR_ddr = tWR_BURST + tRTRS; - tWRRD_dpr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; - tWRRD_ddr = tWL - tRL + tWR_BURST + tRTRS + tRDDQS + tWPST + tRPRE; - tRDPDEN = tRL + tRD_BURST + tCK; - tWRPDEN = tWL + tWR_BURST + tWR + tCK; - tWRAPDEN = tWL + tWR_BURST + tWR + tCK; + tCCD_L_WTR_slr = tWL + tBURST16 + tWTR_L; + tCCD_S_WTR_slr = tWL + tBURST16 + tWTR_S; + tCCD_WTR_dlr = tWL + tBURST16 + tWTR_S; + tWRWR_dpr = max(tCCD_WR_dpr, tBURST16 + tRTRS); + tWRWR_ddr = tBURST16 + tRTRS; + tWRRD_dpr = tWL - tRL + tBURST16 + tRTRS + tRDDQS + tWPST + tRPRE; + tWRRD_ddr = tWL - tRL + tBURST16 + tRTRS + tRDDQS + tWPST + tRPRE; + tRDPDEN = tRL + tBURST16 + cmdLengthDiff; + tWRPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; + tWRAPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; } @@ -156,9 +181,13 @@ const std::vector TimeDependenciesInfoDDR5::getPossiblePhases() { "ACT", "RD", "WR", + "PRESB", "PREPB", "RDA", "WRA", + "RFMAB", + "REFSB", + "RFMSB", "REFAB", "PREAB", "PDEP", @@ -184,12 +213,21 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tRRD_dlr, "ACT", DependencyType::IntraPhysicalRank, "tRRD_dlr"}, {tRDAACT, "RDA", DependencyType::IntraBank, "tRDAACT"}, {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, - {tRP - tCK, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, - {tRP - tCK, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, - {tRFC_slr - tCK, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {tWRAACT + tBURST16, "WRA", DependencyType::IntraBank, "tWRAACT + tBURST16"}, + {tRP - cmdLengthDiff, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, + {tRP - cmdLengthDiff, "PRESB", DependencyType::IntraBankGroup, "tRP - tCK"}, + {tRP - cmdLengthDiff, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, + {tRFC_slr - cmdLengthDiff, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {tRFC_slr - cmdLengthDiff, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "REFSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tREFSBRD_slr - cmdLengthDiff, "REFSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, + {tREFSBRD_dlr - cmdLengthDiff, "REFSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tREFSBRD_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, + {tREFSBRD_dlr - cmdLengthDiff, "RFMSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, - {tFAW_slr, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, - {tFAW_dlr, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + {tFAW_slr - longCmdOffset, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr - longCmdOffset, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, } ) ); @@ -203,23 +241,39 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -232,25 +286,42 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { initializer_list{ {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_L_WR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr + tBURST16"}, {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -261,11 +332,13 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("PREPB"), forward_as_tuple( initializer_list{ - {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, - {tRTP + tCK, "RD", DependencyType::IntraBank, "tRTP + tCK"}, - {tWRPRE + tCK, "WR", DependencyType::IntraBank, "tWRPRE + tCK"}, + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBank, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBank, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBank, "tWRPRE + tCK + tBURST16"}, {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PRESB", DependencyType::IntraPhysicalRank, "tPPD"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -280,24 +353,41 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tCCD_L_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RD", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tCCD_L_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_slr"}, {tCCD_S_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_slr"}, {tCCD_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr"}, + {tCCD_dlr + tBURST32, "RDA", DependencyType::IntraPhysicalRank, "tCCD_dlr + tBURST32"}, {tRDRD_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr"}, + {tRDRD_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDRD_dpr + tBURST16"}, {tRDRD_ddr, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr"}, + {tRDRD_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDRD_ddr + tBURST16"}, {tWRRDA, "WR", DependencyType::IntraBank, "tWRRDA"}, + {tWRRDA + tBURST16, "WR", DependencyType::IntraBank, "tWRRDA + tBURST16"}, {tCCD_L_WTR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WR", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WR", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {tCCD_L_WTR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr"}, + {tCCD_L_WTR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WTR_slr + tBURST16"}, {tCCD_S_WTR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr"}, + {tCCD_S_WTR_slr + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WTR_slr + tBURST16"}, {tCCD_WTR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr"}, + {tCCD_WTR_dlr + tBURST16, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WTR_dlr + tBURST16"}, {tWRRD_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr"}, + {tWRRD_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRRD_dpr + tBURST16"}, {tWRRD_ddr, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr"}, + {tWRRD_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRRD_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -310,25 +400,42 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { initializer_list{ {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, {tCCD_L_RTW_slr, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RD", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RD", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RD", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RD", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RD", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_RTW_slr, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr"}, + {tCCD_L_RTW_slr + tBURST16, "RDA", DependencyType::IntraBankGroup, "tCCD_L_RTW_slr + tBURST16"}, {tCCD_S_RTW_slr, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr"}, + {tCCD_S_RTW_slr + tBURST16, "RDA", DependencyType::IntraLogicalRank, "tCCD_S_RTW_slr + tBURST16"}, {tCCD_RTW_dlr, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr"}, + {tCCD_RTW_dlr + tBURST16, "RDA", DependencyType::IntraPhysicalRank, "tCCD_RTW_dlr + tBURST16"}, {tRDWR_dpr, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr"}, + {tRDWR_dpr + tBURST16, "RDA", DependencyType::IntraDIMMRank, "tRDWR_dpr + tBURST16"}, {tRDWR_ddr, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr"}, + {tRDWR_ddr + tBURST16, "RDA", DependencyType::InterDIMMRank, "tRDWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WR", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, {tCCD_S_WR_slr, "WR", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WR", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WR", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WR", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {tCCD_L_WR_slr, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr"}, + {tCCD_L_WR_slr + tBURST16, "WRA", DependencyType::IntraBankGroup, "tCCD_L_WR_slr + tBURST16"}, {tCCD_S_WR_slr, "WRA", DependencyType::IntraLogicalRank, "tCCD_S_WR_slr"}, {tCCD_WR_dlr, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr"}, + {tCCD_WR_dlr + tBURST32, "WRA", DependencyType::IntraPhysicalRank, "tCCD_WR_dlr + tBURST32"}, {tWRWR_dpr, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr"}, + {tWRWR_dpr + tBURST16, "WRA", DependencyType::IntraDIMMRank, "tWRWR_dpr + tBURST16"}, {tWRWR_ddr, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr"}, + {tWRWR_ddr + tBURST16, "WRA", DependencyType::InterDIMMRank, "tWRWR_ddr + tBURST16"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) @@ -339,29 +446,134 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("REFAB"), forward_as_tuple( initializer_list{ - {tRC + tCK, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, - {tRDAACT + tCK, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, - {tWRPRE + tRP + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, + {tWRPRE + tRP + cmdLengthDiff, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tWRPRE + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK + tBURST16"}, {tRP, "PREPB", DependencyType::IntraLogicalRank, "tRP"}, {tRP, "PREAB", DependencyType::IntraLogicalRank, "tRP"}, {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, } ) ); + dmap.emplace( + piecewise_construct, + forward_as_tuple("RFMAB"), + forward_as_tuple( + initializer_list{ + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRC + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraPhysicalRank, "tRDAACT + tCK"}, + {tWRPRE + tRP + cmdLengthDiff, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK"}, + {tWRPRE + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraLogicalRank, "tRP"}, + {tRP, "PREAB", DependencyType::IntraLogicalRank, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFSB"), + forward_as_tuple( + initializer_list{ + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRC + tCK"}, + {tRRD_L_slr + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRRD_L_slr + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRDAACT + tCK"}, + {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK"}, + {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraBankGroup, "tRP"}, + {tRP, "PRESB", DependencyType::IntraBankGroup, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFCsb_slr, "REFSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "REFSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tRFCsb_slr, "RFMSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "RFMSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + {tFAW_slr - shortCmdOffset, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr - shortCmdOffset, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RFMSB"), + forward_as_tuple( + initializer_list{ + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRC + tCK"}, + {tRRD_L_slr + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRRD_L_slr + tCK"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRDAACT + tCK"}, + {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK"}, + {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraBankGroup, "tRP"}, + {tRP, "PRESB", DependencyType::IntraBankGroup, "tRP"}, + {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFC_slr, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, + {tRFC_dlr, "RFMAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, + {tRFC_dpr, "RFMAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, + {tRFCsb_slr, "REFSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "REFSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tRFCsb_slr, "RFMSB", DependencyType::IntraLogicalRank, "tRFCsb_slr"}, + {tRFCsb_dlr, "RFMSB", DependencyType::IntraPhysicalRank, "tRFCsb_dlr"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + {tFAW_slr - shortCmdOffset, "FAW_LOGICAL", DependencyType::IntraLogicalRank, "tFAW_slr"}, + {tFAW_dlr - shortCmdOffset, "FAW_PHYSICAL", DependencyType::IntraPhysicalRank, "tFAW_dlr"}, + } + ) + ); + dmap.emplace( piecewise_construct, forward_as_tuple("PREAB"), forward_as_tuple( initializer_list{ - {tRAS + tCK, "ACT", DependencyType::IntraLogicalRank, "tRAS + tCK"}, - {tRTP + tCK, "RD", DependencyType::IntraLogicalRank, "tRTP + tCK"}, - {tRTP + tCK, "RDA", DependencyType::IntraLogicalRank, "tRTP + tCK"}, - {tWRPRE + tCK, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, - {tWRPRE + tCK, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraLogicalRank, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraLogicalRank, "tWRPRE + tCK + tBURST16"}, + {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraLogicalRank, "tWRPRE + tCK + tBURST16"}, + {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, + {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PRESB"), + forward_as_tuple( + initializer_list{ + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBankGroup, "tRTP + tCK"}, + {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, + {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index a243090e..24b80eec 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -98,6 +98,15 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesIF { uint tWRPDEN; uint tWRAPDEN; + uint cmdMode; + uint bitWidth; + uint cmdLengthDiff; + uint shortCmdOffset; + uint longCmdOffset; + + uint tBURST16; + uint tBURST32; + protected: uint mBitsDIMMRanks; uint mBitsPhysicalRanks; From 6850cd14226631e288cd508356fc3838e02c1934 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 17 Mar 2022 11:03:14 +0100 Subject: [PATCH 110/121] Added copyright notice. --- .../common/QStringComparator.cpp | 34 ++++++++++++++++++ .../common/QStringComparator.h | 34 ++++++++++++++++++ .../common/StringMapper.cpp | 34 ++++++++++++++++++ .../common/StringMapper.h | 34 ++++++++++++++++++ .../common/timedependency.h | 34 ++++++++++++++++++ .../configurations/configurationIF.cpp | 34 ++++++++++++++++++ .../configurations/configurationIF.h | 34 ++++++++++++++++++ .../specialized/DDR3Configuration.cpp | 34 ++++++++++++++++++ .../specialized/DDR3Configuration.h | 34 ++++++++++++++++++ .../specialized/DDR4Configuration.cpp | 34 ++++++++++++++++++ .../specialized/DDR4Configuration.h | 34 ++++++++++++++++++ .../specialized/DDR5Configuration.cpp | 34 ++++++++++++++++++ .../specialized/DDR5Configuration.h | 34 ++++++++++++++++++ .../specialized/HBM2Configuration.cpp | 34 ++++++++++++++++++ .../specialized/HBM2Configuration.h | 34 ++++++++++++++++++ .../specialized/LPDDR4Configuration.cpp | 34 ++++++++++++++++++ .../specialized/LPDDR4Configuration.h | 34 ++++++++++++++++++ .../dbEntries/dbphaseentryIF.h | 34 ++++++++++++++++++ .../specialized/DDR3dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/DDR3dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/DDR4dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/DDR4dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/DDR5dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/DDR5dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/HBM2dbphaseentry.cpp | 34 ++++++++++++++++++ .../dbEntries/specialized/HBM2dbphaseentry.h | 34 ++++++++++++++++++ .../specialized/LPDDR4dbphaseentry.cpp | 34 ++++++++++++++++++ .../specialized/LPDDR4dbphaseentry.h | 35 +++++++++++++++++++ .../deviceDependencies/poolcontroller.cpp | 34 ++++++++++++++++++ .../deviceDependencies/poolcontroller.h | 34 ++++++++++++++++++ .../specialized/TimeDependenciesInfoDDR3.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR3.h | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR4.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR4.h | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR5.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoDDR5.h | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoHBM2.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoHBM2.h | 35 ++++++++++++++++++- .../TimeDependenciesInfoLPDDR4.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoLPDDR4.h | 35 ++++++++++++++++++- 40 files changed, 1361 insertions(+), 10 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp index a56a891c..f3d3128e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "QStringComparator.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h index 4f6fc913..479eecae 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/QStringComparator.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index c6cd1e33..5e74151a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "StringMapper.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index b372c0c2..2464afcc 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h index 06a4750f..7fd828fc 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/timedependency.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp index 35c96028..d41e5cad 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "configurationIF.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h index 38595563..440e0dc8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp index abe11bf8..934ab61a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR3Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index 8b0e5abd..ebd8d195 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp index ce696152..2cef13f2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR4Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h index 992e8df2..7534bcb6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp index a5b412ee..5f0022e6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR5Configuration.h" #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h index e1ca0634..6025f15c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp index 0ba89bae..d746eadd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "HBM2Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h index 5abbaa37..3cf77a1f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp index a091c516..bc328d81 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "LPDDR4Configuration.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h index 448d7ddb..f7587a93 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h index 3d61939e..fd62a755 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index 61a22bb9..add142ae 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR3dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h index b312e59f..904ee54f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp index 611ac9b7..2dc988a2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR4dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h index 7f53fe6c..94e65857 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp index b7533b8f..b1d2f3e3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "DDR5dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h index 19b35540..651b8fb3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp index 09e2a38a..1c0b039e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "HBM2dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h index 541693fd..d3b6c24a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp index 4bd416d7..d16e296b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "LPDDR4dbphaseentry.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h index 4bec8806..e2612bce 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h @@ -1,4 +1,39 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + #pragma once #include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp index 813fc687..b54fcc84 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "poolcontroller.h" #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index 262d4997..17f7aefb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -1,3 +1,37 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp index 0bc82412..5b68f4fd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoDDR3.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h index 28d36a87..b1b5bd73 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index 287239af..9a6a89c5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoDDR4.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h index 5b89e31a..f6366603 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 1033f910..58020485 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoDDR5.h" #include diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index 24b80eec..a3b587b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp index 977de023..790a4ed7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoHBM2.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h index f4c9f523..8ec86bb8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 57c5a94b..8f988584 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoLPDDR4.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h index 93e4406b..20613bb1 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once From c00b54329a44dc592c9a738cf013f810b288ae59 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 17 Mar 2022 12:06:02 +0100 Subject: [PATCH 111/121] Renamed some objects from suffix IF to suffix Base. Added a small readme to the 'dramTimeDependencies' folder. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 +- .../dramTimeDependencies/README.md | 53 +++++++++++++++++++ ...figurationIF.cpp => configurationBase.cpp} | 20 +++---- ...{configurationIF.h => configurationBase.h} | 14 ++--- .../configurations/configurationfactory.cpp | 8 +-- .../configurations/configurationfactory.h | 4 +- .../specialized/DDR3Configuration.cpp | 2 +- .../specialized/DDR3Configuration.h | 6 +-- .../specialized/DDR4Configuration.cpp | 2 +- .../specialized/DDR4Configuration.h | 6 +-- .../specialized/DDR5Configuration.cpp | 2 +- .../specialized/DDR5Configuration.h | 6 +-- .../specialized/HBM2Configuration.cpp | 2 +- .../specialized/HBM2Configuration.h | 6 +-- .../specialized/LPDDR4Configuration.cpp | 2 +- .../specialized/LPDDR4Configuration.h | 6 +-- .../{dbphaseentryIF.h => dbphaseentryBase.h} | 8 +-- .../specialized/DDR3dbphaseentry.cpp | 2 +- .../dbEntries/specialized/DDR3dbphaseentry.h | 6 +-- .../specialized/DDR4dbphaseentry.cpp | 2 +- .../dbEntries/specialized/DDR4dbphaseentry.h | 6 +-- .../specialized/DDR5dbphaseentry.cpp | 2 +- .../dbEntries/specialized/DDR5dbphaseentry.h | 6 +-- .../specialized/HBM2dbphaseentry.cpp | 2 +- .../dbEntries/specialized/HBM2dbphaseentry.h | 6 +-- .../specialized/LPDDR4dbphaseentry.cpp | 2 +- .../specialized/LPDDR4dbphaseentry.h | 6 +-- ...iesIF.cpp => dramtimedependenciesbase.cpp} | 14 ++--- ...denciesIF.h => dramtimedependenciesbase.h} | 6 +-- .../specialized/DDR3TimeDependencies.cpp | 2 +- .../specialized/DDR3TimeDependencies.h | 4 +- .../specialized/TimeDependenciesInfoDDR3.cpp | 2 +- .../specialized/TimeDependenciesInfoDDR3.h | 4 +- .../specialized/TimeDependenciesInfoDDR4.cpp | 2 +- .../specialized/TimeDependenciesInfoDDR4.h | 4 +- .../specialized/TimeDependenciesInfoDDR5.cpp | 2 +- .../specialized/TimeDependenciesInfoDDR5.h | 4 +- .../specialized/TimeDependenciesInfoHBM2.cpp | 2 +- .../specialized/TimeDependenciesInfoHBM2.h | 4 +- .../TimeDependenciesInfoLPDDR4.cpp | 2 +- .../specialized/TimeDependenciesInfoLPDDR4.h | 4 +- .../phasedependenciestracker.cpp | 8 +-- .../phasedependenciestracker.h | 4 +- 43 files changed, 156 insertions(+), 103 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{configurationIF.cpp => configurationBase.cpp} (82%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/{configurationIF.h => configurationBase.h} (87%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/{dbphaseentryIF.h => dbphaseentryBase.h} (91%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{dramtimedependenciesIF.cpp => dramtimedependenciesbase.cpp} (88%) rename DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/{dramtimedependenciesIF.h => dramtimedependenciesbase.h} (95%) diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index e9b0da4e..ace0383f 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -116,8 +116,8 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/common/StringMapper.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp - businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp - businessObjects/dramTimeDependencies/configurations/configurationIF.cpp + businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp + businessObjects/dramTimeDependencies/configurations/configurationBase.cpp businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp # businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md new file mode 100644 index 00000000..43efabe9 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/README.md @@ -0,0 +1,53 @@ + +## Relevant classes +``` +PhaseDependenciesTracker +├── ConfigurationFactory +│   └── ConfigurationBase +│   ├── DBPhaseEntryBase +│   └── DRAMTimeDependenciesBase +│   ├── DependencyMap +│   │   └── PhaseTimeDependencies +│   └── PoolControllerMap +└── DBDependencyEntry +``` + +#### PhaseDependenciesTracker +Responsible for the whole execution. Instantiates a configuration class through the ConfigurationFactory, loads the selected phases into memory, calculates the time dependencies between phases and saves into the database file. + +#### ConfigurationFactory +Creates a configuration object given its name. + +#### ConfigurationBase +Interface and common functionality of configuration classes. These include creating DBPhaseEntryBase objects from the database for the given device and delegate methods. + +#### DBPhaseEntryBase +Interfaces to device specific phase entries. Specificities include object data, construction and dependency logic. + +#### DRAMTimeDependenciesBase +Interfaces to device's time dependencies descriptor class. + +#### DependencyMap +A STL map using auxiliar objects. Maps phases to their PhaseTimeDependencies. + +#### PhaseTimeDependencies +An auxiliar class with initializer list constructor. Contains a vector of TimeDependency objects and its maximum time value. + +#### PoolControllerMap +Maps pool names to PoolController objects. Pools keep track of all potential dependencies of a given phase. + +#### DBDependencyEntry +Contains the data to be written to the database. + + +## Suggested steps for creating a device: +1. Create a time dependencies class inheriting from the DRAMTimeDependenciesBase object. +2. Create the phase entry object inheriting from DBPhaseEntryBase. The object must determine the relevant data to be used and how phases may be correlated. +3. Create a configuration class for your object inheriting from ConfigurationBase. This will contain the dependencies maps and instantiate the specialized DBPhaseEntryBase object. +4. Add the newly created device to the functions of the ConfigurationFactory class. The device name is taken from the database. + +#### Example +For instance, we have the necessary objects for calculating DDR3 device dependencies implemented in the following files: +1. deviceDependencies/specialized/TimeDependenciesInfoDDR3.(h/cpp) +2. dbEntries/specialized/DDR3dbphaseentry.(h/cpp) +3. configurations/specialized/DDR3Configuration.(h/cpp) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.cpp similarity index 82% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.cpp index d41e5cad..1f4e62d0 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.cpp @@ -33,34 +33,34 @@ * Iron Prando da Silva */ -#include "configurationIF.h" +#include "configurationBase.h" -const uint ConfigurationIF::getClk() const { +const uint ConfigurationBase::getClk() const { if (!mDeviceDeps) - throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getClk'."); + throw std::invalid_argument("Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getClk'."); return mDeviceDeps->getClk(); } -DependencyMap ConfigurationIF::getDependencies(std::vector& commands) const { +DependencyMap ConfigurationBase::getDependencies(std::vector& commands) const { if (!mDeviceDeps) - throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getDependencies'."); + throw std::invalid_argument("Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getDependencies'."); return mDeviceDeps->getDependencies(commands); } -PoolControllerMap ConfigurationIF::getPools() const { +PoolControllerMap ConfigurationBase::getPools() const { if (!mDeviceDeps) - throw std::invalid_argument("Invalid DRAMTimeDependenciesIF object in 'ConfigurationIF::getAWPools'."); + throw std::invalid_argument("Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getAWPools'."); return mDeviceDeps->getPools(); } -const QString ConfigurationIF::getDeviceName(const TraceDB& tdb) { +const QString ConfigurationBase::getDeviceName(const TraceDB& tdb) { return mGetMemspec(tdb)["memoryType"].toString(); } -const uint ConfigurationIF::mGetClk(const TraceDB& tdb) { +const uint ConfigurationBase::mGetClk(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT clk FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); @@ -72,7 +72,7 @@ const uint ConfigurationIF::mGetClk(const TraceDB& tdb) { return clock; } -const QJsonObject ConfigurationIF::mGetMemspec(const TraceDB& tdb) { +const QJsonObject ConfigurationBase::mGetMemspec(const TraceDB& tdb) { QSqlDatabase db = tdb.getDatabase(); QString query = "SELECT Memspec FROM GeneralInfo"; QSqlQuery sqlQuery = db.exec(query); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.h similarity index 87% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.h index 440e0dc8..a9eb54e7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationBase.h @@ -37,15 +37,15 @@ #include -#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class ConfigurationIF { +class ConfigurationBase { public: - ConfigurationIF() {}; - virtual ~ConfigurationIF() = default; + ConfigurationBase() {}; + virtual ~ConfigurationBase() = default; - virtual std::shared_ptr makePhaseEntry(const QSqlQuery&) const { return nullptr; } + virtual std::shared_ptr makePhaseEntry(const QSqlQuery&) const { return nullptr; } // Delegated methods const uint getClk() const; @@ -55,7 +55,7 @@ class ConfigurationIF { static const QString getDeviceName(const TraceDB& tdb); protected: - std::shared_ptr mDeviceDeps = nullptr; + std::shared_ptr mDeviceDeps = nullptr; static const uint mGetClk(const TraceDB& tdb); static const QJsonObject mGetMemspec(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 9d731976..48d4d553 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -35,8 +35,8 @@ #include "configurationfactory.h" -std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) { - const QString deviceName = ConfigurationIF::getDeviceName(tdb); +std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) { + const QString deviceName = ConfigurationBase::getDeviceName(tdb); if (deviceName == "DDR3") { return std::make_shared(tdb); @@ -62,7 +62,7 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb) } const std::vector ConfigurationFactory::possiblePhases(const TraceDB& tdb) { - const QString deviceName = ConfigurationIF::getDeviceName(tdb); + const QString deviceName = ConfigurationBase::getDeviceName(tdb); if (deviceName == "DDR3") { // return DDR3TimeDependencies::getPossiblePhases(); @@ -90,7 +90,7 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { uint clk; // Not used - const QString deviceName = ConfigurationIF::getDeviceName(tdb); + const QString deviceName = ConfigurationBase::getDeviceName(tdb); if (deviceName == "DDR3") { return true; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index 7b252277..d1c3eaa6 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -37,7 +37,7 @@ #include -#include "configurationIF.h" +#include "configurationBase.h" #include "specialized/DDR3Configuration.h" #include "specialized/DDR4Configuration.h" @@ -49,7 +49,7 @@ class ConfigurationFactory { public: - static std::shared_ptr make(const TraceDB& tdb); + static std::shared_ptr make(const TraceDB& tdb); static const std::vector possiblePhases(const TraceDB& tdb); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp index 934ab61a..ce676838 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.cpp @@ -41,6 +41,6 @@ DDR3Configuration::DDR3Configuration(const TraceDB& tdb) { } -std::shared_ptr DDR3Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr DDR3Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h index ebd8d195..0d0b74db 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR3Configuration.h @@ -35,15 +35,15 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" // #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h" -class DDR3Configuration : public ConfigurationIF { +class DDR3Configuration : public ConfigurationBase { public: DDR3Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp index 2cef13f2..d36d11f3 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.cpp @@ -40,6 +40,6 @@ DDR4Configuration::DDR4Configuration(const TraceDB& tdb) { } -std::shared_ptr DDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr DDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h index 7534bcb6..f089b2e2 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR4Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h" -class DDR4Configuration : public ConfigurationIF { +class DDR4Configuration : public ConfigurationBase { public: DDR4Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp index 5f0022e6..d43b27b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -41,7 +41,7 @@ DDR5Configuration::DDR5Configuration(const TraceDB& tdb) { } -std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { auto phase = std::make_shared(query); std::dynamic_pointer_cast(mDeviceDeps)->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h index 6025f15c..700e6af9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h" -class DDR5Configuration : public ConfigurationIF { +class DDR5Configuration : public ConfigurationBase { public: DDR5Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp index d746eadd..59586627 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.cpp @@ -40,6 +40,6 @@ HBM2Configuration::HBM2Configuration(const TraceDB& tdb) { } -std::shared_ptr HBM2Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr HBM2Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h index 3cf77a1f..ac6297e4 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/HBM2Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h" -class HBM2Configuration : public ConfigurationIF { +class HBM2Configuration : public ConfigurationBase { public: HBM2Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp index bc328d81..b8b66f0a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.cpp @@ -41,6 +41,6 @@ LPDDR4Configuration::LPDDR4Configuration(const TraceDB& tdb) { } -std::shared_ptr LPDDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { +std::shared_ptr LPDDR4Configuration::makePhaseEntry(const QSqlQuery& query) const { return std::make_shared(query); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h index f7587a93..5882a0b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR4Configuration.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/configurations/configurationIF.h" +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" #include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h" #include "businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h" -class LPDDR4Configuration : public ConfigurationIF { +class LPDDR4Configuration : public ConfigurationBase { public: LPDDR4Configuration(const TraceDB& tdb); - std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h similarity index 91% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h index fd62a755..81f82a22 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h @@ -40,12 +40,12 @@ #include "businessObjects/phases/phasedependency.h" #include "businessObjects/dramTimeDependencies/common/common.h" -class DBPhaseEntryIF { +class DBPhaseEntryBase { public: - DBPhaseEntryIF() = default; - virtual ~DBPhaseEntryIF() = default; + DBPhaseEntryBase() = default; + virtual ~DBPhaseEntryBase() = default; - virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } + virtual bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { return false; } size_t id; StringMapper phaseName; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp index add142ae..ab5019ab 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp @@ -46,7 +46,7 @@ DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h index 904ee54f..ed78fc98 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class DDR3DBPhaseEntry : public DBPhaseEntryIF { +class DDR3DBPhaseEntry : public DBPhaseEntryBase { public: DDR3DBPhaseEntry(const QSqlQuery&); // size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp index 2dc988a2..ce79d097 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.cpp @@ -46,7 +46,7 @@ DDR4DBPhaseEntry::DDR4DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool DDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool DDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h index 94e65857..ddf19e90 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR4dbphaseentry.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class DDR4DBPhaseEntry : public DBPhaseEntryIF { +class DDR4DBPhaseEntry : public DBPhaseEntryBase { public: DDR4DBPhaseEntry(const QSqlQuery&); size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp index b1d2f3e3..d2e95f6c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -46,7 +46,7 @@ DDR5DBPhaseEntry::DDR5DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h index 651b8fb3..6b118760 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -35,9 +35,9 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class DDR5DBPhaseEntry : public DBPhaseEntryIF { +class DDR5DBPhaseEntry : public DBPhaseEntryBase { public: DDR5DBPhaseEntry(const QSqlQuery&); @@ -48,5 +48,5 @@ class DDR5DBPhaseEntry : public DBPhaseEntryIF { size_t tPhysicalRank; size_t tDIMMRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp index 1c0b039e..6403f9bf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.cpp @@ -46,7 +46,7 @@ HBM2DBPhaseEntry::HBM2DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h index d3b6c24a..476f9e99 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/HBM2dbphaseentry.h @@ -35,14 +35,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class HBM2DBPhaseEntry : public DBPhaseEntryIF { +class HBM2DBPhaseEntry : public DBPhaseEntryBase { public: HBM2DBPhaseEntry(const QSqlQuery&); size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp index d16e296b..78de425b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.cpp @@ -46,7 +46,7 @@ LPDDR4DBPhaseEntry::LPDDR4DBPhaseEntry(const QSqlQuery& query) { tRank = query.value(7).toLongLong(); } -bool LPDDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { +bool LPDDR4DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { auto other = std::dynamic_pointer_cast(otherPhase); if (!other) return false; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h index e2612bce..1017ea8f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR4dbphaseentry.h @@ -36,14 +36,14 @@ #pragma once -#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryIF.h" +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" -class LPDDR4DBPhaseEntry : public DBPhaseEntryIF { +class LPDDR4DBPhaseEntry : public DBPhaseEntryBase { public: LPDDR4DBPhaseEntry(const QSqlQuery&); // size_t tBankgroup; size_t tRank; - bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp similarity index 88% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp index df67097c..00ee6b85 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.cpp @@ -33,18 +33,18 @@ * Iron Prando da Silva */ -#include "dramtimedependenciesIF.h" +#include "dramtimedependenciesbase.h" #include -DRAMTimeDependenciesIF::DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint inTCK) { +DRAMTimeDependenciesBase::DRAMTimeDependenciesBase(const QJsonObject& memspec, const uint inTCK) { mMemspecJson = memspec; tCK = inTCK; } DependencyMap -DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) const { +DRAMTimeDependenciesBase::getDependencies(std::vector& dependencyFilter) const { DependencyMap dependenciesMap; std::vector dependencyFilterStrMapper(dependencyFilter.begin(), dependencyFilter.end()); @@ -68,11 +68,11 @@ DRAMTimeDependenciesIF::getDependencies(std::vector& dependencyFilter) return dependenciesMap; } -PoolControllerMap DRAMTimeDependenciesIF::getPools() const { +PoolControllerMap DRAMTimeDependenciesBase::getPools() const { return PoolControllerMap(mPools); } -void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesBase::mFilterDependencyList(std::vector& dependencyList, const std::vector& dependencyFilter) const { std::vector newDepList(dependencyList.size()); // TODO - probably there is a smarter way to filter these values, @@ -113,7 +113,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyList(std::vector& } -void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { +void DRAMTimeDependenciesBase::mFilterDependencyMap(DependencyMap& dependencyMap, const std::vector& dependencyFilter) const { if (!dependencyMap.empty()) { auto itFilter = dependencyFilter.begin(); @@ -159,7 +159,7 @@ void DRAMTimeDependenciesIF::mFilterDependencyMap(DependencyMap& dependencyMap, } -uint DRAMTimeDependenciesIF::mFindVectorMaximum(const std::vector& dependencyList) const { +uint DRAMTimeDependenciesBase::mFindVectorMaximum(const std::vector& dependencyList) const { auto maxElement = std::max_element( dependencyList.begin(), dependencyList.end(), diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h similarity index 95% rename from DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h rename to DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h index 1e0d2178..f4768c30 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h @@ -79,10 +79,10 @@ struct QStringsComparator { typedef std::map DependencyMap; -class DRAMTimeDependenciesIF { +class DRAMTimeDependenciesBase { public: - DRAMTimeDependenciesIF(const QJsonObject& memspec, const uint tCK); - virtual ~DRAMTimeDependenciesIF() = default; + DRAMTimeDependenciesBase(const QJsonObject& memspec, const uint tCK); + virtual ~DRAMTimeDependenciesBase() = default; DependencyMap getDependencies(std::vector& dependencyFilter) const; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index 4cdf2562..9382eadf 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -37,7 +37,7 @@ using namespace std; -DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +DDR3TimeDependencies::DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h index 1d7f777e..ae73e23c 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.h @@ -35,9 +35,9 @@ #pragma once -#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesIF.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/dramtimedependenciesbase.h" -class DDR3TimeDependencies final : public DRAMTimeDependenciesIF { +class DDR3TimeDependencies final : public DRAMTimeDependenciesBase { public: DDR3TimeDependencies(const QJsonObject& memspec, const uint tCK); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp index 5b68f4fd..d3cc0756 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoDDR3::TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoDDR3::TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h index b1b5bd73..89183f1b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoDDR3 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoDDR3 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoDDR3(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index 9a6a89c5..afcd0b62 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoDDR4::TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoDDR4::TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h index f6366603..ac974ec7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoDDR4 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoDDR4 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoDDR4(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 58020485..60083362 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -38,7 +38,7 @@ using namespace std; -TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); mBitsDIMMRanks = ceil(log2(mNumOfDIMMRanks)); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index a3b587b5..e07bb7ad 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp index 790a4ed7..6f8c849a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoHBM2::TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoHBM2::TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h index 8ec86bb8..06a55775 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoHBM2 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoHBM2 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoHBM2(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 8f988584..3b8fc142 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -37,7 +37,7 @@ using namespace std; -TimeDependenciesInfoLPDDR4::TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesIF(memspec, tCK) { +TimeDependenciesInfoLPDDR4::TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h index 20613bb1..03f49166 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.h @@ -35,9 +35,9 @@ #pragma once -#include "../dramtimedependenciesIF.h" +#include "../dramtimedependenciesbase.h" -class TimeDependenciesInfoLPDDR4 final : public DRAMTimeDependenciesIF { +class TimeDependenciesInfoLPDDR4 final : public DRAMTimeDependenciesBase { public: TimeDependenciesInfoLPDDR4(const QJsonObject& memspec, const uint clk); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index a5334f19..e2ba2d9b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -152,9 +152,9 @@ void PhaseDependenciesTracker::mInsertIntoTable(TraceDB& tdb, const std::vector< } -const std::vector> -PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr deviceConfig, TraceDB& tdb, const std::vector& commands) { - std::vector> phases; +const std::vector> +PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr deviceConfig, TraceDB& tdb, const std::vector& commands) { + std::vector> phases; QString queryStr = "SELECT Phases.*, Transactions.TBank, Transactions.TBankgroup, Transactions.TRank " " FROM Phases " @@ -207,7 +207,7 @@ PhaseDependenciesTracker::mGetFilteredPhases(const std::shared_ptr -PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr deviceConfig, const std::vector>& phases, std::vector& commands) { +PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr deviceConfig, const std::vector>& phases, std::vector& commands) { std::vector entries; entries.reserve((size_t) (0.4 * phases.size())); diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h index ebd7e16a..de20b25f 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.h @@ -52,8 +52,8 @@ private: static void mCreateTable(TraceDB& tdb); static void mInsertIntoTable(TraceDB& tdb, const std::vector& entries); - static const std::vector> mGetFilteredPhases(const std::shared_ptr, TraceDB& tdb, const std::vector& commands); - static const std::vector mCalculateDependencies(const std::shared_ptr, const std::vector>& phases, std::vector& commands); + static const std::vector> mGetFilteredPhases(const std::shared_ptr, TraceDB& tdb, const std::vector& commands); + static const std::vector mCalculateDependencies(const std::shared_ptr, const std::vector>& phases, std::vector& commands); static QSqlQuery mExecuteQuery(TraceDB& tdb, const QString queryStr); From ea736e5861c8e06539127b5eb480b631a213f203 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 21 Mar 2022 11:02:33 +0100 Subject: [PATCH 112/121] Added 'bank in group' granularity for ddr5. --- .../specialized/DDR5Configuration.cpp | 6 +- .../specialized/DDR5dbphaseentry.cpp | 5 ++ .../dbEntries/specialized/DDR5dbphaseentry.h | 1 + .../deviceDependencies/poolcontroller.h | 3 +- .../deviceDependencies/poolcontrollermap.cpp | 12 ++++ .../deviceDependencies/poolcontrollermap.h | 2 + .../specialized/TimeDependenciesInfoDDR5.cpp | 57 ++++++++++--------- .../specialized/TimeDependenciesInfoDDR5.h | 14 ++--- .../phasedependenciestracker.cpp | 12 +++- .../phases/phasedependency.cpp | 3 + .../businessObjects/phases/phasedependency.h | 1 + 11 files changed, 73 insertions(+), 43 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp index d43b27b5..e0957d53 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp @@ -44,7 +44,9 @@ DDR5Configuration::DDR5Configuration(const TraceDB& tdb) { std::shared_ptr DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { auto phase = std::make_shared(query); - std::dynamic_pointer_cast(mDeviceDeps)->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); - + auto device = std::dynamic_pointer_cast(mDeviceDeps); + device->rankIDToRankIDs(phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank); + device->bankIDToBankInGroup(phase->tLogicalRank, phase->tBank, phase->tBankInGroup); + return phase; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp index d2e95f6c..adeee0d8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.cpp @@ -60,6 +60,10 @@ bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: dep.depType == DependencyType::IntraBankGroup && tBankgroup != other->tBankgroup }; + bool const skipOnIntraBankInGroupAndDifferentBankInGroup = { + dep.depType == DependencyType::IntraBankInGroup + && tBankInGroup != other->tBankInGroup + }; bool const skipOnIntraLogRankAndDifferentRanks = { dep.depType == DependencyType::IntraLogicalRank && tLogicalRank != other->tLogicalRank @@ -81,6 +85,7 @@ bool DDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std: return !( skipOnIntraBankAndDifferentBanks || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraBankInGroupAndDifferentBankInGroup || skipOnIntraLogRankAndDifferentRanks || skipOnIntraPhysRankAndDifferentRanks || skipOnIntraDIMMRankAndDifferentRanks diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h index 6b118760..cf94e903 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR5dbphaseentry.h @@ -42,6 +42,7 @@ class DDR5DBPhaseEntry : public DBPhaseEntryBase { DDR5DBPhaseEntry(const QSqlQuery&); size_t tBankgroup; + size_t tBankInGroup; size_t tRank; size_t tLogicalRank; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index 17f7aefb..ac650bf9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -46,7 +46,8 @@ public: void push(DBDependencyEntry); void increment(); void merge(std::vector& depEntries); - + size_t count() { return mCount; } + bool isDependency(const StringMapper& phaseName); protected: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index 95ba8ebe..c20f7d18 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -83,3 +83,15 @@ bool PoolControllerMap::isDependency(const StringMapper& poolName, const StringM } } + +size_t PoolControllerMap::count(const StringMapper& poolName) { + auto pool = mPools.find(poolName); + if (pool != mPools.end()) { + return pool->second.count(); + + } else { + // TODO throw? + return 0; + + } +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index b7d247f1..fa5b7910 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -46,9 +46,11 @@ public: void push(const StringMapper& poolName, DBDependencyEntry); void increment(const StringMapper& poolName); void merge(std::vector& depEntries); + size_t count(const StringMapper& poolName); bool isDependency(const StringMapper& poolName, const StringMapper& phaseName); + protected: std::map mPools; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index 60083362..dc087ca7 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -41,26 +41,27 @@ using namespace std; TimeDependenciesInfoDDR5::TimeDependenciesInfoDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { mInitializeValues(); - mBitsDIMMRanks = ceil(log2(mNumOfDIMMRanks)); - mBitsPhysicalRanks = ceil(log2(mNumOfPhysicalRanks)); - mBitsLogicalRanks = ceil(log2(mNumOfLogicalRanks)); - - mLogRankMask = (1 << mBitsLogicalRanks) - 1; - mPhysRankMask = ((1 << mBitsPhysicalRanks) - 1) << mBitsLogicalRanks; - mDIMMRankMask = ((1 << mBitsDIMMRanks) - 1) << mBitsPhysicalRanks << mBitsLogicalRanks; } void TimeDependenciesInfoDDR5::rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const { - logRID = (rankID & mLogRankMask); - physRID = (rankID & mPhysRankMask) >> mBitsLogicalRanks; - dimmRID = (rankID & mDIMMRankMask) >> mBitsPhysicalRanks >> mBitsLogicalRanks; + logRID = rankID; + physRID = logRID / mNumLogicalRanksPerPhysicalRank; + dimmRID = physRID / mNumPhysicalRanksPerDIMMRank; +} + +void TimeDependenciesInfoDDR5::bankIDToBankInGroup(size_t logicalRankID, size_t bankID, size_t& bankInGroup) const { + bankInGroup = logicalRankID * mNumBanksPerGroup + bankID % mNumBanksPerGroup; + } void TimeDependenciesInfoDDR5::mInitializeValues() { mNumOfRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfRanks"].toInt(); mNumOfDIMMRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfDIMMRanks"].toInt(); - mNumOfPhysicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfPhysicalRanks"].toInt(); - mNumOfLogicalRanks = mMemspecJson["memarchitecturespec"].toObject()["nbrOfLogicalRanks"].toInt(); + mNumPhysicalRanksPerDIMMRank = mMemspecJson["memarchitecturespec"].toObject()["nbrOfPhysicalRanks"].toInt(); + mNumLogicalRanksPerPhysicalRank = mMemspecJson["memarchitecturespec"].toObject()["nbrOfLogicalRanks"].toInt(); + + mNumBanksPerGroup = mMemspecJson["memarchitecturespec"].toObject()["nbrOfBanks"].toInt(1); + mNumBanksPerGroup /= mMemspecJson["memarchitecturespec"].toObject()["nbrOfBankGroups"].toInt(1); burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); @@ -248,14 +249,14 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { {tWRAACT, "WRA", DependencyType::IntraBank, "tWRAACT"}, {tWRAACT + tBURST16, "WRA", DependencyType::IntraBank, "tWRAACT + tBURST16"}, {tRP - cmdLengthDiff, "PREPB", DependencyType::IntraBank, "tRP - tCK"}, - {tRP - cmdLengthDiff, "PRESB", DependencyType::IntraBankGroup, "tRP - tCK"}, + {tRP - cmdLengthDiff, "PRESB", DependencyType::IntraBankInGroup, "tRP - tCK"}, {tRP - cmdLengthDiff, "PREAB", DependencyType::IntraLogicalRank, "tRP - tCK"}, {tRFC_slr - cmdLengthDiff, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, {tRFC_slr - cmdLengthDiff, "RFMAB", DependencyType::IntraLogicalRank, "tRFC_slr - tCK"}, - {tRFCsb_slr - cmdLengthDiff, "REFSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "REFSB", DependencyType::IntraBankInGroup, "tRFCsb_slr - tCK"}, {tREFSBRD_slr - cmdLengthDiff, "REFSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, {tREFSBRD_dlr - cmdLengthDiff, "REFSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, - {tRFCsb_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraBankGroup, "tRFCsb_slr - tCK"}, + {tRFCsb_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraBankInGroup, "tRFCsb_slr - tCK"}, {tREFSBRD_slr - cmdLengthDiff, "RFMSB", DependencyType::IntraLogicalRank, "tREFSBRD_slr - tCK"}, {tREFSBRD_dlr - cmdLengthDiff, "RFMSB", DependencyType::IntraPhysicalRank, "tREFSBRD_dlr - tCK"}, {2 * tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, @@ -523,13 +524,13 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("REFSB"), forward_as_tuple( initializer_list{ - {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRC + tCK"}, + {tRC + cmdLengthDiff, "ACT", DependencyType::IntraBankInGroup, "tRC + tCK"}, {tRRD_L_slr + cmdLengthDiff, "ACT", DependencyType::IntraLogicalRank, "tRRD_L_slr + tCK"}, - {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRDAACT + tCK"}, - {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK"}, - {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRAACT + tRP + tCK + tBURST16"}, - {tRP, "PREPB", DependencyType::IntraBankGroup, "tRP"}, - {tRP, "PRESB", DependencyType::IntraBankGroup, "tRP"}, + {tRDAACT + cmdLengthDiff, "RDA", DependencyType::IntraBankInGroup, "tRDAACT + tCK"}, + {tWRAACT + tRP + cmdLengthDiff, "WRA", DependencyType::IntraBankInGroup, "tWRAACT + tRP + tCK"}, + {tWRAACT + tRP + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankInGroup, "tWRAACT + tRP + tCK + tBURST16"}, + {tRP, "PREPB", DependencyType::IntraBankInGroup, "tRP"}, + {tRP, "PRESB", DependencyType::IntraBankInGroup, "tRP"}, {tRFC_slr, "REFAB", DependencyType::IntraLogicalRank, "tRFC_slr"}, {tRFC_dlr, "REFAB", DependencyType::IntraPhysicalRank, "tRFC_dlr"}, {tRFC_dpr, "REFAB", DependencyType::IntraDIMMRank, "tRFC_dpr"}, @@ -600,13 +601,13 @@ DependencyMap TimeDependenciesInfoDDR5::mSpecializedGetDependencies() const { forward_as_tuple("PRESB"), forward_as_tuple( initializer_list{ - {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBankGroup, "tRAS + tCK"}, - {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBankGroup, "tRTP + tCK"}, - {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraBankGroup, "tRTP + tCK"}, - {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, - {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, - {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK"}, - {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankGroup, "tWRPRE + tCK + tBURST16"}, + {tRAS + cmdLengthDiff, "ACT", DependencyType::IntraBankInGroup, "tRAS + tCK"}, + {tRTP + cmdLengthDiff, "RD", DependencyType::IntraBankInGroup, "tRTP + tCK"}, + {tRTP + cmdLengthDiff, "RDA", DependencyType::IntraBankInGroup, "tRTP + tCK"}, + {tWRPRE + cmdLengthDiff, "WR", DependencyType::IntraBankInGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WR", DependencyType::IntraBankInGroup, "tWRPRE + tCK + tBURST16"}, + {tWRPRE + cmdLengthDiff, "WRA", DependencyType::IntraBankInGroup, "tWRPRE + tCK"}, + {tWRPRE + cmdLengthDiff + tBURST16, "WRA", DependencyType::IntraBankInGroup, "tWRPRE + tCK + tBURST16"}, {tPPD, "PREPB", DependencyType::IntraPhysicalRank, "tPPD"}, {tPPD, "PREAB", DependencyType::IntraPhysicalRank, "tPPD"}, {tCK, "CMD_BUS", DependencyType::InterDIMMRank, "CommandBus"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h index e07bb7ad..f17513ab 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.h @@ -44,6 +44,7 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { static const std::vector getPossiblePhases(); void rankIDToRankIDs(size_t rankID, size_t& dimmRID, size_t& physRID, size_t& logRID) const; + void bankIDToBankInGroup(size_t logicalRankID, size_t bankID, size_t& bankInGroup) const; protected: void mInitializeValues() override; @@ -52,8 +53,9 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { protected: uint mNumOfRanks; uint mNumOfDIMMRanks; - uint mNumOfPhysicalRanks; - uint mNumOfLogicalRanks; + uint mNumLogicalRanksPerPhysicalRank; + uint mNumPhysicalRanksPerDIMMRank; + uint mNumBanksPerGroup; uint burstLength; uint dataRate; @@ -139,13 +141,5 @@ class TimeDependenciesInfoDDR5 final : public DRAMTimeDependenciesBase { uint tBURST16; uint tBURST32; - - protected: - uint mBitsDIMMRanks; - uint mBitsPhysicalRanks; - uint mBitsLogicalRanks; - uint mLogRankMask; - uint mPhysRankMask; - uint mDIMMRankMask; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index e2ba2d9b..a9d0f80b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -261,9 +261,17 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrid, otherPhase->phaseName.getIDStr() }); - } + } else if (timeDiff < dep.timeValue && dep.phaseDep == StringMapper::Identifier::CMD_BUS) { + poolController.push(dep.phaseDep, DBDependencyEntry{ + phase->id, + phase->phaseName.getIDStr(), + PhaseDependency::dependencyTypeName(dep.depType), + dep.timeDepName, + otherPhase->id, + otherPhase->phaseName.getIDStr() + }); - if (timeDiff < dep.timeValue) { + } else if (timeDiff < dep.timeValue) { poolController.increment(dep.phaseDep); } diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp index 0cd7ec0e..5b30c638 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.cpp @@ -138,6 +138,9 @@ QString PhaseDependency::dependencyTypeName(DependencyType dtype) { case IntraBankGroup: return "IntraBankGroup"; + + case IntraBankInGroup: + return "IntraBankInGroup"; case IntraRank: return "IntraRank"; diff --git a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h index a29a67dd..86c4308a 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h +++ b/DRAMSys/traceAnalyzer/businessObjects/phases/phasedependency.h @@ -50,6 +50,7 @@ enum DependencyType { IntraBank, IntraBankGroup, + IntraBankInGroup, IntraRank, IntraLogicalRank, IntraPhysicalRank, From 5e147dcd24baaf9bdef7150e0a80cf8ee5de9e47 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 21 Mar 2022 11:21:08 +0100 Subject: [PATCH 113/121] Removed incorrect if check for pool dependency. TODO correct pool time dependency direction. --- .../phasedependenciestracker.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index a9d0f80b..e2ba2d9b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -261,17 +261,9 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrid, otherPhase->phaseName.getIDStr() }); - } else if (timeDiff < dep.timeValue && dep.phaseDep == StringMapper::Identifier::CMD_BUS) { - poolController.push(dep.phaseDep, DBDependencyEntry{ - phase->id, - phase->phaseName.getIDStr(), - PhaseDependency::dependencyTypeName(dep.depType), - dep.timeDepName, - otherPhase->id, - otherPhase->phaseName.getIDStr() - }); + } - } else if (timeDiff < dep.timeValue) { + if (timeDiff < dep.timeValue) { poolController.increment(dep.phaseDep); } From 6d3daac1f9d17a41a16ec36e0e176b729d7f6308 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 24 Mar 2022 10:21:54 +0100 Subject: [PATCH 114/121] Corrected pools time tracking. --- .../deviceDependencies/poolcontroller.cpp | 30 +++++-- .../deviceDependencies/poolcontroller.h | 10 ++- .../deviceDependencies/poolcontrollermap.cpp | 6 +- .../deviceDependencies/poolcontrollermap.h | 2 +- .../specialized/DDR3TimeDependencies.cpp | 44 +++++----- .../specialized/TimeDependenciesInfoDDR3.cpp | 58 ++++++------ .../specialized/TimeDependenciesInfoDDR4.cpp | 58 ++++++------ .../specialized/TimeDependenciesInfoDDR5.cpp | 78 ++++++++-------- .../specialized/TimeDependenciesInfoHBM2.cpp | 88 +++++++++---------- .../TimeDependenciesInfoLPDDR4.cpp | 54 ++++++------ .../phasedependenciestracker.cpp | 12 +-- 11 files changed, 229 insertions(+), 211 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp index b54fcc84..3aff2149 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.cpp @@ -36,7 +36,7 @@ #include "poolcontroller.h" #include -PoolController::PoolController(const uint poolSize, const std::vector& dependencies) +PoolController::PoolController(const uint poolSize, const std::vector& dependencies) : mDependencies(mAuxSortInput(dependencies)) { mPoolSize = poolSize; @@ -65,17 +65,33 @@ void PoolController::merge(std::vector& depEntries) { } } -bool PoolController::isDependency(const StringMapper& phaseName) { - return std::binary_search( +uint PoolController::getBusyTime(const StringMapper& phaseName) { + PoolEntry v{phaseName, 0}; + + auto entryIt = std::lower_bound( mDependencies.begin(), mDependencies.end(), - phaseName, - StringMapper::compare + v, + [](const PoolEntry& e1, const PoolEntry& e2) { + return e1.first < e2.first; + } ); + + if (entryIt->first == phaseName) { + return entryIt->second; + } else { + return 0; + } } -std::vector PoolController::mAuxSortInput(std::vector vec) { - std::sort(vec.begin(), vec.end()); +std::vector PoolController::mAuxSortInput(std::vector vec) { + std::sort( + vec.begin(), + vec.end(), + [](const PoolEntry& e1, const PoolEntry& e2) { + return e1.first < e2.first; + } + ); return vec; } \ No newline at end of file diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h index ac650bf9..e7eb76fb 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontroller.h @@ -37,9 +37,11 @@ #include "businessObjects/dramTimeDependencies/common/common.h" +typedef std::pair PoolEntry; + class PoolController { public: - PoolController(const uint poolSize, const std::vector& dependencies); + PoolController(const uint poolSize, const std::vector& dependencies); ~PoolController() = default; void clear(); @@ -48,14 +50,14 @@ public: void merge(std::vector& depEntries); size_t count() { return mCount; } - bool isDependency(const StringMapper& phaseName); + uint getBusyTime(const StringMapper& phaseName); protected: - const std::vector mDependencies; + const std::vector mDependencies; std::vector mPool; uint mCount = 0; uint mPoolSize = 0; protected: - static std::vector mAuxSortInput(std::vector vec); + static std::vector mAuxSortInput(std::vector vec); }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp index c20f7d18..ae00c001 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.cpp @@ -72,14 +72,14 @@ void PoolControllerMap::merge(std::vector& depEntries) { } } -bool PoolControllerMap::isDependency(const StringMapper& poolName, const StringMapper& phaseName) { +uint PoolControllerMap::getBusyTime(const StringMapper& poolName, const StringMapper& phaseName) { auto pool = mPools.find(poolName); if (pool != mPools.end()) { - return pool->second.isDependency(phaseName); + return pool->second.getBusyTime(phaseName); } else { // TODO throw? - return false; + return 0; } } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h index fa5b7910..1266c852 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/poolcontrollermap.h @@ -48,7 +48,7 @@ public: void merge(std::vector& depEntries); size_t count(const StringMapper& poolName); - bool isDependency(const StringMapper& poolName, const StringMapper& phaseName); + uint getBusyTime(const StringMapper& poolName, const StringMapper& phaseName); protected: diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp index 9382eadf..827849df 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/DDR3TimeDependencies.cpp @@ -45,28 +45,6 @@ void DDR3TimeDependencies::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "PREPB", - "RDA", - "WRA", - "REFAB", - "PREAB", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - "PDEA", - "PDXA", - } - } - }); - mPools.insert({"NAW", {4, {"ACT"}}}); - tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); @@ -105,6 +83,28 @@ void DDR3TimeDependencies::mInitializeValues() { tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + tCK; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"PREPB", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"REFAB", tCK}, + {"PREAB", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + } + } + }); + mPools.insert({"NAW", {4, {{"ACT", tFAW}}}}); + } const vector DDR3TimeDependencies::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp index d3cc0756..7b2db32d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR3.cpp @@ -45,35 +45,6 @@ void TimeDependenciesInfoDDR3::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "PREPB", - "RDA", - "WRA", - "REFAB", - "PREAB", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - "PDEA", - "PDXA", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - } - } - }); - tCCD = tCK * mMemspecJson["memtimingspec"].toObject()["CCD"].toInt(); tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); @@ -112,6 +83,35 @@ void TimeDependenciesInfoDDR3::mInitializeValues() { tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + tCK; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"PREPB", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"REFAB", tCK}, + {"PREAB", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoDDR3::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index afcd0b62..78c41b64 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -45,35 +45,6 @@ void TimeDependenciesInfoDDR4::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "PREPB", - "RDA", - "WRA", - "REFAB", - "PREAB", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - "PDEA", - "PDXA", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - } - } - }); - tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); @@ -128,6 +99,35 @@ void TimeDependenciesInfoDDR4::mInitializeValues() { tWRPDEN = tWL + tBURST + tWR; tWRAPDEN = tWL + tBURST + tWR + tCK; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"PREPB", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"REFAB", tCK}, + {"PREAB", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoDDR4::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp index dc087ca7..c36b40b5 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp @@ -69,45 +69,6 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { cmdMode = mMemspecJson["memarchitecturespec"].toObject()["cmdMode"].toInt(); bitWidth = mMemspecJson["memarchitecturespec"].toObject()["width"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "RDA", - "WRA", - "PREPB", - "PREAB", - "REFAB", - "PRESB", - "RFMAB", - "REFSB", - "RFMSB", - } - } - }); - - mPools.insert({ - "FAW_LOGICAL", { - 4, { - "ACT", - "REFSB", - "RFMSB", - } - } - }); - - mPools.insert({ - "FAW_PHYSICAL", { - 4, { - "ACT", - "REFSB", - "RFMSB", - } - } - }); - tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); @@ -208,6 +169,45 @@ void TimeDependenciesInfoDDR5::mInitializeValues() { tWRPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; tWRAPDEN = tWL + tBURST16 + tWR + cmdLengthDiff; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", 2 * tCK}, + {"RD", 2 * tCK}, + {"WR", 2 * tCK}, + {"RDA", 2 * tCK}, + {"WRA", 2 * tCK}, + {"PREPB", tCK}, + {"PREAB", tCK}, + {"REFAB", tCK}, + {"PRESB", tCK}, + {"RFMAB", tCK}, + {"REFSB", tCK}, + {"RFMSB", tCK}, + } + } + }); + + mPools.insert({ + "FAW_LOGICAL", { + 4, { + {"ACT", tFAW_slr - longCmdOffset}, + {"REFSB", tFAW_slr - shortCmdOffset}, + {"RFMSB", tFAW_slr - shortCmdOffset}, + } + } + }); + + mPools.insert({ + "FAW_PHYSICAL", { + 4, { + {"ACT", tFAW_dlr - longCmdOffset}, + {"REFSB", tFAW_dlr - shortCmdOffset}, + {"RFMSB", tFAW_dlr - shortCmdOffset}, + } + } + }); + } const std::vector TimeDependenciesInfoDDR5::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp index 6f8c849a..8fceeb97 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoHBM2.cpp @@ -45,50 +45,6 @@ void TimeDependenciesInfoHBM2::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "RAS_BUS", { - 1, { - "ACT", - "PREPB", - "PREAB", - "REFPB", - "REFAB", - "PDEA", - "PDXA", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - } - } - }); - - mPools.insert({ - "CAS_BUS", { - 1, { - "RD", - "RDA", - "WR", - "WRA", - "PDEA", - "PDXA", - "PDEP", - "PDXP", - "SREFEN", - "SREFEX", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - "REFPB", - } - } - }); - tRP = tCK * mMemspecJson["memtimingspec"].toObject()["RP"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); tRC = tCK * mMemspecJson["memtimingspec"].toObject()["RC"].toInt(); @@ -126,6 +82,50 @@ void TimeDependenciesInfoHBM2::mInitializeValues() { tWRRDS = tWL + tBURST + tWTRS; tWRRDL = tWL + tBURST + tWTRL; + mPools.insert({ + "RAS_BUS", { + 1, { + {"ACT", 2*tCK}, + {"PREPB", tCK}, + {"PREAB", tCK}, + {"REFPB", tCK}, + {"REFAB", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + } + } + }); + + mPools.insert({ + "CAS_BUS", { + 1, { + {"RD", tCK}, + {"RDA", tCK}, + {"WR", tCK}, + {"WRA", tCK}, + {"PDEA", tCK}, + {"PDXA", tCK}, + {"PDEP", tCK}, + {"PDXP", tCK}, + {"SREFEN", tCK}, + {"SREFEX", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + {"REFPB", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoHBM2::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 3b8fc142..84976422 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -45,33 +45,6 @@ void TimeDependenciesInfoLPDDR4::mInitializeValues() { burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); - mPools.insert({ - "CMD_BUS", { - 1, { - "ACT", - "RD", - "WR", - "RDA", - "WRA", - "PREPB", - "PREAB", - "REFAB", - "SREFEN", - "SREFEX", - "REFPB", - } - } - }); - - mPools.insert({ - "NAW", { - 4, { - "ACT", - "REFPB", - } - } - }); - tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); @@ -119,6 +92,33 @@ void TimeDependenciesInfoLPDDR4::mInitializeValues() { tREFPDEN = tCK + tCMDCKE; tSREFPDEN = tCK + tESCKE; + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", 4 * tCK}, + {"RD", 4 * tCK}, + {"WR", 4 * tCK}, + {"RDA", 4 * tCK}, + {"WRA", 4 * tCK}, + {"PREPB", 2 * tCK}, + {"PREAB", 2 * tCK}, + {"REFAB", 2 * tCK}, + {"SREFEN", 2 * tCK}, + {"SREFEX", 2 * tCK}, + {"REFPB", 2 * tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + {"REFPB", tFAW}, + } + } + }); + } const std::vector TimeDependenciesInfoLPDDR4::getPossiblePhases() { diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp index e2ba2d9b..eb935e2d 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/phasedependenciestracker.cpp @@ -247,10 +247,11 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptrphaseName)) { - if (timeDiff == dep.timeValue) { + auto busyTime = poolController.getBusyTime(dep.phaseDep, otherPhase->phaseName); + if (busyTime > 0 && timeDiff <= busyTime) { + if (timeDiff == busyTime) { // Captures only the first (exactly matching time) phase in // the pool window as a dependency poolController.push(dep.phaseDep, DBDependencyEntry{ @@ -263,14 +264,13 @@ PhaseDependenciesTracker::mCalculateDependencies(const std::shared_ptr Date: Mon, 4 Apr 2022 11:31:42 +0200 Subject: [PATCH 115/121] Added LPDDR5. Not tested. --- DRAMSys/traceAnalyzer/CMakeLists.txt | 4 + .../common/StringMapper.cpp | 2 + .../common/StringMapper.h | 1 + .../configurations/configurationfactory.cpp | 9 + .../configurations/configurationfactory.h | 1 + .../specialized/LPDDR5Configuration.cpp | 51 +++ .../specialized/LPDDR5Configuration.h | 48 +++ .../specialized/LPDDR5dbphaseentry.cpp | 83 ++++ .../specialized/LPDDR5dbphaseentry.h | 49 +++ .../specialized/TimeDependenciesInfoDDR4.cpp | 12 +- .../TimeDependenciesInfoLPDDR4.cpp | 8 +- .../TimeDependenciesInfoLPDDR5.cpp | 357 ++++++++++++++++++ .../specialized/TimeDependenciesInfoLPDDR5.h | 85 +++++ 13 files changed, 700 insertions(+), 10 deletions(-) create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.h create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp create mode 100644 DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 8875eeb9..4aa89aff 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -140,6 +140,10 @@ add_executable(TraceAnalyzer businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR5.cpp businessObjects/dramTimeDependencies/configurations/specialized/DDR5Configuration.cpp + businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp + businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp + businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.cpp + businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp businessObjects/dramTimeDependencies/phasedependenciestracker.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp index 5e74151a..1e67b94b 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.cpp @@ -69,6 +69,7 @@ QString StringMapper::getIDStr(StringMapper::Identifier id) { {StringMapper::Identifier::RDA, "RDA"}, {StringMapper::Identifier::WRA, "WRA"}, {StringMapper::Identifier::REFPB, "REFPB"}, + {StringMapper::Identifier::REFP2B, "REFP2B"}, {StringMapper::Identifier::PRESB, "PRESB"}, {StringMapper::Identifier::RFMAB, "RFMAB"}, {StringMapper::Identifier::REFSB, "REFSB"}, @@ -108,6 +109,7 @@ StringMapper::Identifier StringMapper::getIDEnum(const QString& id) { {"RDA", StringMapper::Identifier::RDA}, {"WRA", StringMapper::Identifier::WRA}, {"REFPB", StringMapper::Identifier::REFPB}, + {"REFP2B", StringMapper::Identifier::REFP2B}, {"PRESB", StringMapper::Identifier::PRESB}, {"RFMAB", StringMapper::Identifier::RFMAB}, {"REFSB", StringMapper::Identifier::REFSB}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h index 2464afcc..c2e45d90 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/common/StringMapper.h @@ -67,6 +67,7 @@ class StringMapper { RDA, WRA, REFPB, + REFP2B, PRESB, RFMAB, REFSB, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp index 48d4d553..9c03ec21 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.cpp @@ -53,6 +53,9 @@ std::shared_ptr ConfigurationFactory::make(const TraceDB& tdb } else if (deviceName == "DDR5") { return std::make_shared(tdb); + } else if (deviceName == "LPDDR5") { + return std::make_shared(tdb); + } else { // TODO maybe throw? throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -80,6 +83,9 @@ const std::vector ConfigurationFactory::possiblePhases(const TraceDB& t } else if (deviceName == "DDR5") { return TimeDependenciesInfoDDR5::getPossiblePhases(); + } else if (deviceName == "LPDDR5") { + return TimeDependenciesInfoLPDDR5::getPossiblePhases(); + } else { // TODO maybe throw? // throw std::invalid_argument("Could not find the device type '" + deviceName.toStdString() + '\''); @@ -107,6 +113,9 @@ bool ConfigurationFactory::deviceSupported(const TraceDB& tdb) { } else if (deviceName == "DDR5") { return true; + } else if (deviceName == "LPDDR5") { + return true; + } else { return false; } diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h index d1c3eaa6..b9230ce9 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/configurationfactory.h @@ -44,6 +44,7 @@ #include "specialized/HBM2Configuration.h" #include "specialized/LPDDR4Configuration.h" #include "specialized/DDR5Configuration.h" +#include "specialized/LPDDR5Configuration.h" #include "data/tracedb.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.cpp new file mode 100644 index 00000000..403cce5f --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#include "LPDDR5Configuration.h" +#include + +LPDDR5Configuration::LPDDR5Configuration(const TraceDB& tdb) { + mDeviceDeps = std::make_shared(std::forward(mGetMemspec(tdb)), mGetClk(tdb)); + +} + +std::shared_ptr LPDDR5Configuration::makePhaseEntry(const QSqlQuery& query) const { + auto phase = std::make_shared(query); + + auto device = std::dynamic_pointer_cast(mDeviceDeps); + phase->bankOffsetREFP2B = device->getPer2BankOffset(); + + return phase; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.h new file mode 100644 index 00000000..1b84b4e5 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/configurations/specialized/LPDDR5Configuration.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#pragma once + +#include "businessObjects/dramTimeDependencies/configurations/configurationBase.h" +#include "businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h" +#include "businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.h" + +class LPDDR5Configuration : public ConfigurationBase { + public: + LPDDR5Configuration(const TraceDB& tdb); + + std::shared_ptr makePhaseEntry(const QSqlQuery&) const override; + +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp new file mode 100644 index 00000000..58ab7983 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#include "LPDDR5dbphaseentry.h" + +LPDDR5DBPhaseEntry::LPDDR5DBPhaseEntry(const QSqlQuery& query) { + id = query.value(0).toLongLong(); + phaseName = StringMapper(query.value(1).toString()); + phaseBegin = query.value(2).toLongLong(); + phaseEnd = query.value(3).toLongLong(); + transact = query.value(4).toLongLong(); + tBank = query.value(5).toLongLong(); + tBankgroup = query.value(6).toLongLong(); + tRank = query.value(7).toLongLong(); +} + +bool LPDDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const { + auto other = std::dynamic_pointer_cast(otherPhase); + if (!other) return false; + + bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; + bool isREFP2B = dep.phaseDep == StringMapper::Identifier::REFP2B; + + bool const skipOnIntraBankAndDifferentBanks = { + dep.depType == DependencyType::IntraBank + && ( + (tBank != other->tBank) + || (isREFP2B && tBank != (other->tBank - bankOffsetREFP2B)) + ) + }; + bool const skipOnIntraBankgroupAndDifferentBankgroup = { + dep.depType == DependencyType::IntraBankGroup + && tBankgroup != other->tBankgroup + }; + bool const skipOnIntraRankAndDifferentRanks = { + dep.depType == DependencyType::IntraRank + && tRank != other->tRank + }; + bool const skipOnInterRankAndSameRank = { + dep.depType == DependencyType::InterRank + && tRank == other->tRank + && !isCmdPool + }; + + return !( + skipOnIntraBankAndDifferentBanks + || skipOnIntraBankgroupAndDifferentBankgroup + || skipOnIntraRankAndDifferentRanks + || skipOnInterRankAndSameRank + ); +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.h new file mode 100644 index 00000000..77af463a --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ + +#pragma once + +#include "businessObjects/dramTimeDependencies/dbEntries/dbphaseentryBase.h" + +class LPDDR5DBPhaseEntry : public DBPhaseEntryBase { + public: + LPDDR5DBPhaseEntry(const QSqlQuery&); + + size_t tBankgroup; + size_t tRank; + size_t bankOffsetREFP2B; + + bool potentialDependency(const TimeDependency& dep, const std::shared_ptr otherPhase) const override; +}; diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp index 78c41b64..36680671 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoDDR4.cpp @@ -180,14 +180,14 @@ DependencyMap TimeDependenciesInfoDDR4::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, - {tCCD_L, "RD", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "RD", DependencyType::IntraBank, "tCCD_L"}, // {tCCD_L, "RD", DependencyType::IntraBankGroup, "tCCD_L"}, {tCCD_S, "RD", DependencyType::IntraRank, "tCCD_S"}, {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, {tCCD_L, "RDA", DependencyType::IntraBankGroup, "tCCD_L"}, {tCCD_S, "RDA", DependencyType::IntraRank, "tCCD_S"}, {tBURST + tRTRS, "RDA", DependencyType::InterRank, "tBURST + tRTRS"}, - {tWRRD_L, "WR", DependencyType::IntraBank, "tWRRD_L"}, + {tWRRD_L, "WR", DependencyType::IntraBank, "tWRRD_L"}, // {tWRRD_L, "WR", DependencyType::IntraBankGroup, "tWRRD_L"}, {tWRRD_S, "WR", DependencyType::IntraRank, "tWRRD_S"}, {tWRRD_R, "WR", DependencyType::InterRank, "tWRRD_R"}, @@ -207,14 +207,14 @@ DependencyMap TimeDependenciesInfoDDR4::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tRCD - tAL, "ACT", DependencyType::IntraBank, "tRCD - tAL"}, - {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, - {tRDWR, "RD", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, // + {tRDWR, "RD", DependencyType::IntraBankGroup, "tRDWR"}, // {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, - {tRDWR, "RDA", DependencyType::IntraBankGroup, "tRDWR"}, + {tRDWR, "RDA", DependencyType::IntraBankGroup, "tRDWR"}, // {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, {tRDWR_R, "RDA", DependencyType::InterRank, "tRDWR_R"}, - {tCCD_L, "WR", DependencyType::IntraBank, "tCCD_L"}, + {tCCD_L, "WR", DependencyType::IntraBank, "tCCD_L"}, // {tCCD_L, "WR", DependencyType::IntraBankGroup, "tCCD_L"}, {tCCD_S, "WR", DependencyType::IntraRank, "tCCD_S"}, {tBURST + tRTRS, "WR", DependencyType::InterRank, "tBURST + tRTRS"}, diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp index 84976422..c65ef378 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR4.cpp @@ -175,7 +175,7 @@ DependencyMap TimeDependenciesInfoLPDDR4::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, - {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, + {tCCD, "RD", DependencyType::IntraBank, "tCCD"}, // {tCCD, "RD", DependencyType::IntraRank, "tCCD"}, {tBURST + tRTRS, "RD", DependencyType::InterRank, "tBURST + tRTRS"}, {tCCD, "RDA", DependencyType::IntraRank, "tCCD"}, @@ -197,7 +197,7 @@ DependencyMap TimeDependenciesInfoLPDDR4::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tRCD, "ACT", DependencyType::IntraBank, "tRCD"}, - {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, + {tRDWR, "RD", DependencyType::IntraBank, "tRDWR"}, // {tRDWR, "RD", DependencyType::IntraRank, "tRDWR"}, {tRDWR_R, "RD", DependencyType::InterRank, "tRDWR_R"}, {tRDWR, "RDA", DependencyType::IntraRank, "tRDWR"}, @@ -286,7 +286,7 @@ DependencyMap TimeDependenciesInfoLPDDR4::mSpecializedGetDependencies() const { {tXP, "PDXP", DependencyType::IntraRank, "tXP"}, {tXP, "PDXA", DependencyType::IntraRank, "tXP"}, {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, - {tRFCpb, "REFPB", DependencyType::IntraBank, "tRFCpb"}, + {tRFCpb, "REFPB", DependencyType::IntraBank, "tRFCpb"}, // {tRFCpb, "REFPB", DependencyType::IntraRank, "tRFCpb"}, {tXSR, "SREFEX", DependencyType::IntraRank, "tXSR"}, {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, @@ -385,7 +385,7 @@ DependencyMap TimeDependenciesInfoLPDDR4::mSpecializedGetDependencies() const { forward_as_tuple( initializer_list{ {tSR, "SREFEN", DependencyType::IntraRank, "tSR"}, - {tXP, "SRPDEX", DependencyType::IntraRank, "tXP"}, + {tXP, "SRPDEX", DependencyType::IntraRank, "tXP"}, // {2 * tCK, "CMD_BUS", DependencyType::InterRank, "CommandBus"}, } ) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp new file mode 100644 index 00000000..145fa24d --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp @@ -0,0 +1,357 @@ +/* Generated by JetBrains MPS */ + +#include "TimeDependenciesInfoLPDDR5.h" + +using namespace std; + +TimeDependenciesInfoLPDDR5::TimeDependenciesInfoLPDDR5(const QJsonObject& memspec, const uint tCK) : DRAMTimeDependenciesBase(memspec, tCK) { + mInitializeValues(); +} + +void TimeDependenciesInfoLPDDR5::mInitializeValues() { + burstLength = mMemspecJson["memarchitecturespec"].toObject()["burstLength"].toInt(); + dataRate = mMemspecJson["memarchitecturespec"].toObject()["dataRate"].toInt(); + per2BankOffset = mMemspecJson["memarchitecturespec"].toObject()["per2BankOffset"].toInt(); + + tRCD = tCK * mMemspecJson["memtimingspec"].toObject()["RCD"].toInt(); + tRPpb = tCK * mMemspecJson["memtimingspec"].toObject()["RPpb"].toInt(); + tRPab = tCK * mMemspecJson["memtimingspec"].toObject()["RPab"].toInt(); + tRAS = tCK * mMemspecJson["memtimingspec"].toObject()["RAS"].toInt(); + tRCpb = tCK * mMemspecJson["memtimingspec"].toObject()["RCpb"].toInt(); + tRCab = tCK * mMemspecJson["memtimingspec"].toObject()["RCab"].toInt(); + tCL = tCK * mMemspecJson["memtimingspec"].toObject()["CL"].toInt(); + tCWL = tCK * mMemspecJson["memtimingspec"].toObject()["CWL"].toInt(); + tAL = tCK * mMemspecJson["memtimingspec"].toObject()["AL"].toInt(); + tRL = tCK * mMemspecJson["memtimingspec"].toObject()["RL"].toInt(); + tRPRE = tCK * mMemspecJson["memtimingspec"].toObject()["RPRE"].toInt(); + tWPRE = tCK * mMemspecJson["memtimingspec"].toObject()["WPRE"].toInt(); + tWL = tCK * mMemspecJson["memtimingspec"].toObject()["WL"].toInt(); + tCCD_S = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_S"].toInt(); + tCCD_L = tCK * mMemspecJson["memtimingspec"].toObject()["CCD_L"].toInt(); + tRRD = tCK * mMemspecJson["memtimingspec"].toObject()["RRD"].toInt(); + tFAW = tCK * mMemspecJson["memtimingspec"].toObject()["FAW"].toInt(); + tWTR_S = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_S"].toInt(); + tWTR_L = tCK * mMemspecJson["memtimingspec"].toObject()["WTR_L"].toInt(); + tRTP = tCK * mMemspecJson["memtimingspec"].toObject()["RTP"].toInt(); + tWR = tCK * mMemspecJson["memtimingspec"].toObject()["WR"].toInt(); + tRFCab = tCK * mMemspecJson["memtimingspec"].toObject()["RFCab"].toInt(); + tRFCpb = tCK * mMemspecJson["memtimingspec"].toObject()["RFCpb"].toInt(); + tXS = tCK * mMemspecJson["memtimingspec"].toObject()["XS"].toInt(); + tXSDLL = tCK * mMemspecJson["memtimingspec"].toObject()["XSDLL"].toInt(); + tXP = tCK * mMemspecJson["memtimingspec"].toObject()["XP"].toInt(); + tCKE = tCK * mMemspecJson["memtimingspec"].toObject()["CKE"].toInt(); + tCKESR = tCK * mMemspecJson["memtimingspec"].toObject()["CKESR"].toInt(); + tPD = tCK * mMemspecJson["memtimingspec"].toObject()["PD"].toInt(); + tPRPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["PRPDEN"].toInt(); + tREFPDEN = tCK * mMemspecJson["memtimingspec"].toObject()["REFPDEN"].toInt(); + tRTRS = tCK * mMemspecJson["memtimingspec"].toObject()["RTRS"].toInt(); + tRBTP = tCK * mMemspecJson["memtimingspec"].toObject()["RBTP"].toInt(); + BL_n_min_16 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_min_16"].toInt(); + BL_n_min_32 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_min_32"].toInt(); + BL_n_max_16 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_max_16"].toInt(); + BL_n_max_32 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_max_32"].toInt(); + BL_n_S_16 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_S_16"].toInt(); + BL_n_S_32 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_S_32"].toInt(); + BL_n_L_16 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_L_16"].toInt(); + BL_n_L_32 = tCK * mMemspecJson["memtimingspec"].toObject()["BL_n_L_32"].toInt(); + tWCK2DQO = tCK * mMemspecJson["memtimingspec"].toObject()["WCK2DQO"].toInt(); + tPPD = tCK * mMemspecJson["memtimingspec"].toObject()["PPD"].toInt(); + tpbR2act = tCK * mMemspecJson["memtimingspec"].toObject()["pbR2act"].toInt(); + tpbR2pbR = tCK * mMemspecJson["memtimingspec"].toObject()["pbR2pbR"].toInt(); + + tBURST16 = (uint) (16 / (float) dataRate) * tCK; + tBURST32 = (uint) (32 / (float) dataRate) * tCK; + + mPools.insert({ + "CMD_BUS", { + 1, { + {"ACT", 2 * tCK}, + {"RD", tCK}, + {"WR", tCK}, + {"RDA", tCK}, + {"WRA", tCK}, + {"PREPB", tCK}, + {"PREAB", tCK}, + {"REFAB", tCK}, + {"REFPB", tCK}, + {"REFP2B", tCK}, + } + } + }); + + mPools.insert({ + "NAW", { + 4, { + {"ACT", tFAW}, + {"REFPB", tFAW}, + {"REFP2B", tFAW}, + } + } + }); + +} + +const std::vector TimeDependenciesInfoLPDDR5::getPossiblePhases() { + return { + "ACT", + "RD", + "WR", + "PREPB", + "RDA", + "WRA", + "REFPB", + "REFP2B", + "REFAB", + "PREAB", + }; +} + +DependencyMap TimeDependenciesInfoLPDDR5::mSpecializedGetDependencies() const { + DependencyMap dmap; + + dmap.emplace( + piecewise_construct, + forward_as_tuple("ACT"), + forward_as_tuple( + initializer_list{ + {tRCpb, "ACT", DependencyType::IntraBank, "tRCpb"}, + {tRRD, "ACT", DependencyType::IntraRank, "tRRD"}, + {BL_n_min_16 + tRBTP + tRPpb - tCK, "RDA", DependencyType::IntraBank, "BL_n_min_16 + tRBTP + tRPpb - tCK"}, + {BL_n_min_32 + tRBTP + tRPpb - tCK, "RDA", DependencyType::IntraBank, "BL_n_min_32 + tRBTP + tRPpb - tCK"}, + {tWL + BL_n_min_16 + tCK + tWR + tRPpb - tCK, "WRA", DependencyType::IntraBank, "tWL + BL_n_min_16 + tCK + tWR + tRPpb - tCK"}, + {tWL + BL_n_min_32 + tCK + tWR + tRPpb - tCK, "WRA", DependencyType::IntraBank, "tWL + BL_n_min_32 + tCK + tWR + tRPpb - tCK"}, + {tRPpb - tCK, "PREPB", DependencyType::IntraBank, "tRPpb - tCK"}, + {tRPab - tCK, "PREAB", DependencyType::IntraRank, "tRPab - tCK"}, + {tRFCab - tCK, "REFAB", DependencyType::IntraRank, "tRFCab - tCK"}, + {tpbR2act - tCK, "REFPB", DependencyType::IntraRank, "tpbR2act - tCK"}, + {tpbR2act - tCK, "REFP2B", DependencyType::IntraRank, "tpbR2act - tCK"}, + {tRFCpb - tCK, "REFPB", DependencyType::IntraBank, "tRFCpb - tCK"}, + {tRFCpb - tCK, "REFP2B", DependencyType::IntraBank, "tRFCpb - tCK"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + {0, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RD"), + forward_as_tuple( + initializer_list{ + {tRCD + tCK, "ACT", DependencyType::IntraBank, "tRCD + tCK"}, + {BL_n_L_16, "RD", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "RD", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "RD", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "RD", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "RD", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "RD", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {BL_n_L_16, "RDA", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "RDA", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "RDA", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "RDA", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "RDA", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "RDA", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {tWL + BL_n_max_16 + tWTR_L, "WR", DependencyType::IntraBankGroup, "tWL + BL_n_max_16 + tWTR_L"}, + {tWL + BL_n_max_32 + tWTR_L, "WR", DependencyType::IntraBankGroup, "tWL + BL_n_max_32 + tWTR_L"}, + {tWL + BL_n_min_16 + tWTR_S, "WR", DependencyType::IntraRank, "tWL + BL_n_min_16 + tWTR_S"}, + {tWL + BL_n_min_32 + tWTR_S, "WR", DependencyType::IntraRank, "tWL + BL_n_min_32 + tWTR_S"}, + {tWL + BL_n_max_16 + tWTR_L, "WRA", DependencyType::IntraBankGroup, "tWL + BL_n_max_16 + tWTR_L"}, + {tWL + BL_n_max_32 + tWTR_L, "WRA", DependencyType::IntraBankGroup, "tWL + BL_n_max_32 + tWTR_L"}, + {tWL + BL_n_min_16 + tWTR_S, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_16 + tWTR_S"}, + {tWL + BL_n_min_32 + tWTR_S, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_32 + tWTR_S"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WR"), + forward_as_tuple( + initializer_list{ + {tRCD + tCK, "ACT", DependencyType::IntraBank, "tRCD + tCK"}, + {tRL + BL_n_max_16 + tWCK2DQO - tWL, "RD", DependencyType::IntraBankGroup, "tRL + BL_n_max_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_max_32 + tWCK2DQO - tWL, "RD", DependencyType::IntraBankGroup, "tRL + BL_n_max_32 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_16 + tWCK2DQO - tWL, "RD", DependencyType::IntraRank, "tRL + BL_n_min_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_32 + tWCK2DQO - tWL, "RD", DependencyType::IntraRank, "tRL + BL_n_min_32 + tWCK2DQO - tWL"}, + {tRL + BL_n_max_16 + tWCK2DQO - tWL, "RDA", DependencyType::IntraBankGroup, "tRL + BL_n_max_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_max_32 + tWCK2DQO - tWL, "RDA", DependencyType::IntraBankGroup, "tRL + BL_n_max_32 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_16 + tWCK2DQO - tWL, "RDA", DependencyType::IntraRank, "tRL + BL_n_min_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_32 + tWCK2DQO - tWL, "RDA", DependencyType::IntraRank, "tRL + BL_n_min_32 + tWCK2DQO - tWL"}, + {BL_n_L_16, "WR", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "WR", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "WR", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "WR", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "WR", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "WR", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {BL_n_L_16, "WRA", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "WRA", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "WRA", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "WRA", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "WRA", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "WRA", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREPB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraBank, "tRAS + tCK"}, + {BL_n_min_16 + tRBTP, "RD", DependencyType::IntraBank, "BL_n_min_16 + tRBTP"}, + {BL_n_min_32 + tRBTP, "RD", DependencyType::IntraBank, "BL_n_min_32 + tRBTP"}, + {tWL + BL_n_min_16 + tCK + tWR, "WR", DependencyType::IntraBank, "tWL + BL_n_min_16 + tCK + tWR"}, + {tWL + BL_n_min_32 + tCK + tWR, "WR", DependencyType::IntraBank, "tWL + BL_n_min_32 + tCK + tWR"}, + {tPPD, "PREPB", DependencyType::IntraRank, "tPPD"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("RDA"), + forward_as_tuple( + initializer_list{ + {tRCD + tCK, "ACT", DependencyType::IntraBank, "tRCD + tCK"}, + {BL_n_L_16, "RD", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "RD", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "RD", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "RD", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "RD", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "RD", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {BL_n_L_16, "RDA", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "RDA", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "RDA", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "RDA", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "RDA", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "RDA", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {tWL + BL_n_max_16 + tWTR_L, "WR", DependencyType::IntraBankGroup, "tWL + BL_n_max_16 + tWTR_L"}, + {tWL + BL_n_max_32 + tWTR_L, "WR", DependencyType::IntraBankGroup, "tWL + BL_n_max_32 + tWTR_L"}, + {tWL + BL_n_min_16 + tWTR_S, "WR", DependencyType::IntraRank, "tWL + BL_n_min_16 + tWTR_S"}, + {tWL + BL_n_min_32 + tWTR_S, "WR", DependencyType::IntraRank, "tWL + BL_n_min_32 + tWTR_S"}, + {tWL + BL_n_max_16 + tWTR_L, "WRA", DependencyType::IntraBankGroup, "tWL + BL_n_max_16 + tWTR_L"}, + {tWL + BL_n_max_32 + tWTR_L, "WRA", DependencyType::IntraBankGroup, "tWL + BL_n_max_32 + tWTR_L"}, + {tWL + BL_n_min_16 + tWTR_S, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_16 + tWTR_S"}, + {tWL + BL_n_min_32 + tWTR_S, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_32 + tWTR_S"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("WRA"), + forward_as_tuple( + initializer_list{ + {tRCD + tCK, "ACT", DependencyType::IntraBank, "tRCD + tCK"}, + {tRL + BL_n_max_16 + tWCK2DQO - tWL, "RD", DependencyType::IntraBankGroup, "tRL + BL_n_max_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_max_32 + tWCK2DQO - tWL, "RD", DependencyType::IntraBankGroup, "tRL + BL_n_max_32 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_16 + tWCK2DQO - tWL, "RD", DependencyType::IntraRank, "tRL + BL_n_min_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_32 + tWCK2DQO - tWL, "RD", DependencyType::IntraRank, "tRL + BL_n_min_32 + tWCK2DQO - tWL"}, + {tRL + BL_n_max_16 + tWCK2DQO - tWL, "RDA", DependencyType::IntraBankGroup, "tRL + BL_n_max_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_max_32 + tWCK2DQO - tWL, "RDA", DependencyType::IntraBankGroup, "tRL + BL_n_max_32 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_16 + tWCK2DQO - tWL, "RDA", DependencyType::IntraRank, "tRL + BL_n_min_16 + tWCK2DQO - tWL"}, + {tRL + BL_n_min_32 + tWCK2DQO - tWL, "RDA", DependencyType::IntraRank, "tRL + BL_n_min_32 + tWCK2DQO - tWL"}, + {BL_n_L_16, "WR", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "WR", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "WR", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "WR", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "WR", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "WR", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {BL_n_L_16, "WRA", DependencyType::IntraBankGroup, "BL_n_L_16"}, + {BL_n_L_32, "WRA", DependencyType::IntraBankGroup, "BL_n_L_32"}, + {BL_n_S_16, "WRA", DependencyType::IntraRank, "BL_n_S_16"}, + {BL_n_S_32, "WRA", DependencyType::IntraRank, "BL_n_S_32"}, + {tBURST16 + tRTRS, "WRA", DependencyType::InterRank, "tBURST16 + tRTRS"}, + {tBURST32 + tRTRS, "WRA", DependencyType::InterRank, "tBURST32 + tRTRS"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFAB"), + forward_as_tuple( + initializer_list{ + {tRCpb + tCK, "ACT", DependencyType::IntraRank, "tRCpb + tCK"}, + {BL_n_min_16 + tRBTP + tRPpb, "RDA", DependencyType::IntraRank, "BL_n_min_16 + tRBTP + tRPpb"}, + {BL_n_min_32 + tRBTP + tRPpb, "RDA", DependencyType::IntraRank, "BL_n_min_32 + tRBTP + tRPpb"}, + {tWL + BL_n_min_16 + tCK + tWR + tRPpb, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_16 + tCK + tWR + tRPpb"}, + {tWL + BL_n_min_32 + tCK + tWR + tRPpb, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_32 + tCK + tWR + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraRank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tRFCab, "REFAB", DependencyType::IntraRank, "tRFCab"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("PREAB"), + forward_as_tuple( + initializer_list{ + {tRAS + tCK, "ACT", DependencyType::IntraRank, "tRAS + tCK"}, + {BL_n_min_16 + tRBTP, "RD", DependencyType::IntraRank, "BL_n_min_16 + tRBTP"}, + {BL_n_min_32 + tRBTP, "RD", DependencyType::IntraRank, "BL_n_min_32 + tRBTP"}, + {BL_n_min_16 + tRBTP, "RDA", DependencyType::IntraRank, "BL_n_min_16 + tRBTP"}, + {BL_n_min_32 + tRBTP, "RDA", DependencyType::IntraRank, "BL_n_min_32 + tRBTP"}, + {tWL + BL_n_min_16 + tCK + tWR, "WR", DependencyType::IntraRank, "tWL + BL_n_min_16 + tCK + tWR"}, + {tWL + BL_n_min_32 + tCK + tWR, "WR", DependencyType::IntraRank, "tWL + BL_n_min_32 + tCK + tWR"}, + {tWL + BL_n_min_16 + tCK + tWR, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_16 + tCK + tWR"}, + {tWL + BL_n_min_32 + tCK + tWR, "WRA", DependencyType::IntraRank, "tWL + BL_n_min_32 + tCK + tWR"}, + {tPPD, "PREPB", DependencyType::IntraRank, "tPPD"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFPB"), + forward_as_tuple( + initializer_list{ + {tRCpb + tCK, "ACT", DependencyType::IntraBank, "tRCpb + tCK"}, + {tRRD + tCK, "ACT", DependencyType::IntraRank, "tRRD + tCK"}, + {BL_n_min_16 + tRBTP + tRPpb, "RDA", DependencyType::IntraBank, "BL_n_min_16 + tRBTP + tRPpb"}, + {BL_n_min_32 + tRBTP + tRPpb, "RDA", DependencyType::IntraBank, "BL_n_min_32 + tRBTP + tRPpb"}, + {tWL + BL_n_min_16 + tCK + tWR + tRPpb, "WRA", DependencyType::IntraBank, "tWL + BL_n_min_16 + tCK + tWR + tRPpb"}, + {tWL + BL_n_min_32 + tCK + tWR + tRPpb, "WRA", DependencyType::IntraBank, "tWL + BL_n_min_32 + tCK + tWR + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraBank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tRFCpb, "REFPB", DependencyType::IntraBank, "tRFCpb"}, + {tpbR2pbR, "REFPB", DependencyType::IntraRank, "tpbR2pbR"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + {0, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + dmap.emplace( + piecewise_construct, + forward_as_tuple("REFP2B"), + forward_as_tuple( + initializer_list{ + {tRCpb + tCK, "ACT", DependencyType::IntraBank, "tRCpb + tCK"}, + {tRRD + tCK, "ACT", DependencyType::IntraRank, "tRRD + tCK"}, + {BL_n_min_16 + tRBTP + tRPpb, "RDA", DependencyType::IntraBank, "BL_n_min_16 + tRBTP + tRPpb"}, + {BL_n_min_32 + tRBTP + tRPpb, "RDA", DependencyType::IntraBank, "BL_n_min_32 + tRBTP + tRPpb"}, + {tWL + BL_n_min_16 + tCK + tWR + tRPpb, "WRA", DependencyType::IntraBank, "tWL + BL_n_min_16 + tCK + tWR + tRPpb"}, + {tWL + BL_n_min_32 + tCK + tWR + tRPpb, "WRA", DependencyType::IntraBank, "tWL + BL_n_min_32 + tCK + tWR + tRPpb"}, + {tRPpb, "PREPB", DependencyType::IntraBank, "tRPpb"}, + {tRPab, "PREAB", DependencyType::IntraRank, "tRPab"}, + {tRFCpb, "REFP2B", DependencyType::IntraBank, "tRFCpb"}, + {tpbR2pbR, "REFP2B", DependencyType::IntraRank, "tpbR2pbR"}, + {0, "CMD_BUS", DependencyType::InterRank, "CMDBus"}, + {0, "NAW", DependencyType::IntraRank, "tFAW"}, + } + ) + ); + + return dmap; +} diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h new file mode 100644 index 00000000..35c1a6d1 --- /dev/null +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h @@ -0,0 +1,85 @@ +/* Generated by JetBrains MPS */ + +#pragma once + +#include "../dramtimedependenciesbase.h" + +class TimeDependenciesInfoLPDDR5 final : public DRAMTimeDependenciesBase { + public: + TimeDependenciesInfoLPDDR5(const QJsonObject& memspec, const uint clk); + + static const std::vector getPossiblePhases(); + + uint getPer2BankOffset() { return per2BankOffset; } + + protected: + void mInitializeValues() override; + DependencyMap mSpecializedGetDependencies() const override; + + protected: + uint burstLength; + uint dataRate; + uint per2BankOffset; + + uint tRCD; + uint tRPpb; + uint tRPab; + uint tRAS; + uint tRCpb; + uint tRCab; + uint tCL; + uint tCWL; + uint tAL; + uint tRL; + uint tRPRE; + uint tWPRE; + uint tWL; + uint tCCD_S; + uint tCCD_L; + uint tRRD; + uint tFAW; + uint tWTR_S; + uint tWTR_L; + uint tRTP; + uint tWR; + uint tRFCab; + uint tRFCpb; + uint tXS; + uint tXSDLL; + uint tXP; + uint tCKE; + uint tCKESR; + uint tPD; + uint tPRPDEN; + uint tREFPDEN; + uint tRTRS; + uint tRBTP; + uint BL_n_min_16; + uint BL_n_min_32; + uint BL_n_max_16; + uint BL_n_max_32; + uint BL_n_S_16; + uint BL_n_S_32; + uint BL_n_L_16; + uint BL_n_L_32; + uint tWCK2DQO; + uint tPPD; + + uint tpbR2act; + uint tpbR2pbR; + + uint tBURST16; + uint tBURST32; + uint tRDWR; + uint tRDWR_R; + uint tWRRD_S; + uint tWRRD_L; + uint tWRRD_R; + uint tRDAACT; + uint tWRPRE; + uint tWRAACT; + uint tRDPDEN; + uint tWRPDEN; + uint tWRAPDEN; + +}; From 2836d9379b733a4567a2c379bf1ce42054094097 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Thu, 7 Apr 2022 10:13:35 +0200 Subject: [PATCH 116/121] Correcting dependency capture from REFP2B phases. --- .../specialized/LPDDR5dbphaseentry.cpp | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp index 58ab7983..25986237 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/LPDDR5dbphaseentry.cpp @@ -51,13 +51,26 @@ bool LPDDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const st if (!other) return false; bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS; - bool isREFP2B = dep.phaseDep == StringMapper::Identifier::REFP2B; + bool thisIsREFP2B = phaseName == StringMapper::Identifier::REFP2B; + bool otherIsREFP2B = dep.phaseDep == StringMapper::Identifier::REFP2B; - bool const skipOnIntraBankAndDifferentBanks = { + bool const skipOnIntraBankAndNoBankDep = { dep.depType == DependencyType::IntraBank - && ( - (tBank != other->tBank) - || (isREFP2B && tBank != (other->tBank - bankOffsetREFP2B)) + && + ( + ( // If phase is not REFP2B or both are REFP2B, intra bank dependency must occur in the same bank + (!thisIsREFP2B || (thisIsREFP2B && otherIsREFP2B)) + && tBank != other->tBank + ) + || + ( // If phase is REFP2B, "intra bank" dependency must occur in the same bank or in the offset bank + (thisIsREFP2B && !otherIsREFP2B) + && + ( + tBank != other->tBank + && tBank != (other->tBank - bankOffsetREFP2B) + ) + ) ) }; bool const skipOnIntraBankgroupAndDifferentBankgroup = { @@ -75,7 +88,7 @@ bool LPDDR5DBPhaseEntry::potentialDependency(const TimeDependency& dep, const st }; return !( - skipOnIntraBankAndDifferentBanks + skipOnIntraBankAndNoBankDep || skipOnIntraBankgroupAndDifferentBankgroup || skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank From a3e1f9469d89ed514a97a426b489158a9438a957 Mon Sep 17 00:00:00 2001 From: Iron Prando da Silva Date: Mon, 2 May 2022 09:03:40 +0200 Subject: [PATCH 117/121] Added missing copyright notice. --- .../TimeDependenciesInfoLPDDR5.cpp | 35 ++++++++++++++++++- .../specialized/TimeDependenciesInfoLPDDR5.h | 35 ++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp index 145fa24d..3a4f5400 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.cpp @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #include "TimeDependenciesInfoLPDDR5.h" diff --git a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h index 35c1a6d1..3e72a694 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h +++ b/DRAMSys/traceAnalyzer/businessObjects/dramTimeDependencies/deviceDependencies/specialized/TimeDependenciesInfoLPDDR5.h @@ -1,4 +1,37 @@ -/* Generated by JetBrains MPS */ +/* + * Copyright (c) 2022, Technische Universität Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Iron Prando da Silva + */ #pragma once From 92d043c29ea7544f90d8923113733a01cb26692d Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Thu, 5 May 2022 11:11:47 +0200 Subject: [PATCH 118/121] Update readme. --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d5d1491c..a6b7bdc6 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ If you decide to use DRAMSys in your research please cite the papers [2] [3]. To - **standalone** simulator with trace players, **gem5**-coupled simulator and **TLM-AT-compliant library** - support for **DDR3/4**, **LPDDR4**, **Wide I/O 1/2**, **GDDR5/5X/6** and **HBM1/2** -- support for **DDR5** and **LPDDR5** under development (contact [Matthias Jung](mailto:matthias.jung@iese.fraunhofer.de) for more information) +- support for **DDR5**, **LPDDR5** and **HBM3** under development (contact [Matthias Jung](mailto:matthias.jung@iese.fraunhofer.de) for more information) - automatic source code generation for new JEDEC standards [3] [9] from the domain-specific language DRAMml - FIFO, FR-FCFS and FR-FCFS with read/write grouping scheduling policies - open, closed, open adaptive and closed adaptive page policy [8] -- all-bank refresh and per-bank refresh with pulled-in and postponed refresh commands +- all-bank refresh, same-bank refresh and per-bank refresh with pulled-in and postponed refresh commands - staggered power down [5] - coupling to **DRAMPower** [4] and **3D-ICE** [8] for power and thermal simulation - **Trace Analyzer** for visual and metric-based result analysis @@ -42,23 +42,22 @@ All requests, responses and DRAM commands can be recorded in an SQLite trace dat The Trace Analyzer's main window is shown below. -If you are interested in the database recording feature and the Trace Analyzer, if you need support on how to setup DRAMSys in a virtual platform of your company, or if you require custom modifications of the simulator please contact [Matthias Jung](mailto:matthias.jung@iese.fraunhofer.de). +If you are interested in the Trace Analyzer, if you need support with the setup of DRAMSys in a virtual platform of your company, or if you require custom modifications of the simulator please contact [Matthias Jung](mailto:matthias.jung@iese.fraunhofer.de). ![Trace Analyzer Main Window](DRAMSys/docs/images/traceanalyzer.png) ## Basic Setup Start using DRAMSys by cloning the repository. -Use the `--recursive` flag to initialize all submodules within the repository, namely **DRAMPower**, **SystemC** and **nlohmann json**. +Use the `--recursive` flag to initialize all submodules within the repository, namely **DRAMPower**, **SystemC**, **nlohmann JSON** and **SQLite Amalgamation**. ### Dependencies -DRAMSys is based on the SystemC library. SystemC is included as a submodule and will be build automatically with the DRAMSys project. If you want to use an external SystemC version, export the environment variables `SYSTEMC_HOME` (SystemC root directory) and `SYSTEMC_TARGET_ARCH` (e.g. linux64) and add the path of the library to `LD_LIBRARY_PATH`. +DRAMSys requires a **C++17** compiler. The build process is based on **CMake** (minimum version **3.10**). Furthermore, the simulator is based on **SystemC**. SystemC is included as a submodule and will be build automatically with the project. If you want to use an external SystemC version, export the environment variables `SYSTEMC_HOME` (SystemC root directory) and `SYSTEMC_TARGET_ARCH` (e.g., linux64). ### Building DRAMSys -DRAMSys uses CMake for the build process, the minimum required version is **CMake 3.10**. -To build the standalone simulator for running memory trace files, create a build folder in the project root directory, then run CMake and make: +To build the standalone simulator for running memory trace files or a traffic generator, create a build folder in the project root directory, then run CMake and make: ```bash $ cd DRAMSys @@ -91,7 +90,7 @@ $ cd simulator $ ./DRAMSys ``` -The default base config file is *ddr3-example.json* and located in *DRAMSys/library/resources/simulations*, the default resource folder for all nested config files is *DRAMSys/library/resources*. +The default base config file is *ddr3-example.json* located in *DRAMSys/library/resources/simulations*, the default resource folder for all nested config files is *DRAMSys/library/resources*. To run DRAMSys with a specific base config file: @@ -107,7 +106,7 @@ $ ./DRAMSys ../../DRAMSys/tests/example_ddr3/simulations/ddr3-example.json ../.. ### DRAMSys Configuration -The DRAMSys executable supports one argument which is a JSON file that contains certain arguments and the path of other configuration files for the desired simulation. +The DRAMSys executable supports one argument, which is a JSON file that contains certain arguments and the name of nested configuration files for the desired simulation. Alternatively, the contents of nested configuration files can also be added directly to the top configuration file instead of the file name. The JSON code below shows an example configuration: @@ -150,7 +149,7 @@ The JSON code below shows an example configuration: } } ``` -Fields Description: +Field Descriptions: - "simulationid": simulation file identifier - "simconfig": configuration file for the DRAMSys simulator - "thermalconfig": thermal simulation configuration file @@ -162,9 +161,9 @@ Fields Description: Each **trace setup** device configuration can be a **trace player** ("type": "player"), a **traffic generator** ("type": "generator") or a **row hammer generator** ("type": "hammer"). By not specifing the **type** parameter, the device will act as a **trace player**. All device configurations must define a **clkMhz** (operation frequency of the **traffic initiator**) and a **name** (in case of a trace player this specifies the **trace file** to play; in case of a generator this field is only for identification purposes). The optional parameter **addLengthConverter** adds a transaction length converter between initiator and DRAMSys. This unit divides a large transaction up into several smaller transactions with the maximum length of one DRAM burst access. -The **maxPendingReadRequests** and **maxPendingWriteRequests** parameters define the maximum number of outstanding read/write requests. The current implementation delays all memory accesses when one limit is reached. The default value (0) disables the limit. +The **maxPendingReadRequests** and **maxPendingWriteRequests** parameters define the maximum number of outstanding read/write requests. The current implementation delays all memory accesses if one limit is reached. The default value (0) disables the limit. -A **traffic generator** can be configured to generate **numRequests** requests in total, of which the **rwRatio** field defines the probability of one request being a read request. The **seed** parameter can be used to produce identical results for all simulations. **minAddress** and **maxAddress** specify the address range, by default the whole address range is used. The parameter **addressDistribution** can either be set to **"random"** or **"sequential"**. In case of **"sequential"** the additional **addressIncrement** field must be specified, defining the address increment after each request. +A **traffic generator** can be configured to generate **numRequests** requests in total, of which the **rwRatio** field defines the probability of one request being a read request. The length of a request (in bytes) can be specified with the **dataLength** parameter. The **seed** parameter can be used to produce identical results for all simulations. **minAddress** and **maxAddress** specify the address range, by default the whole address range is used. The parameter **addressDistribution** can either be set to **random** or **sequential**. In case of **sequential** the additional **addressIncrement** field must be specified, defining the address increment after each request. The **row hammer generator** is a special traffic generator that mimics a row hammer attack. It generates **numRequests** alternating read requests to two different addresses. The first address is 0x0, the second address is specified by the **rowIncrement** parameter and should decode to a different row in the same bank. Since only one outstanding request is allowed, the controller cannot perform any reordering, forcing a row switch (precharge and activate) for each access. That way the number of activations on the target rows are maximized. @@ -567,6 +566,7 @@ The content of [config.json](DRAMSys/library/resources/configs/thermalsim/config The development of DRAMSys was supported by the German Research Foundation (DFG) as part of the priority program [Dependable Embedded Systems SPP1500](http://spp1500.itec.kit.edu) and the DFG grant no. [WE2442/10-1](https://www.uni-kl.de/en/3d-dram/). Furthermore, it was supported within the Fraunhofer and DFG cooperation program (grant no. [WE2442/14-1](https://www.iese.fraunhofer.de/en/innovation_trends/autonomous-systems/memtonomy.html)) and by the [Fraunhofer High Performance Center for Simulation- and Software-Based Innovation](https://www.leistungszentrum-simulation-software.de/en.html). Special thanks go to all listed contributors for their work and commitment during seven years of development. Shama Bhosale +Derek Christ Luiza Correa Peter Ehses Johannes Feldmann @@ -576,6 +576,7 @@ Matthias Jung Frederik Lauer Ana Mativi Felipe S. Prado +Iron Prando Tran Anh Quoc Janik Schlemminger Lukas Steiner From 5fcafe9862e32d851e1a28debab956a021d9197f Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Thu, 5 May 2022 11:46:50 +0000 Subject: [PATCH 119/121] Update readme. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a6b7bdc6..481a3a7a 100644 --- a/README.md +++ b/README.md @@ -576,8 +576,8 @@ Matthias Jung Frederik Lauer Ana Mativi Felipe S. Prado -Iron Prando -Tran Anh Quoc +Iron Prando +Tran Anh Quoc Janik Schlemminger Lukas Steiner Thanh C. Tran @@ -612,4 +612,4 @@ M. Jung, I. Heinrich, M. Natale, D. M. Mathew, C. Weis, S. Krumke, N. Wehn. Inte A. Hansson, N. Agarwal, A. Kolli, T. Wenisch, A. N. Udipi. IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS), 2014, Monterey, USA. [9] Fast Validation of DRAM Protocols with Timed Petri Nets -M. Jung, K. Kraft, T. Soliman, C. Sudarshan, C. Weis, N. Wehn. ACM International Symposium on Memory Systems (MEMSYS 2019), October, 2019, Washington, DC, USA. \ No newline at end of file +M. Jung, K. Kraft, T. Soliman, C. Sudarshan, C. Weis, N. Wehn. ACM International Symposium on Memory Systems (MEMSYS 2019), October, 2019, Washington, DC, USA. From 9590642c03558a727bfcc490ab773e503f03eb91 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Tue, 10 May 2022 09:17:26 +0200 Subject: [PATCH 120/121] Numerous enhancements Fixed a crash in TA Renamed Ranks to PC in pseudo-channel mode Make diagrams red for better readability --- .../businessObjects/traceplotlinemodel.cpp | 10 ++++++---- .../businessObjects/traceplotlinemodel.h | 4 ++-- DRAMSys/traceAnalyzer/tracefiletab.cpp | 13 +++++-------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.cpp b/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.cpp index 2439c43c..e2687e59 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.cpp @@ -356,14 +356,16 @@ QString AbstractTracePlotLineModel::getLabel(LineType type) } } -QString AbstractTracePlotLineModel::getLabel(unsigned int rank) +QString AbstractTracePlotLineModel::getLabel(unsigned int rank) const { - return "RA" + QString::number(rank); + std::string_view rankLabel = dataBusType == DataBusType::LegacyMode ? "RA" : "PC"; + return rankLabel.data() + QString::number(rank); } -QString AbstractTracePlotLineModel::getLabel(unsigned int rank, unsigned int group, unsigned int bank) +QString AbstractTracePlotLineModel::getLabel(unsigned int rank, unsigned int group, unsigned int bank) const { - return "RA" + QString::number(rank) + " BG" + QString::number(group) + " BA" + QString::number(bank); + std::string_view rankLabel = dataBusType == DataBusType::LegacyMode ? "RA" : "PC"; + return rankLabel.data() + QString::number(rank) + " BG" + QString::number(group) + " BA" + QString::number(bank); } AbstractTracePlotLineModel::CommandBusType AbstractTracePlotLineModel::getCommandBusType(const GeneralInfo &generalInfo) diff --git a/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.h b/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.h index 768e7f00..556bdd49 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.h +++ b/DRAMSys/traceAnalyzer/businessObjects/traceplotlinemodel.h @@ -174,8 +174,8 @@ protected: std::shared_ptr createRankGroupNode(unsigned int rank) const; static QString getLabel(LineType type); - static QString getLabel(unsigned int rank); - static QString getLabel(unsigned int rank, unsigned int group, unsigned int bank); + QString getLabel(unsigned int rank) const; + QString getLabel(unsigned int rank, unsigned int group, unsigned int bank) const; static CommandBusType getCommandBusType(const GeneralInfo &generalInfo); static DataBusType getDataBusType(const GeneralInfo &generalInfo); diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index f776a7a7..282df492 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -86,14 +86,6 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path) std::cout << "Opening new tab for \"" << path.toStdString() << "\"" << std::endl; - initNavigatorAndItsDependentWidgets(path); - setUpFileWatcher(path); - setUpTraceplotScrollbar(); - setUpTraceSelector(); - setUpCommentView(); - - setUpPossiblePhases(); - ui->mcConfigView->setModel(mcConfigModel); ui->mcConfigView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); @@ -109,6 +101,8 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path) setUpTraceplotScrollbar(); setUpCommentView(); + setUpPossiblePhases(); + tracefileChanged(); } @@ -491,6 +485,7 @@ void TraceFileTab::on_startPowerAnalysis_clicked() data->setSamples(*samples); cur->setData(data); cur->attach(ui->powerPlot); + cur->setPen(QPen(QColor(255,0,0))); QwtPlotMagnifier *mag1 = new QwtPlotMagnifier(ui->powerPlot->canvas()); mag1->setAxisEnabled(QwtPlot::xBottom, true); @@ -519,6 +514,7 @@ void TraceFileTab::on_startPowerAnalysis_clicked() data2->setSamples(*samples2); cur2->setData(data2); cur2->attach(ui->bandwidthPlot); + cur2->setPen(QPen(QColor(255,0,0))); ui->bandwidthPlot->setAxisTitle(0,"Bandwidth [%]"); ui->bandwidthPlot->setAxisScale(0,0.0,100.0); @@ -563,6 +559,7 @@ void TraceFileTab::on_startPowerAnalysis_clicked() data3->setSamples(*samples3); cur3->setData(data3); cur3->attach(ui->bufferPlot); + cur3->setPen(QPen(QColor(255,0,0))); ui->bufferPlot->setAxisTitle(0,"Buffer Utilization"); ui->bufferPlot->setAxisScale(0,0.0, maxBufferDepth); From bf048c2fa3f16c5ff04213d7556cdc3cb18b9f36 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Tue, 10 May 2022 09:32:15 +0200 Subject: [PATCH 121/121] Remove tests in TraceAnalyzer --- DRAMSys/traceAnalyzer/CMakeLists.txt | 2 - .../businessObjects/pythoncaller.cpp | 28 +------ .../businessObjects/pythoncaller.h | 7 +- .../businessObjects/tracetestresults.cpp | 48 ----------- .../businessObjects/tracetestresults.h | 68 --------------- DRAMSys/traceAnalyzer/evaluationtool.cpp | 58 ------------- DRAMSys/traceAnalyzer/evaluationtool.h | 5 -- DRAMSys/traceAnalyzer/evaluationtool.ui | 80 +----------------- .../presentation/tracetesttreewidget.cpp | 84 ------------------- .../presentation/tracetesttreewidget.h | 71 ---------------- DRAMSys/traceAnalyzer/traceanalyzer.cpp | 10 --- DRAMSys/traceAnalyzer/traceanalyzer.h | 1 - DRAMSys/traceAnalyzer/traceanalyzer.ui | 6 +- 13 files changed, 11 insertions(+), 457 deletions(-) delete mode 100644 DRAMSys/traceAnalyzer/businessObjects/tracetestresults.cpp delete mode 100644 DRAMSys/traceAnalyzer/businessObjects/tracetestresults.h delete mode 100644 DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.cpp delete mode 100644 DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.h diff --git a/DRAMSys/traceAnalyzer/CMakeLists.txt b/DRAMSys/traceAnalyzer/CMakeLists.txt index 58298719..bcc2b512 100644 --- a/DRAMSys/traceAnalyzer/CMakeLists.txt +++ b/DRAMSys/traceAnalyzer/CMakeLists.txt @@ -95,9 +95,7 @@ add_executable(TraceAnalyzer selectmetrics.cpp presentation/util/testlight.cpp presentation/util/togglecollapsedaction.cpp - presentation/tracetesttreewidget.cpp businessObjects/pythoncaller.cpp - businessObjects/tracetestresults.cpp presentation/tracemetrictreewidget.cpp businessObjects/phases/phase.cpp businessObjects/phases/phasedependency.cpp diff --git a/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.cpp b/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.cpp index 741295a3..2df106e8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.cpp @@ -52,8 +52,6 @@ PythonCaller &PythonCaller::instance() } PythonCaller::PythonCaller() : - testModuleName("tests"), - testFunctionName("runTests"), metricModuleName("metrics"), metricFunctionName("calculateMetrics"), getMetricFunctionName("getMetrics"), @@ -73,13 +71,11 @@ PythonCaller::PythonCaller() : PyList_Insert(sysPath, 0, path); Py_DECREF(path); - qDebug() << "Test:" << testModuleName.c_str() << testFunctionName.c_str(); qDebug() << "Metric:" << metricModuleName.c_str() << metricFunctionName.c_str(); qDebug() << "Plot:" << plotsModuleName.c_str() << plotsFunctionName.c_str(); qDebug() << "VcdExport:" << vcdExportModuleName.c_str() << vcdExportFunctionName.c_str(); qDebug() << "Script: " << pathToScripts.c_str(); - pRunTestsFunction = loadFunctionFromModule(testModuleName, testFunctionName); pCalculateMetricsFunction = loadFunctionFromModule(metricModuleName, metricFunctionName); pGenPlotsFunction = loadFunctionFromModule(plotsModuleName, plotsFunctionName); @@ -119,7 +115,6 @@ PyObject *PythonCaller::loadFunctionFromModule(std::string moduleName, std::stri PythonCaller::~PythonCaller() { - Py_DECREF(pRunTestsFunction); Py_DECREF(pCalculateMetricsFunction); Py_DECREF(pGenPlotsFunction); Py_DECREF(pGetMetricsFunction); @@ -149,7 +144,8 @@ PyObject *PythonCaller::callMetricsFunction(PyObject *function, QString argument if (!pResult) { PyErr_Print(); - throw std::runtime_error(std::string("Error in calling " + testFunctionName + " in module " + testModuleName)); + throw std::runtime_error( + std::string("Error in calling " + metricFunctionName + " in module " + metricModuleName)); } return pResult; @@ -169,7 +165,7 @@ PyObject *PythonCaller::callFunctionWithStringArgument(PyObject *function, if (!pResult) { PyErr_Print(); - throw std::runtime_error(std::string("Error in calling " + testFunctionName + " in module " + testModuleName)); + throw std::runtime_error(std::string("Error in calling function with string argument")); } return pResult; @@ -188,24 +184,6 @@ PyObject *PythonCaller::callFunctionWithoutArguments(PyObject *function) return pResult; } -TraceTestResults PythonCaller::runTestsOnTrace(QString pathToTrace) -{ - TraceTestResults traceTestResult(QFileInfo(pathToTrace).baseName()); - PyObject *pResult = callFunctionWithStringArgument(pRunTestsFunction, - pathToTrace); - - for (Py_ssize_t i = 0; i < PyList_Size(pResult); ++i) { - PyObject *currentTestResult = PyList_GetItem(pResult, i); - QString testName(PyUnicode_AsUTF8(PyTuple_GetItem(currentTestResult, 0))); - bool testPassed = (Py_True == PyTuple_GetItem(currentTestResult, 1)); - QString message(PyUnicode_AsUTF8(PyTuple_GetItem(currentTestResult, 2))); - - traceTestResult.addTestResult(TestResult(testName, testPassed, message)); - } - Py_DECREF(pResult); - return traceTestResult; -} - TraceCalculatedMetrics PythonCaller::calculateMetricsOnTrace(QString pathToTrace, std::vector list) { TraceCalculatedMetrics result(QFileInfo(pathToTrace).baseName()); diff --git a/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.h b/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.h index eeb04d7e..3b6a84d8 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.h +++ b/DRAMSys/traceAnalyzer/businessObjects/pythoncaller.h @@ -49,7 +49,6 @@ #include #include #include -#include "businessObjects/tracetestresults.h" #include "businessObjects/tracecalculatedmetrics.h" class PythonCaller @@ -57,7 +56,6 @@ class PythonCaller public: static PythonCaller &instance(); - TraceTestResults runTestsOnTrace(QString pathToTrace); TraceCalculatedMetrics calculateMetricsOnTrace(QString pathToTrace, std::vector list); std::vector getMetrics(QString pathToTrace); @@ -72,14 +70,13 @@ private: PythonCaller(const PythonCaller &other) = delete; PythonCaller &operator=(const PythonCaller &other) = delete; - PyObject *pRunTestsFunction, *pCalculateMetricsFunction, *pGetMetricsFunction; + PyObject *pCalculateMetricsFunction, *pGetMetricsFunction; PyObject *pGenPlotsFunction; PyObject *pVcdExportFunction = nullptr; PyObject *pVcdExportDependenciesFunction; PyObject *loadFunctionFromModule(std::string moduleName, std::string functionName); - std::string testModuleName, testFunctionName, metricModuleName, - metricFunctionName, getMetricFunctionName, pathToScripts; + std::string metricModuleName, metricFunctionName, getMetricFunctionName, pathToScripts; std::string plotsModuleName; std::string plotsFunctionName; diff --git a/DRAMSys/traceAnalyzer/businessObjects/tracetestresults.cpp b/DRAMSys/traceAnalyzer/businessObjects/tracetestresults.cpp deleted file mode 100644 index 402883b9..00000000 --- a/DRAMSys/traceAnalyzer/businessObjects/tracetestresults.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2015, Technische Universität Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - -#include "tracetestresults.h" - - -bool TraceTestResults::hasPassedAllTests() const -{ - for (const TestResult &testResult : testResults) { - if (!testResult.hasPassed()) - return false; - } - return true; -} diff --git a/DRAMSys/traceAnalyzer/businessObjects/tracetestresults.h b/DRAMSys/traceAnalyzer/businessObjects/tracetestresults.h deleted file mode 100644 index 148a775d..00000000 --- a/DRAMSys/traceAnalyzer/businessObjects/tracetestresults.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2015, Technische Universität Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - -#ifndef TRACETESTRESULT_H -#define TRACETESTRESULT_H -#include -#include -#include "testresult.h" - -class TraceTestResults -{ -public: - TraceTestResults(const QString &traceName): traceName(traceName) {} - - void addTestResult(const TestResult &result) - { - testResults.push_back(result); - } - - QString getTraceName() const - { - return traceName; - } - bool hasPassedAllTests() const; - const std::vector &getTestResults() const - { - return testResults; - } -private: - QString traceName; - std::vector testResults; -}; - -#endif // TRACETESTRESULT_H diff --git a/DRAMSys/traceAnalyzer/evaluationtool.cpp b/DRAMSys/traceAnalyzer/evaluationtool.cpp index 155b006d..0bfd9693 100644 --- a/DRAMSys/traceAnalyzer/evaluationtool.cpp +++ b/DRAMSys/traceAnalyzer/evaluationtool.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -61,8 +60,6 @@ EvaluationTool::EvaluationTool(QWidget *parent) : ui->setupUi(this); traceFilesModel = new QStandardItemModel(this); ui->listView->setModel(traceFilesModel); - QObject::connect(ui->traceTestTreeWidget, SIGNAL(setMessage(QString)), this, - SLOT(setTestMessage(QString))); selectMetrics = new SelectMetrics(this); QObject::connect(selectMetrics, SIGNAL(getSelectedMetrics()), this, SLOT(getSelectedMetrics())); @@ -81,16 +78,6 @@ void EvaluationTool::showForFiles(QList paths) ui->toolBox->setCurrentIndex(0); } -void EvaluationTool::showAndRunTests(QList paths) -{ - cleanUpUI(); - fillFileList(paths); - show(); - ui->toolBox->setCurrentIndex(0); - selectMetrics->setMetrics(getMetrics()); - runTests(); -} - void EvaluationTool::showAndEvaluateMetrics(QList paths) { cleanUpUI(); @@ -118,9 +105,6 @@ void EvaluationTool::cleanUpUI() traceFilesModel->clear(); calculatedMetrics.clear(); ui->traceMetricTreeWidget->clear(); - ui->traceTestTreeWidget->clear(); - ui->testMessage->setPlainText(QString("")); - ui->testLight->setGray(); } void EvaluationTool::fillFileList(QList paths) @@ -134,43 +118,6 @@ void EvaluationTool::fillFileList(QList paths) } } -void EvaluationTool::on_btn_test_clicked() -{ - runTests(); -} - -void EvaluationTool::runTests() -{ - ui->traceTestTreeWidget->clear(); - ui->testLight->setGray(); - - bool allTestsPassed = true; - bool boxesChecked = false; - - for (int row = 0; row < traceFilesModel->rowCount(); ++row) - { - TraceFileItem *item = static_cast(traceFilesModel->item(row)); - if (item->checkState() == Qt::Checked) - { - boxesChecked = true; - TraceTestResults traceTestResult = PythonCaller::instance().runTestsOnTrace(item->getPath()); - if (!traceTestResult.hasPassedAllTests()) - allTestsPassed = false; - ui->traceTestTreeWidget->addTraceTestResult(traceTestResult); - } - } - - if (!boxesChecked) - return; - - ui->traceTestTreeWidget->expandAll(); - - if (allTestsPassed) - ui->testLight->setGreen(); - else - ui->testLight->setRed(); -} - void EvaluationTool::on_btn_calculateMetrics_clicked() { selectMetrics->raise(); @@ -203,11 +150,6 @@ void EvaluationTool::calculateMetrics(vector selectedMetrics) ui->traceMetricTreeWidget->expandAll(); } -void EvaluationTool::setTestMessage(QString message) -{ - ui->testMessage->setPlainText(message); -} - EvaluationTool::TraceFileItem::TraceFileItem(const QString &path) { this->path = path; diff --git a/DRAMSys/traceAnalyzer/evaluationtool.h b/DRAMSys/traceAnalyzer/evaluationtool.h index 95a232fa..45dc3a89 100644 --- a/DRAMSys/traceAnalyzer/evaluationtool.h +++ b/DRAMSys/traceAnalyzer/evaluationtool.h @@ -65,21 +65,16 @@ public: ~EvaluationTool(); void showForFiles(QList paths); - void showAndRunTests(QList paths); void showAndEvaluateMetrics(QList paths); private Q_SLOTS: - void on_btn_test_clicked(); - void setTestMessage(QString message); void on_btn_calculateMetrics_clicked(); void on_btn_exportCSV_clicked(); void on_btn_genPlots_clicked(); void getSelectedMetrics(); - private: void fillFileList(QList paths); - void runTests(); void cleanUpUI(); void genPlots(); void calculateMetrics(std::vector selectedMetrics); diff --git a/DRAMSys/traceAnalyzer/evaluationtool.ui b/DRAMSys/traceAnalyzer/evaluationtool.ui index a54f5938..6049da33 100644 --- a/DRAMSys/traceAnalyzer/evaluationtool.ui +++ b/DRAMSys/traceAnalyzer/evaluationtool.ui @@ -38,78 +38,15 @@ - 1 + 0 - - - - 0 - 0 - 702 - 436 - - - - Test - - - - - - - - - 1 - - - - - - - - - - Run tests - - - - - - - - - - 0 - 30 - - - - - - - - Message: - - - - - - - - - - - - - - 0 0 - 702 - 436 + 707 + 464 @@ -176,17 +113,6 @@ - - TestLight - QWidget -
presentation/util/testlight.h
- 1 -
- - TraceTestTreeWidget - QTreeWidget -
presentation/tracetesttreewidget.h
-
TraceMetricTreeWidget QTreeWidget diff --git a/DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.cpp b/DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.cpp deleted file mode 100644 index a730d266..00000000 --- a/DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2015, Technische Universität Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - -#include "tracetesttreewidget.h" - -TraceTestTreeWidget::TraceTestTreeWidget(QWidget *parent) : QTreeWidget(parent) -{ - QObject::connect(this, SIGNAL(itemSelectionChanged()), this, - SLOT(itemSelectionChanged())); - setHeaderHidden(true); -} - -void TraceTestTreeWidget::addTraceTestResult(const TraceTestResults - &traceTestResult) -{ - QTreeWidgetItem *top = new QTreeWidgetItem({traceTestResult.getTraceName()}); - addTopLevelItem(top); - - if (traceTestResult.hasPassedAllTests()) - top->setForeground(0, Qt::green); - else - top->setForeground(0, Qt::red); - - for (const TestResult &testResult : traceTestResult.getTestResults()) { - new TestResultTreeItem(top, testResult); - } -} - -void TraceTestTreeWidget::itemSelectionChanged() -{ - if (!selectedItems().isEmpty() - && selectedItems().at(0)->type() == - TestResultTreeItem::testResultTreeItemType) { - TestResultTreeItem *testResultItem = static_cast - (selectedItems().at(0)); - Q_EMIT setMessage(testResultItem->getMessage()); - } else { - setMessage(QString("")); - } -} - -TraceTestTreeWidget::TestResultTreeItem::TestResultTreeItem( - QTreeWidgetItem *parent, const TestResult &testResult) - : QTreeWidgetItem(parent, testResultTreeItemType) -{ - setText(0, testResult.getTestName()); - if (!testResult.hasPassed()) - setForeground(0, Qt::red); - message = testResult.getMessage(); -} diff --git a/DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.h b/DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.h deleted file mode 100644 index 1936b955..00000000 --- a/DRAMSys/traceAnalyzer/presentation/tracetesttreewidget.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2015, Technische Universität Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - -#ifndef TRACETESTTREEWIDGET_H -#define TRACETESTTREEWIDGET_H -#include -#include - -class TraceTestTreeWidget: public QTreeWidget -{ - Q_OBJECT -public: - TraceTestTreeWidget(QWidget *parent = 0); - void addTraceTestResult(const TraceTestResults &traceTestResult); - -Q_SIGNALS: - void setMessage(QString message); - -private: - class TestResultTreeItem : public QTreeWidgetItem - { - public: - TestResultTreeItem(QTreeWidgetItem *parent, const TestResult &testResult); - static constexpr int testResultTreeItemType = 1002; - QString getMessage() - { - return message; - } - private: - QString message; - }; - -private Q_SLOTS: - void itemSelectionChanged(); -}; - -#endif // TRACETESTTREEWIDGET_H diff --git a/DRAMSys/traceAnalyzer/traceanalyzer.cpp b/DRAMSys/traceAnalyzer/traceanalyzer.cpp index 0eb8fe77..3dbb2000 100644 --- a/DRAMSys/traceAnalyzer/traceanalyzer.cpp +++ b/DRAMSys/traceAnalyzer/traceanalyzer.cpp @@ -77,9 +77,6 @@ TraceAnalyzer::TraceAnalyzer(QSet paths, StartupOption option, for (const QString &path : paths) openTracefileTab(path); - - if (option == StartupOption::runTests) - ui->actionTest->trigger(); } TraceAnalyzer::~TraceAnalyzer() @@ -245,13 +242,6 @@ void TraceAnalyzer::statusChanged(const QString &message) statusLabel->setText(message + QTime::currentTime().toString()); } -void TraceAnalyzer::on_actionTest_triggered() -{ - evaluationTool.raise(); - evaluationTool.activateWindow(); - evaluationTool.showAndRunTests(openedTraceFiles.values()); -} - void TraceAnalyzer::on_actionMetrics_triggered() { evaluationTool.raise(); diff --git a/DRAMSys/traceAnalyzer/traceanalyzer.h b/DRAMSys/traceAnalyzer/traceanalyzer.h index b5e8cdd1..8320fe07 100644 --- a/DRAMSys/traceAnalyzer/traceanalyzer.h +++ b/DRAMSys/traceAnalyzer/traceanalyzer.h @@ -92,7 +92,6 @@ private Q_SLOTS: void on_actionReload_triggered(); void on_actionReload_all_triggered(); void on_actionExportAsVCD_triggered(); - void on_actionTest_triggered(); void on_actionMetrics_triggered(); void on_actionClose_triggered(); void on_actionClose_all_triggered(); diff --git a/DRAMSys/traceAnalyzer/traceanalyzer.ui b/DRAMSys/traceAnalyzer/traceanalyzer.ui index 5fec0849..68871011 100644 --- a/DRAMSys/traceAnalyzer/traceanalyzer.ui +++ b/DRAMSys/traceAnalyzer/traceanalyzer.ui @@ -49,7 +49,7 @@ 0 0 800 - 23 + 34 @@ -64,7 +64,6 @@ - @@ -234,7 +233,8 @@ - + + .. &Simulate...