Files
DRAMSys/extensions/apps/traceAnalyzer/businessObjects/dramTimeDependencies/dbEntries/specialized/DDR3dbphaseentry.cpp

40 lines
1.5 KiB
C++

/*
* Copyright (c) 2025 Fraunhofer IESE. All rights reserved.
*
* Authors:
* Iron Prando da Silva
*/
#include "DDR3dbphaseentry.h"
DDR3DBPhaseEntry::DDR3DBPhaseEntry(const QSqlQuery& query)
{
id = query.value(0).toLongLong();
phaseName = StringMapper(query.value(1).toString());
phaseBegin = query.value(2).toLongLong();
phaseEnd = query.value(3).toLongLong();
transact = query.value(4).toLongLong();
tBank = query.value(5).toLongLong();
tRank = query.value(6).toLongLong();
}
bool DDR3DBPhaseEntry::potentialDependency(const TimeDependency& dep,
const std::shared_ptr<DBPhaseEntryBase> otherPhase)
{
auto other = std::dynamic_pointer_cast<DDR3DBPhaseEntry>(otherPhase);
if (!other)
return false;
bool isCmdPool = dep.phaseDep == StringMapper::Identifier::CMD_BUS;
bool const skipOnIntraBankAndDifferentBanks = {dep.depType == DependencyType::IntraBank &&
tBank != other->tBank};
bool const skipOnIntraRankAndDifferentRanks = {dep.depType == DependencyType::IntraRank &&
tRank != other->tRank};
bool const skipOnInterRankAndSameRank = {dep.depType == DependencyType::InterRank &&
tRank == other->tRank && !isCmdPool};
return !(skipOnIntraBankAndDifferentBanks || skipOnIntraRankAndDifferentRanks ||
skipOnInterRankAndSameRank);
}