69 lines
1.8 KiB
C++
69 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2025 Fraunhofer IESE. All rights reserved.
|
|
*
|
|
* Authors:
|
|
* Iron Prando da Silva
|
|
*/
|
|
|
|
#include "configurationBase.h"
|
|
|
|
uint ConfigurationBase::getClk() const
|
|
{
|
|
if (!mDeviceDeps)
|
|
throw std::invalid_argument(
|
|
"Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getClk'.");
|
|
|
|
return mDeviceDeps->getClk();
|
|
}
|
|
|
|
DependencyMap ConfigurationBase::getDependencies(std::vector<QString>& commands) const
|
|
{
|
|
if (!mDeviceDeps)
|
|
throw std::invalid_argument(
|
|
"Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getDependencies'.");
|
|
|
|
return mDeviceDeps->getDependencies(commands);
|
|
}
|
|
|
|
PoolControllerMap ConfigurationBase::getPools() const
|
|
{
|
|
if (!mDeviceDeps)
|
|
throw std::invalid_argument(
|
|
"Invalid DRAMTimeDependenciesBase object in 'ConfigurationBase::getAWPools'.");
|
|
|
|
return mDeviceDeps->getPools();
|
|
}
|
|
|
|
const QString ConfigurationBase::getDeviceName(const TraceDB& tdb)
|
|
{
|
|
return mGetMemspec(tdb)["memoryType"].toString();
|
|
}
|
|
|
|
uint ConfigurationBase::mGetClk(const TraceDB& tdb)
|
|
{
|
|
QSqlDatabase db = tdb.getDatabase();
|
|
QString query = "SELECT clk FROM GeneralInfo";
|
|
QSqlQuery sqlQuery = db.exec(query);
|
|
|
|
sqlQuery.next();
|
|
uint clock = sqlQuery.value(0).toLongLong();
|
|
sqlQuery.finish();
|
|
|
|
return clock;
|
|
}
|
|
|
|
const QJsonObject ConfigurationBase::mGetMemspec(const TraceDB& tdb)
|
|
{
|
|
QSqlDatabase db = tdb.getDatabase();
|
|
QString query = "SELECT Memspec FROM GeneralInfo";
|
|
QSqlQuery sqlQuery = db.exec(query);
|
|
|
|
sqlQuery.next();
|
|
QString memSpecJson = sqlQuery.value(0).toString();
|
|
sqlQuery.finish();
|
|
|
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(memSpecJson.toUtf8());
|
|
|
|
return jsonDocument.object()["memspec"].toObject();
|
|
}
|