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] 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 +}