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] 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);