also shows clks now in tooltip in analyzer
This commit is contained in:
@@ -6,11 +6,18 @@
|
||||
//time in nanoseconds
|
||||
typedef long long traceTime;
|
||||
|
||||
inline QString formatTraceTimePretty(traceTime time)
|
||||
inline QString prettyFormatTime(traceTime time)
|
||||
{
|
||||
return QString::number(time/1000) + QString(" ns");
|
||||
}
|
||||
|
||||
inline QString formatInClks(traceTime time, unsigned int clkPeriod)
|
||||
{
|
||||
long long numberOfClockCovered = time/clkPeriod;
|
||||
QString suffix = (numberOfClockCovered != 1) ? QString(" clks") : QString(" clk");
|
||||
return QString::number(numberOfClockCovered) + suffix;
|
||||
}
|
||||
|
||||
inline traceTime alignToClk(traceTime time, unsigned int clkPeriod)
|
||||
{
|
||||
return round(1.0*time/clkPeriod)*clkPeriod;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
//define symbol printqueries if all queries should be printed to the console
|
||||
//#define printqueries
|
||||
#define printqueries
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -175,7 +175,7 @@ GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
description += memspec + "\n";
|
||||
description += "Number of Transactions: " + QString::number(numberOfTransactions) + "\n";
|
||||
description += "Clock period: " + QString::number(clkPeriod) + " " + unitOfTime + "\n";
|
||||
description += "Length of trace: " + formatTraceTimePretty(traceEnd);
|
||||
description += "Length of trace: " + prettyFormatTime(traceEnd);
|
||||
|
||||
return GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0,traceEnd),numberOfBanks,description,unitOfTime,clkPeriod);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ using namespace std;
|
||||
|
||||
EvaluationTool::EvaluationTool(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::EvaluationTool), path("../../dram/resources/scripts""")
|
||||
ui(new Ui::EvaluationTool), resourcesRelPath("/../../dram/resources/scripts""")
|
||||
{
|
||||
ui->setupUi(this);
|
||||
traceFilesModel = new QStandardItemModel(this);
|
||||
@@ -83,7 +83,9 @@ void EvaluationTool::on_btn_test_clicked()
|
||||
|
||||
void EvaluationTool::runTests()
|
||||
{
|
||||
PythonCaller pythonCaller(this->path);
|
||||
QString resourcesAbsPath = QApplication::applicationDirPath() + this->resourcesRelPath;
|
||||
qDebug() << resourcesAbsPath;
|
||||
PythonCaller pythonCaller(this->resourcesRelPath);
|
||||
ui->traceTestTreeWidget->clear();
|
||||
ui->testLight->setGray();
|
||||
|
||||
@@ -116,8 +118,9 @@ void EvaluationTool::on_btn_calculateMetrics_clicked()
|
||||
|
||||
void EvaluationTool::calculateMetrics()
|
||||
{
|
||||
qDebug() << this->path;
|
||||
PythonCaller pythonCaller(this->path);
|
||||
QString resourcesAbsPath = QApplication::applicationDirPath() + this->resourcesRelPath;
|
||||
qDebug() << resourcesAbsPath;
|
||||
PythonCaller pythonCaller(this->resourcesRelPath);
|
||||
ui->traceMetricTreeWidget->clear();
|
||||
for(int row = 0; row < traceFilesModel->rowCount(); ++row)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
Ui::EvaluationTool *ui;
|
||||
QStandardItemModel *traceFilesModel;
|
||||
std::vector<TraceCalculatedMetrics> calculatedMetrics;
|
||||
QString path;
|
||||
QString resourcesRelPath;
|
||||
|
||||
class TraceFileItem : public QStandardItem
|
||||
{
|
||||
|
||||
@@ -60,6 +60,6 @@ void CommentTreeWidget::ContextMenuRequested(QPoint point)
|
||||
|
||||
CommentTreeWidget::CommentTreeItem::CommentTreeItem(QTreeWidget *parent, const Comment &comment):QTreeWidgetItem(parent),comment(comment)
|
||||
{
|
||||
this->setText(0,formatTraceTimePretty(comment.Time()));
|
||||
this->setText(0,prettyFormatTime(comment.Time()));
|
||||
this->setText(1,comment.Text());
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void DebugMessageTreeWidget::showDebugMessages(const vector<Comment>& comments)
|
||||
{
|
||||
if(currentTime != comment.Time())
|
||||
{
|
||||
addTopLevelItem(new QTreeWidgetItem({formatTraceTimePretty(comment.Time()), formatDebugMessage(comment.Text())}));
|
||||
addTopLevelItem(new QTreeWidgetItem({prettyFormatTime(comment.Time()), formatDebugMessage(comment.Text())}));
|
||||
currentTime = comment.Time();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -11,12 +11,14 @@ QwtText TracePlotMouseLabel::trackerText(const QPoint &point) const
|
||||
if(mode == MouseLabelMode::AbsoluteTime)
|
||||
{
|
||||
traceTime mouseTime = static_cast<traceTime>(traceplot->invTransform(traceplot->xBottom, point.x()));
|
||||
return QwtText(formatTraceTimePretty(alignToClk(mouseTime,clkPeriod)));
|
||||
return QwtText(prettyFormatTime(alignToClk(mouseTime,clkPeriod)) + "(" + formatInClks(mouseTime,clkPeriod) + ")");
|
||||
}
|
||||
else if(mode == MouseLabelMode::Timedifference)
|
||||
{
|
||||
long long numberOfClockCovered = timeDifferenceSpan.timeCovered()/clkPeriod;
|
||||
QString suffix = (numberOfClockCovered != 1) ? QString(" clks") : QString(" clk");
|
||||
return(QwtText(QString::number(numberOfClockCovered) + suffix));
|
||||
return QwtText(formatInClks(timeDifferenceSpan.timeCovered(),clkPeriod));
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public:
|
||||
TracePlotMouseLabel(TracePlot* traceplot, unsigned int clkPeriod, Timespan& timeDifferenceSpan):
|
||||
QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,QwtPlotPicker::VLineRubberBand,
|
||||
QwtPicker::AlwaysOn, traceplot->canvas()),
|
||||
traceplot(traceplot),clkPeriod(clkPeriod), timeDifferenceSpan(timeDifferenceSpan), mode(MouseLabelMode::AbsoluteTime){}
|
||||
mode(MouseLabelMode::AbsoluteTime),traceplot(traceplot),clkPeriod(clkPeriod), timeDifferenceSpan(timeDifferenceSpan){}
|
||||
|
||||
void setMode(MouseLabelMode mode);
|
||||
protected:
|
||||
@@ -21,8 +21,8 @@ protected:
|
||||
private:
|
||||
MouseLabelMode mode;
|
||||
TracePlot* traceplot;
|
||||
Timespan& timeDifferenceSpan;
|
||||
unsigned int clkPeriod;
|
||||
Timespan& timeDifferenceSpan;
|
||||
};
|
||||
|
||||
#endif // TRACEPLOTPICKER_H
|
||||
|
||||
@@ -73,8 +73,6 @@ void TraceNavigator::commitChangesToDB()
|
||||
}
|
||||
|
||||
traceFile.updateComments(commentsToInsert);
|
||||
//TODO : reinsert file description logic
|
||||
//traceFile.updateFileDescription(traceFile.getGeneralInfo().Description());
|
||||
changesToCommitExist = false;
|
||||
}
|
||||
|
||||
@@ -86,12 +84,6 @@ void TraceNavigator::getCommentsFromDB()
|
||||
}
|
||||
}
|
||||
|
||||
void TraceNavigator::setFileDescripton(const QString &description)
|
||||
{
|
||||
//TODO : reinsert file description logic
|
||||
changesToCommitExist = true;
|
||||
}
|
||||
|
||||
void TraceNavigator::refreshData()
|
||||
{
|
||||
traceFile.refreshData();
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
const CommentMap& getComments(){return comments;}
|
||||
void removeCommentAtTime(traceTime time);
|
||||
|
||||
void setFileDescripton(const QString& text);
|
||||
void commitChangesToDB();
|
||||
void refreshData();
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ void TracePlot::on_insertComment()
|
||||
{
|
||||
traceTime time = invTransform(xBottom, contextMenuMouseDown.x());
|
||||
bool ok;
|
||||
QString text = QInputDialog::getText(this,QString("Insert comment"),QString("Insert comment at ") + formatTraceTimePretty(time),QLineEdit::Normal,QString(),&ok);
|
||||
QString text = QInputDialog::getText(this,QString("Insert comment"),QString("Insert comment at ") + prettyFormatTime(time),QLineEdit::Normal,QString(),&ok);
|
||||
if(ok)
|
||||
{
|
||||
navigator->insertComment(Comment(time,text));
|
||||
|
||||
@@ -54,7 +54,7 @@ TransactionTreeWidget::TransactionTreeItem::TransactionTreeItem(QTreeWidget *par
|
||||
QTreeWidgetItem *time = new QTreeWidgetItem({"Timespan"});
|
||||
AppendTimespan(time, transaction->Span());
|
||||
this->addChild(time);
|
||||
this->addChild(new QTreeWidgetItem( {"Lenght", formatTraceTimePretty(transaction->Span().timeCovered())}));
|
||||
this->addChild(new QTreeWidgetItem( {"Lenght", prettyFormatTime(transaction->Span().timeCovered())}));
|
||||
|
||||
this->addChild(new QTreeWidgetItem( {"Channel", QString::number(transaction->Channel())}));
|
||||
this->addChild(new QTreeWidgetItem( {"Bank", QString::number(transaction->Bank())} ));
|
||||
@@ -89,6 +89,6 @@ void TransactionTreeWidget::TransactionTreeItem::AppendPhase(QTreeWidgetItem *pa
|
||||
|
||||
void TransactionTreeWidget::TransactionTreeItem::AppendTimespan(QTreeWidgetItem *parent, const Timespan ×pan)
|
||||
{
|
||||
parent->setText(1, formatTraceTimePretty(timespan.Begin()));
|
||||
parent->setText(2, formatTraceTimePretty(timespan.End()));
|
||||
parent->setText(1, prettyFormatTime(timespan.Begin()));
|
||||
parent->setText(2, prettyFormatTime(timespan.End()));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ TraceFileTab::TraceFileTab(QWidget *parent,const QString& path) :
|
||||
|
||||
TraceFileTab::~TraceFileTab()
|
||||
{
|
||||
navigator->setFileDescripton(ui->fileDescriptionEdit->toPlainText());
|
||||
navigator->commitChangesToDB();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -9,21 +9,14 @@
|
||||
|
||||
<memconfigs>
|
||||
<memconfig>fifo.xml</memconfig>
|
||||
<memconfig>fr_fcfs.xml</memconfig>
|
||||
<!-- <memconfig>fr_fcfs.xml</memconfig>
|
||||
<memconfig>par_bs.xml</memconfig>
|
||||
</memconfigs>
|
||||
--> </memconfigs>
|
||||
<trace-setups>
|
||||
|
||||
<!-- <trace-setup id="aes">
|
||||
<device>chstone-aes_32.stl</device>
|
||||
</trace-setup>
|
||||
|
||||
<trace-setup id="motion">
|
||||
<device>chstone-motion_32.stl</device>
|
||||
</trace-setup> -->
|
||||
|
||||
<trace-setup id="media">
|
||||
<device>mediabench-epic_32.stl</device>
|
||||
<device>chstone-jpeg_32.stl</device>
|
||||
</trace-setup>
|
||||
|
||||
</trace-setups>
|
||||
|
||||
@@ -39,7 +39,7 @@ int sc_main(int argc, char **argv)
|
||||
if(argc > 1)
|
||||
simulationToRun = argv[1];
|
||||
else
|
||||
simulationToRun = "tests.xml";
|
||||
simulationToRun = "sim-batch.xml";
|
||||
|
||||
SimulationManager manager(resources);
|
||||
manager.loadSimulationsFromXML(resources + "/simulations/" + simulationToRun);
|
||||
|
||||
Reference in New Issue
Block a user