From 9d276335faaa77340a7b7707e74bd20f3c5e04ff Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Tue, 15 Jul 2014 13:14:34 +0200 Subject: [PATCH] fixed bug in controller state cleanup method --- analyzer/analyzer/evaluationtool.cpp | 4 ++-- analyzer/analyzer/paths.pro | 6 ++++-- dram/src/controller/core/ControllerState.cpp | 13 ++----------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/analyzer/analyzer/evaluationtool.cpp b/analyzer/analyzer/evaluationtool.cpp index 16f2af3d..5b9ec6d3 100644 --- a/analyzer/analyzer/evaluationtool.cpp +++ b/analyzer/analyzer/evaluationtool.cpp @@ -85,7 +85,7 @@ void EvaluationTool::runTests() { QString resourcesAbsPath = QApplication::applicationDirPath() + this->resourcesRelPath; qDebug() << resourcesAbsPath; - PythonCaller pythonCaller(this->resourcesRelPath); + PythonCaller pythonCaller(resourcesAbsPath); ui->traceTestTreeWidget->clear(); ui->testLight->setGray(); @@ -120,7 +120,7 @@ void EvaluationTool::calculateMetrics() { QString resourcesAbsPath = QApplication::applicationDirPath() + this->resourcesRelPath; qDebug() << resourcesAbsPath; - PythonCaller pythonCaller(this->resourcesRelPath); + PythonCaller pythonCaller(resourcesAbsPath); ui->traceMetricTreeWidget->clear(); for(int row = 0; row < traceFilesModel->rowCount(); ++row) { diff --git a/analyzer/analyzer/paths.pro b/analyzer/analyzer/paths.pro index 4502b6fe..102db5af 100644 --- a/analyzer/analyzer/paths.pro +++ b/analyzer/analyzer/paths.pro @@ -8,6 +8,8 @@ CONFIG(qwt){ CONFIG(python){ - LIBS += -lpython3.4m - INCLUDEPATH += /opt/python/include/python3.4m +# LIBS += -L/opt/python/lib -lpython3.4m +# INCLUDEPATH += /opt/python/include/python3.4m + LIBS += -lpython3.3m + INCLUDEPATH += /usr/include/python3.3 } diff --git a/dram/src/controller/core/ControllerState.cpp b/dram/src/controller/core/ControllerState.cpp index 4c27f6a5..7d0d6741 100644 --- a/dram/src/controller/core/ControllerState.cpp +++ b/dram/src/controller/core/ControllerState.cpp @@ -63,15 +63,9 @@ const ScheduledCommand ControllerState::getLastScheduledCommand(Bank bank) void ControllerState::change(const ScheduledCommand& scheduledCommand) { - //TODO double check if slot free? bus.blockSlot(scheduledCommand.getStart()); -// if(getLastCommand(scheduledCommand.getCommand()).getStart() > scheduledCommand.getStart()) -// cout << commandToString(scheduledCommand.getCommand()) << " wurde vorgezogen! " << std::endl; - lastScheduledByCommandAndBank[scheduledCommand.getCommand()][scheduledCommand.getBank()] = scheduledCommand; - //lastScheduledByBank[scheduledCommand.getCommand()] = scheduledCommand; - switch (scheduledCommand.getCommand()) { @@ -107,10 +101,6 @@ void ControllerState::change(const ScheduledCommand& scheduledCommand) default: break; } - -// cout << "Last Data Strobe Commands Size: " << lastDataStrobeCommands.size() << std::endl; -// cout << "Last Activates Size: " << lastActivates.size() << std::endl; -// cout << "Bus Slots: " << bus.slotSet.size(); } void ControllerState::cleanUp(sc_time time) @@ -123,7 +113,8 @@ void ControllerState::cleanUp(sc_time time) tmp.push_back(command); } lastDataStrobeCommands = tmp; - lastActivates.erase(lastActivates.begin(), lastActivates.lower_bound(time - config->Timings.tActHistory())); + if(time >= config->Timings.tActHistory()) + lastActivates.erase(lastActivates.begin(), lastActivates.lower_bound(time - config->Timings.tActHistory())); } } /* namespace controller */