diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp index b3d4400f..94fe6ddd 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.cpp @@ -48,6 +48,7 @@ McConfigModel::McConfigModel(const TraceDB &traceFile, QObject *parent) : QAbstr sqlQuery.next(); QString mcConfigJson = sqlQuery.value(0).toString(); + addAdditionalInfos(traceFile.getGeneralInfo()); parseJson(mcConfigJson); } @@ -62,15 +63,25 @@ void McConfigModel::parseJson(const QString &jsonString) if (currentValue.isDouble()) { - entries.push_back(std::make_pair(key, QString::number(currentValue.toDouble()))); + entries.push_back({key, QString::number(currentValue.toDouble())}); } else if (currentValue.isString()) { - entries.push_back(std::make_pair(key, currentValue.toString())); + entries.push_back({key, currentValue.toString()}); } } } +void McConfigModel::addAdditionalInfos(const GeneralInfo &generalInfo) +{ + auto addEntry = [this](const QString &key, const QString &value) { entries.push_back({key, value}); }; + + addEntry("Number of Transactions", QString::number(generalInfo.numberOfTransactions)); + addEntry("Clock period", QString::number(generalInfo.clkPeriod) + " " + generalInfo.unitOfTime.toLower()); + addEntry("Length of trace", prettyFormatTime(generalInfo.span.End())); + addEntry("Window size", QString::number(generalInfo.windowSize)); +} + int McConfigModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent) @@ -173,7 +184,7 @@ void MemSpecModel::parseJson(const QString &jsonString) value = currentValue.toString(); } - std::unique_ptr node = std::unique_ptr(new Node(std::make_pair(key, value), parentNode.get())); + std::unique_ptr node = std::unique_ptr(new Node({key, value}, parentNode.get())); addNodes(obj[key].toObject(), node); parentNode->children.push_back(std::move(node)); diff --git a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h index 2548ab39..f2a77a87 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/configmodels.h +++ b/DRAMSys/traceAnalyzer/businessObjects/configmodels.h @@ -65,6 +65,12 @@ private: */ void parseJson(const QString &jsonString); + /** + * Add additional infos about the tracefile which were + * previously displayed in the fileDescription widget. + */ + void addAdditionalInfos(const GeneralInfo &generalInfo); + std::vector> entries; }; diff --git a/DRAMSys/traceAnalyzer/businessObjects/generalinfo.h b/DRAMSys/traceAnalyzer/businessObjects/generalinfo.h index 7928eb84..b6108c3e 100644 --- a/DRAMSys/traceAnalyzer/businessObjects/generalinfo.h +++ b/DRAMSys/traceAnalyzer/businessObjects/generalinfo.h @@ -33,6 +33,7 @@ * Janik Schlemminger * Robert Gernhardt * Matthias Jung + * Derek Christ */ #ifndef GENERALINFO_H @@ -52,7 +53,6 @@ public: unsigned int banksPerRank; unsigned int groupsPerRank; unsigned int banksPerGroup; - QString description; QString unitOfTime; unsigned int clkPeriod; unsigned int windowSize; @@ -60,13 +60,14 @@ public: GeneralInfo(unsigned int numberOfTransactions, unsigned int numberOfPhases, Timespan span, unsigned int numberOfRanks, unsigned int numberOfBankgroups, unsigned int numberOfBanks, - const QString &description, QString unitOfTime, unsigned int clkPeriod, - unsigned int windowSize, unsigned int controllerThread) : - numberOfTransactions(numberOfTransactions) , numberOfPhases(numberOfPhases), span(span), - numberOfRanks(numberOfRanks), numberOfBankgroups(numberOfBankgroups), numberOfBanks(numberOfBanks), - banksPerRank(numberOfBanks / numberOfRanks), groupsPerRank(numberOfBankgroups / numberOfRanks), - banksPerGroup(numberOfBanks / numberOfBankgroups), description(description), unitOfTime(unitOfTime), - clkPeriod(clkPeriod), windowSize(windowSize), controllerThread(controllerThread) {} + QString unitOfTime, unsigned int clkPeriod, unsigned int windowSize, unsigned int controllerThread) + : numberOfTransactions(numberOfTransactions), numberOfPhases(numberOfPhases), span(span), + numberOfRanks(numberOfRanks), numberOfBankgroups(numberOfBankgroups), numberOfBanks(numberOfBanks), + banksPerRank(numberOfBanks / numberOfRanks), groupsPerRank(numberOfBankgroups / numberOfRanks), + banksPerGroup(numberOfBanks / numberOfBankgroups), unitOfTime(unitOfTime), clkPeriod(clkPeriod), + windowSize(windowSize), controllerThread(controllerThread) + { + } }; #endif // GENERALINFO_H diff --git a/DRAMSys/traceAnalyzer/data/tracedb.cpp b/DRAMSys/traceAnalyzer/data/tracedb.cpp index ff37a88f..a30c3c77 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.cpp +++ b/DRAMSys/traceAnalyzer/data/tracedb.cpp @@ -33,6 +33,7 @@ * Janik Schlemminger * Robert Gernhardt * Matthias Jung + * Derek Christ */ #include @@ -273,19 +274,8 @@ GeneralInfo *TraceDB::getGeneralInfoFromDB() unsigned int windowSize = query.value(10).toInt(); unsigned int controllerThread = query.value(11).toUInt(); - QString description = (traces + "\n"); - description += mcconfig + "\n"; - description += memspec + "\n"; - description += "Number of Transactions: " + QString::number( - numberOfTransactions) + "\n"; - description += "Clock period: " + QString::number(clkPeriod) + " " + unitOfTime - + "\n"; - description += "Length of trace: " + prettyFormatTime(traceEnd) + "\n"; - description += "Window size:" + QString::number(windowSize) + "\n"; - - return new GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0, traceEnd), - numberOfRanks, numberOfBankgroups, numberOfBanks, - description, unitOfTime, clkPeriod, windowSize, controllerThread); + return new GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0, traceEnd), numberOfRanks, + numberOfBankgroups, numberOfBanks, unitOfTime, clkPeriod, windowSize, controllerThread); } else { throw sqlException("Tracefile corrupted. No general info table", this->pathToDB.toStdString()); diff --git a/DRAMSys/traceAnalyzer/data/tracedb.h b/DRAMSys/traceAnalyzer/data/tracedb.h index 511be6b0..18abb1ae 100644 --- a/DRAMSys/traceAnalyzer/data/tracedb.h +++ b/DRAMSys/traceAnalyzer/data/tracedb.h @@ -33,6 +33,7 @@ * Janik Schlemminger * Robert Gernhardt * Matthias Jung + * Derek Christ */ #ifndef TRACEDB_H @@ -63,7 +64,7 @@ class TraceDB : public QObject public: TraceDB(QString path, bool openExisting); - const QString &getPathToDB() + const QString &getPathToDB() const { return pathToDB; } @@ -72,12 +73,12 @@ public: void updateFileDescription(const QString &description); void refreshData(); - const GeneralInfo &getGeneralInfo() + const GeneralInfo &getGeneralInfo() const { return *generalInfo; } - const CommandLengths &getCommandLengths() + const CommandLengths &getCommandLengths() const { return commandLengths; } diff --git a/DRAMSys/traceAnalyzer/tracefiletab.cpp b/DRAMSys/traceAnalyzer/tracefiletab.cpp index 80da307a..ce8132fb 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.cpp +++ b/DRAMSys/traceAnalyzer/tracefiletab.cpp @@ -53,6 +53,7 @@ #include "qwt_scale_draw.h" #include "qwt_scale_widget.h" #include "ui_tracefiletab.h" +#include #include #include #include @@ -81,9 +82,6 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path) setUpTraceSelector(); setUpCommentView(); - ui->fileDescriptionEdit->setPlainText( - navigator->GeneralTraceInfo().description); - ui->mcConfigView->setModel(mcConfigModel); ui->mcConfigView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); @@ -168,11 +166,13 @@ void TraceFileTab::setUpCommentView() QObject::connect(ui->commentView, &QTableView::customContextMenuRequested, commentModel, &CommentModel::openContextMenu); - QObject::connect(commentModel, &CommentModel::editTriggered, ui->commentView, [=](const QModelIndex &index){ - ui->tabWidget->setCurrentWidget(ui->tabSelectedTrans); - ui->commentView->edit(index); - ui->commentView->scrollTo(index); - }); + QObject::connect(commentModel, &CommentModel::editTriggered, ui->commentView, + [=](const QModelIndex &index) + { + ui->tabWidget->setCurrentWidget(ui->tabComments); + ui->commentView->edit(index); + ui->commentView->scrollTo(index); + }); QObject::connect(ui->commentView, &QTableView::doubleClicked, commentModel, &CommentModel::rowDoubleClicked); @@ -252,10 +252,6 @@ public: } }; -void TraceFileTab::on_tabWidget_currentChanged(int index) -{ -} - void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index) { // Get onlye the leaf: diff --git a/DRAMSys/traceAnalyzer/tracefiletab.h b/DRAMSys/traceAnalyzer/tracefiletab.h index 1962088d..ab2425b6 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.h +++ b/DRAMSys/traceAnalyzer/tracefiletab.h @@ -96,8 +96,8 @@ public Q_SLOTS: Q_SIGNALS: void statusChanged(QString message, bool saveChangesEnable = false); void colorGroupingChanged(ColorGrouping colorgrouping); + private Q_SLOTS: - void on_tabWidget_currentChanged(int index); void on_latencyTreeView_doubleClicked(const QModelIndex &index); void on_startLatencyAnalysis_clicked(); void on_startPowerAnalysis_clicked(); diff --git a/DRAMSys/traceAnalyzer/tracefiletab.ui b/DRAMSys/traceAnalyzer/tracefiletab.ui index 647a3b50..6a8594d2 100644 --- a/DRAMSys/traceAnalyzer/tracefiletab.ui +++ b/DRAMSys/traceAnalyzer/tracefiletab.ui @@ -120,127 +120,114 @@ 0 - - - Customize Plot - - Selected Transaction - - - - - - 3 - 3 - - - - - 300 - 0 - - - - - 16777215 - 16777215 - - - - true - - - false - - - false - - - 0 - - - true - - - - - - - - 2 - 1 - - - - - 300 - 200 - - - - - 16777215 - 16777215 - - - - QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - true - - - QAbstractItemView::SelectRows - - - Qt::NoPen - - - false - - - true - - - false - - - - - - - true - - - - 2 - 1 - - - - - 300 - 0 - - - - - 16777215 - 16777215 - - - - true - - - - + + + + 3 + 3 + + + + + 300 + 0 + + + + + 16777215 + 16777215 + + + + true + + + false + + + false + + + 0 + + + true + + + + + + + + Configuration + + + + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + false + + + + + + + true + + + + + + + + Customize Plot + + + + + Comments + + + + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + true + + + QAbstractItemView::SelectRows + + + Qt::NoPen + + + true + + + false + + @@ -364,39 +351,6 @@ - - - Configuration - - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - false - - - - - - - true - - - - -