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() }); }