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

43 lines
1.7 KiB
C++

/*
* Copyright (c) 2025 Fraunhofer IESE. All rights reserved.
*
* Authors:
* Iron Prando da Silva
*/
#include "HBM2dbphaseentry.h"
HBM2DBPhaseEntry::HBM2DBPhaseEntry(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();
tBankgroup = query.value(6).toLongLong();
tRank = query.value(7).toLongLong();
}
bool HBM2DBPhaseEntry::potentialDependency(const TimeDependency& dep,
const std::shared_ptr<DBPhaseEntryBase> otherPhase)
{
auto other = std::dynamic_pointer_cast<HBM2DBPhaseEntry>(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 skipOnIntraBankgroupAndDifferentBankgroup = {
dep.depType == DependencyType::IntraBankGroup && tBankgroup != other->tBankgroup};
bool const skipOnIntraRankAndDifferentRanks = {dep.depType == DependencyType::IntraRank &&
tRank != other->tRank};
bool const skipOnInterRankAndSameRank = {dep.depType == DependencyType::InterRank &&
tRank == other->tRank && !isCmdPool};
return !(skipOnIntraBankAndDifferentBanks || skipOnIntraBankgroupAndDifferentBankgroup ||
skipOnIntraRankAndDifferentRanks || skipOnInterRankAndSameRank);
}