46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2025 Fraunhofer IESE. All rights reserved.
|
|
*
|
|
* Authors:
|
|
* Iron Prando da Silva
|
|
*/
|
|
|
|
#include "DDR5Configuration.h"
|
|
#include <memory>
|
|
|
|
DDR5Configuration::DDR5Configuration(const TraceDB& tdb)
|
|
{
|
|
mDeviceDeps = std::make_shared<TimeDependenciesInfoDDR5>(
|
|
std::forward<const QJsonObject>(mGetMemspec(tdb)), mGetClk(tdb));
|
|
}
|
|
|
|
QString DDR5Configuration::getQueryStr(const std::vector<QString>& commands) const
|
|
{
|
|
QString queryStr =
|
|
"SELECT Phases.ID, Phases.PhaseName, Phases.PhaseBegin, Phases.PhaseEnd, Phases.Transact, "
|
|
"Phases.Bank, Phases.Bankgroup, Phases.Rank, Phases.BurstLength "
|
|
" FROM Phases "
|
|
" WHERE PhaseName IN (";
|
|
|
|
for (const auto& cmd : commands)
|
|
{
|
|
queryStr = queryStr + '\"' + cmd + "\",";
|
|
}
|
|
queryStr.back() = ')';
|
|
queryStr += " ORDER BY PhaseBegin; ";
|
|
|
|
return queryStr;
|
|
}
|
|
|
|
std::shared_ptr<DBPhaseEntryBase> DDR5Configuration::makePhaseEntry(const QSqlQuery& query) const
|
|
{
|
|
auto phase = std::make_shared<DDR5DBPhaseEntry>(query);
|
|
|
|
auto device = std::dynamic_pointer_cast<TimeDependenciesInfoDDR5>(mDeviceDeps);
|
|
device->rankIDToRankIDs(
|
|
phase->tRank, phase->tLogicalRank, phase->tPhysicalRank, phase->tDIMMRank);
|
|
device->bankIDToBankInGroup(phase->tLogicalRank, phase->tBank, phase->tBankInGroup);
|
|
|
|
return phase;
|
|
}
|