Increase time resolution in transaction tree widget.
This commit is contained in:
@@ -50,7 +50,8 @@ public:
|
||||
Timespan(traceTime begin = 0, traceTime end = 0) : begin(begin), end(end) {}
|
||||
traceTime timeCovered() const
|
||||
{
|
||||
return std::abs(End() - Begin());
|
||||
assert(End() >= Begin());
|
||||
return End() - Begin();
|
||||
}
|
||||
traceTime Begin() const
|
||||
{
|
||||
|
||||
@@ -41,16 +41,16 @@
|
||||
#include <math.h>
|
||||
|
||||
//time in nanoseconds
|
||||
typedef long long traceTime;
|
||||
typedef unsigned long long traceTime;
|
||||
|
||||
inline QString prettyFormatTime(traceTime time)
|
||||
{
|
||||
return QString::number(time / 1000) + QString(" ns");
|
||||
return QString::number(time / 1000.0) + QString(" ns");
|
||||
}
|
||||
|
||||
inline QString formatInClks(traceTime time, unsigned int clkPeriod)
|
||||
{
|
||||
long long numberOfClockCovered = time / clkPeriod;
|
||||
uint64_t numberOfClockCovered = time / clkPeriod;
|
||||
QString suffix = (numberOfClockCovered != 1) ? QString(" clks") :
|
||||
QString(" clk");
|
||||
return QString::number(numberOfClockCovered) + suffix;
|
||||
@@ -58,7 +58,7 @@ inline QString formatInClks(traceTime time, unsigned int clkPeriod)
|
||||
|
||||
inline traceTime alignToClk(traceTime time, unsigned int clkPeriod)
|
||||
{
|
||||
return round(1.0 * time / clkPeriod) * clkPeriod;
|
||||
return std::round(1.0 * time / clkPeriod) * clkPeriod;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ ID TraceDB::getTransactionIDFromPhaseID(ID phaseID)
|
||||
executeQuery(query);
|
||||
|
||||
if (query.next()) {
|
||||
return query.value(0).toInt();
|
||||
return query.value(0).toUInt();
|
||||
} else {
|
||||
throw sqlException("Phase with ID " + to_string(phaseID) + " not in db",
|
||||
this->pathToDB.toStdString());
|
||||
@@ -243,19 +243,19 @@ GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
executeQuery(query);
|
||||
|
||||
if (query.next()) {
|
||||
unsigned int numberOfTransactions = query.value(0).toInt();
|
||||
traceTime traceEnd = query.value(1).toLongLong();
|
||||
unsigned int numberOfRanks = query.value(2).toInt();
|
||||
unsigned int numberOfBankgroups = query.value(3).toInt();
|
||||
unsigned int numberOfBanks = query.value(4).toInt();
|
||||
unsigned int clkPeriod = query.value(5).toInt();
|
||||
unsigned int numberOfTransactions = query.value(0).toUInt();
|
||||
traceTime traceEnd = query.value(1).toULongLong();
|
||||
unsigned int numberOfRanks = query.value(2).toUInt();
|
||||
unsigned int numberOfBankgroups = query.value(3).toUInt();
|
||||
unsigned int numberOfBanks = query.value(4).toUInt();
|
||||
unsigned int clkPeriod = query.value(5).toUInt();
|
||||
QString unitOfTime = query.value(6).toString();
|
||||
unsigned int numberOfPhases = getNumberOfPhases();
|
||||
|
||||
QString traces = "Traces: " + query.value(7).toString();
|
||||
QString memspec = "Memspec: " + query.value(8).toString();
|
||||
QString mcconfig = "MCconfig: " + query.value(9).toString();
|
||||
unsigned int windowSize = query.value(10).toInt();
|
||||
unsigned int windowSize = query.value(10).toUInt();
|
||||
unsigned int controllerThread = query.value(11).toUInt();
|
||||
|
||||
QString description = (traces + "\n");
|
||||
@@ -285,24 +285,24 @@ CommandLengths TraceDB::getCommandLengthsFromDB()
|
||||
|
||||
if (query.next())
|
||||
{
|
||||
unsigned NOP = query.value(0).toInt();
|
||||
unsigned RD = query.value(1).toInt();
|
||||
unsigned WR = query.value(2).toInt();
|
||||
unsigned RDA = query.value(3).toInt();
|
||||
unsigned WRA = query.value(4).toInt();
|
||||
unsigned ACT = query.value(5).toInt();
|
||||
unsigned PRE = query.value(6).toInt();
|
||||
unsigned REFB = query.value(7).toInt();
|
||||
unsigned PRESB = query.value(8).toInt();
|
||||
unsigned REFSB = query.value(9).toInt();
|
||||
unsigned PREA = query.value(10).toInt();
|
||||
unsigned REFA = query.value(11).toInt();
|
||||
unsigned PDEA = query.value(12).toInt();
|
||||
unsigned PDXA = query.value(13).toInt();
|
||||
unsigned PDEP = query.value(14).toInt();
|
||||
unsigned PDXP = query.value(15).toInt();
|
||||
unsigned SREFEN = query.value(16).toInt();
|
||||
unsigned SREFEX = query.value(17).toInt();
|
||||
unsigned NOP = query.value(0).toUInt();
|
||||
unsigned RD = query.value(1).toUInt();
|
||||
unsigned WR = query.value(2).toUInt();
|
||||
unsigned RDA = query.value(3).toUInt();
|
||||
unsigned WRA = query.value(4).toUInt();
|
||||
unsigned ACT = query.value(5).toUInt();
|
||||
unsigned PRE = query.value(6).toUInt();
|
||||
unsigned REFB = query.value(7).toUInt();
|
||||
unsigned PRESB = query.value(8).toUInt();
|
||||
unsigned REFSB = query.value(9).toUInt();
|
||||
unsigned PREA = query.value(10).toUInt();
|
||||
unsigned REFA = query.value(11).toUInt();
|
||||
unsigned PDEA = query.value(12).toUInt();
|
||||
unsigned PDXA = query.value(13).toUInt();
|
||||
unsigned PDEP = query.value(14).toUInt();
|
||||
unsigned PDXP = query.value(15).toUInt();
|
||||
unsigned SREFEN = query.value(16).toUInt();
|
||||
unsigned SREFEX = query.value(17).toUInt();
|
||||
|
||||
return CommandLengths(NOP, RD, WR, RDA, WRA, ACT, PRE, REFB,
|
||||
PRESB, REFSB, PREA, REFA, PDEA, PDXA,
|
||||
@@ -322,7 +322,7 @@ unsigned int TraceDB::getNumberOfPhases()
|
||||
executeQuery(query);
|
||||
|
||||
query.next();
|
||||
return query.value(0).toInt();
|
||||
return query.value(0).toUInt();
|
||||
}
|
||||
|
||||
vector<Comment> TraceDB::getComments()
|
||||
@@ -385,31 +385,31 @@ vector<shared_ptr<Transaction>> TraceDB::parseTransactionsFromQuery(
|
||||
|
||||
while (query.next()) {
|
||||
|
||||
ID id = query.value(0).toInt();
|
||||
ID id = query.value(0).toUInt();
|
||||
|
||||
if (currentID != id || firstIteration) {
|
||||
++i;
|
||||
firstIteration = false;
|
||||
currentID = id;
|
||||
Timespan span(query.value(1).toLongLong(), query.value(2).toLongLong());
|
||||
Timespan spanOnStrobe(query.value(3).toLongLong(), query.value(4).toLongLong());
|
||||
unsigned int address = query.value(5).toInt();
|
||||
unsigned int burstlength = query.value(6).toInt();
|
||||
unsigned int thread = query.value(7).toInt();
|
||||
unsigned int channel = query.value(8).toInt();
|
||||
unsigned int rank = query.value(9).toInt();
|
||||
unsigned int bankgroup = query.value(10).toInt();
|
||||
unsigned int bank = query.value(11).toInt();
|
||||
unsigned int row = query.value(12).toInt();
|
||||
unsigned int column = query.value(13).toInt();
|
||||
Timespan span(query.value(1).toULongLong(), query.value(2).toULongLong());
|
||||
Timespan spanOnStrobe(query.value(3).toULongLong(), query.value(4).toULongLong());
|
||||
unsigned int address = query.value(5).toUInt();
|
||||
unsigned int burstlength = query.value(6).toUInt();
|
||||
unsigned int thread = query.value(7).toUInt();
|
||||
unsigned int channel = query.value(8).toUInt();
|
||||
unsigned int rank = query.value(9).toUInt();
|
||||
unsigned int bankgroup = query.value(10).toUInt();
|
||||
unsigned int bank = query.value(11).toUInt();
|
||||
unsigned int row = query.value(12).toUInt();
|
||||
unsigned int column = query.value(13).toUInt();
|
||||
result.push_back(shared_ptr<Transaction>(new Transaction(id, address, burstlength,
|
||||
thread, channel, rank, bankgroup, bank, row, column,
|
||||
span, spanOnStrobe)));
|
||||
}
|
||||
|
||||
unsigned int phaseID = query.value(14).toInt();
|
||||
unsigned int phaseID = query.value(14).toUInt();
|
||||
QString phaseName = query.value(15).toString();
|
||||
Timespan span(query.value(16).toLongLong(), query.value(17).toLongLong());
|
||||
Timespan span(query.value(16).toULongLong(), query.value(17).toULongLong());
|
||||
result.at(result.size() - 1)->addPhase(PhaseFactory::CreatePhase(phaseID,
|
||||
phaseName, span, result.at(result.size() - 1), *this));
|
||||
}
|
||||
@@ -420,7 +420,7 @@ vector<Comment> TraceDB::parseCommentsFromQuery(QSqlQuery &query)
|
||||
{
|
||||
vector<Comment> result;
|
||||
while (query.next()) {
|
||||
result.push_back(Comment(query.value(0).toLongLong(),
|
||||
result.push_back(Comment(query.value(0).toULongLong(),
|
||||
query.value(1).toString()));
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user