Seperated Data Bus for PseudoChannelMode
This commit is contained in:
@@ -308,7 +308,7 @@ void TlmRecorder::prepareSqlStatements()
|
||||
"INSERT INTO GeneralInfo VALUES"
|
||||
"(:numberOfTransactions, :end, :numberOfRanks, :numberOfBankGroups, :numberOfBanks, :clk, :unitOfTime, "
|
||||
":mcconfig, :memspec, :traces, :windowSize, :refreshMaxPostponed, :refreshMaxPulledin, :controllerThread, "
|
||||
":maxBufferDepth, :per2BankOffset, :rowColumnCommandBus)";
|
||||
":maxBufferDepth, :per2BankOffset, :rowColumnCommandBus, :pseudoChannelMode)";
|
||||
|
||||
insertCommandLengthsString = "INSERT INTO CommandLengths VALUES"
|
||||
"(:command, :length)";
|
||||
@@ -366,7 +366,8 @@ void TlmRecorder::insertGeneralInfo()
|
||||
sqlite3_bind_int(insertGeneralInfoStatement, 16,
|
||||
static_cast<int>(Configuration::getInstance().memSpec->getPer2BankOffset()));
|
||||
|
||||
const auto memoryType = Configuration::getInstance().memSpec->memoryType;
|
||||
const auto memSpec = Configuration::getInstance().memSpec;
|
||||
const auto memoryType = memSpec->memoryType;
|
||||
bool rowColumnCommandBus = [memoryType]() -> bool {
|
||||
if (memoryType == MemSpec::MemoryType::HBM2)
|
||||
return true;
|
||||
@@ -374,7 +375,18 @@ void TlmRecorder::insertGeneralInfo()
|
||||
return false;
|
||||
}();
|
||||
|
||||
bool pseudoChannelMode = [memSpec, memoryType]() -> bool {
|
||||
if (memoryType != MemSpec::MemoryType::HBM2)
|
||||
return false;
|
||||
|
||||
if (memSpec->numberOfRanks != 1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}();
|
||||
|
||||
sqlite3_bind_int(insertGeneralInfoStatement, 17, static_cast<int>(rowColumnCommandBus));
|
||||
sqlite3_bind_int(insertGeneralInfoStatement, 18, static_cast<int>(pseudoChannelMode));
|
||||
executeSqlStatement(insertGeneralInfoStatement);
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,8 @@ private:
|
||||
" ControllerThread INTEGER, \n"
|
||||
" MaxBufferDepth INTEGER, \n"
|
||||
" Per2BankOffset INTEGER, \n"
|
||||
" RowColumnCommandBus BOOL \n"
|
||||
" RowColumnCommandBus BOOL, \n"
|
||||
" PseudoChannelMode BOOL \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE CommandLengths( \n"
|
||||
|
||||
@@ -63,13 +63,14 @@ struct GeneralInfo
|
||||
unsigned int maxBufferDepth = 8;
|
||||
unsigned int per2BankOffset = 1;
|
||||
bool rowColumnCommandBus = false;
|
||||
bool pseudoChannelMode = false;
|
||||
|
||||
GeneralInfo() = default;
|
||||
GeneralInfo(uint64_t numberOfTransactions, uint64_t numberOfPhases, Timespan span, unsigned int numberOfRanks,
|
||||
unsigned int numberOfBankgroups, unsigned int numberOfBanks, QString description, QString unitOfTime,
|
||||
uint64_t clkPeriod, uint64_t windowSize, unsigned int refreshMaxPostponed,
|
||||
unsigned int refreshMaxPulledin, uint64_t controllerThread, unsigned int maxBufferDepth,
|
||||
unsigned int per2BankOffset, bool rowColumnCommandBus)
|
||||
unsigned int per2BankOffset, bool rowColumnCommandBus, bool pseudoChannelMode)
|
||||
: numberOfTransactions(numberOfTransactions), numberOfPhases(numberOfPhases), span(span),
|
||||
numberOfRanks(numberOfRanks), numberOfBankGroups(numberOfBankgroups), numberOfBanks(numberOfBanks),
|
||||
banksPerRank(numberOfBanks / numberOfRanks), groupsPerRank(numberOfBankgroups / numberOfRanks),
|
||||
@@ -77,7 +78,7 @@ struct GeneralInfo
|
||||
unitOfTime(std::move(unitOfTime)), clkPeriod(clkPeriod), windowSize(windowSize),
|
||||
refreshMaxPostponed(refreshMaxPostponed), refreshMaxPulledin(refreshMaxPulledin),
|
||||
controllerThread(controllerThread), maxBufferDepth(maxBufferDepth), per2BankOffset(per2BankOffset),
|
||||
rowColumnCommandBus(rowColumnCommandBus)
|
||||
rowColumnCommandBus(rowColumnCommandBus), pseudoChannelMode(pseudoChannelMode)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,22 +44,25 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
void Phase::draw(QPainter *painter, const QwtScaleMap &xMap,
|
||||
const QwtScaleMap &yMap, const QRectF &canvasRect, bool highlight,
|
||||
const TraceDrawingProperties &drawingProperties) const
|
||||
void Phase::draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect,
|
||||
bool highlight, const TraceDrawingProperties &drawingProperties) const
|
||||
{
|
||||
Q_UNUSED(canvasRect);
|
||||
|
||||
QColor color = getColor(drawingProperties);
|
||||
painter->setBrush(QBrush(getColor(drawingProperties), getBrushStyle()));
|
||||
|
||||
if (!drawingProperties.drawBorder) {
|
||||
if (!drawingProperties.drawBorder)
|
||||
{
|
||||
painter->setPen(color);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
painter->setPen(Qt::black);
|
||||
}
|
||||
|
||||
if (highlight) {
|
||||
if (highlight)
|
||||
{
|
||||
QPen pen(Qt::red);
|
||||
pen.setWidth(3);
|
||||
painter->setPen(pen);
|
||||
@@ -98,8 +101,8 @@ void Phase::draw(QPainter *painter, const QwtScaleMap &xMap,
|
||||
else if (line->data.type != AbstractTracePlotLineModel::CommandBusLine)
|
||||
continue;
|
||||
|
||||
drawPhaseSymbol(span.Begin(), span.End(), line->data.yVal, false, PhaseSymbol::Hexagon, painter, xMap,
|
||||
yMap, drawingProperties.textColor);
|
||||
drawPhaseSymbol(span.Begin(), span.End(), line->data.yVal, false, PhaseSymbol::Hexagon, painter, xMap, yMap,
|
||||
drawingProperties.textColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +110,17 @@ void Phase::draw(QPainter *painter, const QwtScaleMap &xMap,
|
||||
{
|
||||
for (const auto &line : drawingProperties.getTracePlotLines())
|
||||
{
|
||||
if (line->data.type != AbstractTracePlotLineModel::DataBusLine)
|
||||
if (line->data.type == AbstractTracePlotLineModel::PseudoChannel0Line)
|
||||
{
|
||||
if (transaction.lock()->rank != 0)
|
||||
continue;
|
||||
}
|
||||
else if (line->data.type == AbstractTracePlotLineModel::PseudoChannel1Line)
|
||||
{
|
||||
if (transaction.lock()->rank != 1)
|
||||
continue;
|
||||
}
|
||||
else if (line->data.type != AbstractTracePlotLineModel::DataBusLine)
|
||||
continue;
|
||||
|
||||
drawPhaseSymbol(spanOnDataBus->Begin(), spanOnDataBus->End(), line->data.yVal, false, PhaseSymbol::Hexagon,
|
||||
@@ -116,9 +129,8 @@ void Phase::draw(QPainter *painter, const QwtScaleMap &xMap,
|
||||
}
|
||||
}
|
||||
|
||||
void Phase::drawPhaseSymbol(traceTime begin, traceTime end, double y,
|
||||
bool drawtext, PhaseSymbol symbol, QPainter *painter, const QwtScaleMap &xMap,
|
||||
const QwtScaleMap &yMap, QColor textColor) const
|
||||
void Phase::drawPhaseSymbol(traceTime begin, traceTime end, double y, bool drawtext, PhaseSymbol symbol,
|
||||
QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, QColor textColor) const
|
||||
{
|
||||
double yVal = yMap.transform(y);
|
||||
double symbolHeight = yMap.transform(0) - yMap.transform(hexagonHeight);
|
||||
@@ -126,19 +138,23 @@ void Phase::drawPhaseSymbol(traceTime begin, traceTime end, double y,
|
||||
// Increase display size of phases with zero span
|
||||
traceTime offset = (begin == end) ? static_cast<traceTime>(0.05 * clk) : 0;
|
||||
|
||||
if (symbol == PhaseSymbol::Hexagon) {
|
||||
if (symbol == PhaseSymbol::Hexagon)
|
||||
{
|
||||
QPoint hexFrom(static_cast<int>(xMap.transform(begin)), static_cast<int>(yVal));
|
||||
QPoint hexTo(static_cast<int>(xMap.transform(end + offset)), static_cast<int>(yVal));
|
||||
drawHexagon(painter, hexFrom, hexTo, symbolHeight);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
QPoint upperLeft(static_cast<int>(xMap.transform(begin)), static_cast<int>(yVal - symbolHeight / 2));
|
||||
QPoint bottomRight(static_cast<int>(xMap.transform(end)), static_cast<int>(yVal + symbolHeight / 2));
|
||||
painter->drawRect(QRect(upperLeft, bottomRight));
|
||||
}
|
||||
|
||||
if (drawtext)
|
||||
drawText(painter, Name(), QPoint(static_cast<int>(xMap.transform(begin)),
|
||||
static_cast<int>(yVal + symbolHeight / 2)), TextPositioning::bottomRight, textColor);
|
||||
drawText(painter, Name(),
|
||||
QPoint(static_cast<int>(xMap.transform(begin)), static_cast<int>(yVal + symbolHeight / 2)),
|
||||
TextPositioning::bottomRight, textColor);
|
||||
}
|
||||
|
||||
void Phase::drawPhaseDependencies(traceTime begin, traceTime end, double y,
|
||||
@@ -265,14 +281,15 @@ QColor Phase::getColor(const TraceDrawingProperties &drawingProperties) const
|
||||
{
|
||||
switch (drawingProperties.colorGrouping)
|
||||
{
|
||||
case ColorGrouping::PhaseType:
|
||||
return getPhaseColor();
|
||||
case ColorGrouping::Thread:
|
||||
return ColorGenerator::getColor(static_cast<unsigned int>(transaction.lock()->thread));
|
||||
case ColorGrouping::AlphaTransaction:
|
||||
return ColorGenerator::getAlphaColored(transaction.lock()->id);
|
||||
case ColorGrouping::Transaction: default:
|
||||
return ColorGenerator::getColor(transaction.lock()->id);
|
||||
case ColorGrouping::PhaseType:
|
||||
return getPhaseColor();
|
||||
case ColorGrouping::Thread:
|
||||
return ColorGenerator::getColor(static_cast<unsigned int>(transaction.lock()->thread));
|
||||
case ColorGrouping::AlphaTransaction:
|
||||
return ColorGenerator::getAlphaColored(transaction.lock()->id);
|
||||
case ColorGrouping::Transaction:
|
||||
default:
|
||||
return ColorGenerator::getColor(transaction.lock()->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,9 +313,17 @@ bool Phase::isSelected(Timespan timespan, double yVal, const TraceDrawingPropert
|
||||
{
|
||||
for (const auto &line : drawingProperties.getTracePlotLines())
|
||||
{
|
||||
if ((line->data.type != AbstractTracePlotLineModel::CommandBusLine) &&
|
||||
(line->data.type != AbstractTracePlotLineModel::RowCommandBusLine) &&
|
||||
(line->data.type != AbstractTracePlotLineModel::ColumnCommandBusLine))
|
||||
if (line->data.type == AbstractTracePlotLineModel::RowCommandBusLine)
|
||||
{
|
||||
if (isColumnCommand())
|
||||
continue;
|
||||
}
|
||||
else if (line->data.type == AbstractTracePlotLineModel::ColumnCommandBusLine)
|
||||
{
|
||||
if (!isColumnCommand())
|
||||
continue;
|
||||
}
|
||||
else if (line->data.type != AbstractTracePlotLineModel::CommandBusLine)
|
||||
continue;
|
||||
|
||||
if (fabs(yVal - line->data.yVal) <= hexagonHeight / 2)
|
||||
@@ -311,7 +336,17 @@ bool Phase::isSelected(Timespan timespan, double yVal, const TraceDrawingPropert
|
||||
{
|
||||
for (const auto &line : drawingProperties.getTracePlotLines())
|
||||
{
|
||||
if (line->data.type != AbstractTracePlotLineModel::DataBusLine)
|
||||
if (line->data.type == AbstractTracePlotLineModel::PseudoChannel0Line)
|
||||
{
|
||||
if (transaction.lock()->rank != 0)
|
||||
continue;
|
||||
}
|
||||
else if (line->data.type == AbstractTracePlotLineModel::PseudoChannel1Line)
|
||||
{
|
||||
if (transaction.lock()->rank != 1)
|
||||
continue;
|
||||
}
|
||||
else if (line->data.type != AbstractTracePlotLineModel::DataBusLine)
|
||||
continue;
|
||||
|
||||
if (fabs(yVal - line->data.yVal) <= hexagonHeight / 2)
|
||||
|
||||
@@ -45,7 +45,8 @@ AbstractTracePlotLineModel::AbstractTracePlotLineModel(const GeneralInfo &genera
|
||||
: QAbstractItemModel(parent), internalSelectionModel(new QItemSelectionModel(this, this)),
|
||||
rootNode(std::make_shared<Node>()), numberOfRanks(generalInfo.numberOfRanks),
|
||||
groupsPerRank(generalInfo.groupsPerRank), banksPerGroup(generalInfo.banksPerGroup),
|
||||
banksPerRank(generalInfo.banksPerRank), commandBusType(getCommandBusType(generalInfo))
|
||||
banksPerRank(generalInfo.banksPerRank), commandBusType(getCommandBusType(generalInfo)),
|
||||
dataBusType(getDataBusType(generalInfo))
|
||||
{
|
||||
createInitialNodes();
|
||||
}
|
||||
@@ -72,7 +73,7 @@ void AbstractTracePlotLineModel::createInitialNodes()
|
||||
addTopLevelNode(
|
||||
std::unique_ptr<Node>(new Node({LineType::ResponseLine, getLabel(LineType::ResponseLine)}, rootNode.get())));
|
||||
|
||||
for (unsigned int rank = numberOfRanks; rank--;)
|
||||
for (unsigned int rank = 0; rank < numberOfRanks; rank++)
|
||||
addTopLevelNode(createRankGroupNode(rank));
|
||||
|
||||
if (commandBusType == CommandBusType::SingleCommandBus)
|
||||
@@ -88,8 +89,18 @@ void AbstractTracePlotLineModel::createInitialNodes()
|
||||
new Node({LineType::ColumnCommandBusLine, getLabel(LineType::ColumnCommandBusLine)}, rootNode.get())));
|
||||
}
|
||||
|
||||
addTopLevelNode(
|
||||
std::unique_ptr<Node>(new Node({LineType::DataBusLine, getLabel(LineType::DataBusLine)}, rootNode.get())));
|
||||
if (dataBusType == DataBusType::LegacyMode)
|
||||
{
|
||||
addTopLevelNode(
|
||||
std::unique_ptr<Node>(new Node({LineType::DataBusLine, getLabel(LineType::DataBusLine)}, rootNode.get())));
|
||||
}
|
||||
else // dataBusType == DataBusType::PseudoChannelMode
|
||||
{
|
||||
addTopLevelNode(std::unique_ptr<Node>(
|
||||
new Node({LineType::PseudoChannel0Line, getLabel(LineType::PseudoChannel0Line)}, rootNode.get())));
|
||||
addTopLevelNode(std::unique_ptr<Node>(
|
||||
new Node({LineType::PseudoChannel1Line, getLabel(LineType::PseudoChannel1Line)}, rootNode.get())));
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<AbstractTracePlotLineModel::Node>
|
||||
@@ -97,9 +108,9 @@ AbstractTracePlotLineModel::createRankGroupNode(unsigned int rank) const
|
||||
{
|
||||
auto rankGroup = std::unique_ptr<Node>(new Node({LineType::RankGroup, getLabel(rank), rank}, rootNode.get()));
|
||||
|
||||
for (unsigned int group = groupsPerRank; group--;)
|
||||
for (unsigned int group = 0; group < groupsPerRank; group++)
|
||||
{
|
||||
for (unsigned int bank = banksPerGroup; bank--;)
|
||||
for (unsigned int bank = 0; bank < banksPerGroup; bank++)
|
||||
{
|
||||
unsigned int absoluteRank = rank;
|
||||
unsigned int absoluteGroup = group + rank * groupsPerRank;
|
||||
@@ -336,6 +347,10 @@ QString AbstractTracePlotLineModel::getLabel(LineType type)
|
||||
return "Command Bus [C]";
|
||||
case LineType::DataBusLine:
|
||||
return "Data Bus";
|
||||
case LineType::PseudoChannel0Line:
|
||||
return "Data Bus [PC0]";
|
||||
case LineType::PseudoChannel1Line:
|
||||
return "Data Bus [PC1]";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@@ -359,6 +374,14 @@ AbstractTracePlotLineModel::CommandBusType AbstractTracePlotLineModel::getComman
|
||||
return CommandBusType::SingleCommandBus;
|
||||
}
|
||||
|
||||
AbstractTracePlotLineModel::DataBusType AbstractTracePlotLineModel::getDataBusType(const GeneralInfo &generalInfo)
|
||||
{
|
||||
if (generalInfo.pseudoChannelMode)
|
||||
return DataBusType::PseudoChannelMode;
|
||||
else
|
||||
return DataBusType::LegacyMode;
|
||||
}
|
||||
|
||||
bool SelectedTracePlotLineModel::removeRows(int row, int count, const QModelIndex &parent)
|
||||
{
|
||||
if (parent != QModelIndex())
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
RowCommandBusLine,
|
||||
ColumnCommandBusLine,
|
||||
DataBusLine,
|
||||
PseudoChannel0Line,
|
||||
PseudoChannel1Line,
|
||||
RankGroup,
|
||||
BankLine
|
||||
};
|
||||
@@ -152,6 +154,12 @@ protected:
|
||||
RowColumnCommandBus
|
||||
};
|
||||
|
||||
enum class DataBusType
|
||||
{
|
||||
LegacyMode,
|
||||
PseudoChannelMode
|
||||
};
|
||||
|
||||
QStringList mimeTypes() const override;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column,
|
||||
@@ -170,6 +178,7 @@ protected:
|
||||
static QString getLabel(unsigned int rank, unsigned int group, unsigned int bank);
|
||||
|
||||
static CommandBusType getCommandBusType(const GeneralInfo &generalInfo);
|
||||
static DataBusType getDataBusType(const GeneralInfo &generalInfo);
|
||||
|
||||
static constexpr auto TRACELINE_MIMETYPE = "application/x-tracelinedata";
|
||||
|
||||
@@ -183,6 +192,7 @@ protected:
|
||||
const unsigned int banksPerRank;
|
||||
|
||||
const CommandBusType commandBusType;
|
||||
const DataBusType dataBusType;
|
||||
};
|
||||
|
||||
class AvailableTracePlotLineModel : public AbstractTracePlotLineModel
|
||||
|
||||
@@ -318,6 +318,8 @@ GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
unsigned per2BankOffset = parameter.isValid() ? parameter.toUInt() : 1;
|
||||
parameter = getParameterFromTable("RowColumnCommandBus", "GeneralInfo");
|
||||
bool rowColumnCommandBus = parameter.isValid() ? parameter.toBool() : false;
|
||||
parameter = getParameterFromTable("PseudoChannelMode", "GeneralInfo");
|
||||
bool pseudoChannelMode = parameter.isValid() ? parameter.toBool() : false;
|
||||
|
||||
uint64_t numberOfPhases = getNumberOfPhases();
|
||||
|
||||
@@ -334,7 +336,7 @@ GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
description, unitOfTime, clkPeriod,
|
||||
windowSize, refreshMaxPostponed, refreshMaxPulledin,
|
||||
controllerThread, maxBufferDepth, per2BankOffset,
|
||||
rowColumnCommandBus};
|
||||
rowColumnCommandBus, pseudoChannelMode};
|
||||
}
|
||||
|
||||
CommandLengths TraceDB::getCommandLengthsFromDB()
|
||||
|
||||
Reference in New Issue
Block a user