diff --git a/.gitignore b/.gitignore index f6cc4740..897984aa 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /release /dram/debug /dram/release +/dram/build +*pro.user* *.tdb *.tdb-journal *.out diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index 7b708b02..df68fb4c 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -108,11 +108,7 @@ private: DebugManager& debugManager; }; - - - // --- IMPLEMENTATION ----- - template void Controller::buildScheduler() { @@ -293,7 +289,7 @@ void Controller::controllerCorePEQCallback(tlm_generic_payload &payloa { // special case for the Fifo_strict scheduler, because it may have to unblock // the current front element - dynamic_cast(scheduler)->NotifyBeginRD(); + dynamic_cast(scheduler)->NotifyBeginRDWR(); } else { @@ -355,12 +351,7 @@ void Controller::frontendPEQCallback(tlm_generic_payload &payload, con sendToFrontend(payload, END_REQ, SC_ZERO_TIME); scheduler->schedule(&payload); - - // Since we are triggering the scheduling of the next action on the bank - // because of an incoming transaction, we have to check if the bank - // is still busy. If it is, we let the end of the command which is currently in - // progress trigger the next scheduling - scheduleNextFromScheduler(DramExtension::getExtension(payload).getBank()); + scheduleNextFromScheduler(DramExtension::getExtension(payload).getBank()); } else if (phase == END_RESP) { @@ -371,14 +362,7 @@ void Controller::frontendPEQCallback(tlm_generic_payload &payload, con sendToFrontend(*backpressure, END_REQ, SC_ZERO_TIME); scheduler->schedule(backpressure); - // Since we are triggering the scheduling of the next action on the bank - // because of an incoming transaction, we have to check if the bank - // is still busy. If it is, we let the end of the command which is currently in - // progress trigger the next scheduling - if(!controllerCore->bankIsBusy(DramExtension::getBank(payload))) - { - scheduleNextFromScheduler(DramExtension::getExtension(backpressure).getBank()); - } + scheduleNextFromScheduler(DramExtension::getExtension(backpressure).getBank()); backpressure = NULL; } @@ -426,6 +410,7 @@ unsigned int Controller::getTotalNumberOfPayloadsInSystem() template void Controller::scheduleNextFromScheduler(Bank bank) { + if(controllerCore->bankIsBusy(bank)) { return; @@ -473,7 +458,6 @@ void Controller::dramPEQCallback(tlm_generic_payload &payload, const t else if (phase == END_REFA) { printDebugMessage("Finished auto refresh on all banks "); - for(Bank bank : controllerCore->getBanks()) { if(numberOfPayloadsInSystem[bank] == 0) diff --git a/dram/src/controller/core/refresh/RefreshManager.cpp b/dram/src/controller/core/refresh/RefreshManager.cpp index 98ddfb2e..2953e766 100644 --- a/dram/src/controller/core/refresh/RefreshManager.cpp +++ b/dram/src/controller/core/refresh/RefreshManager.cpp @@ -51,14 +51,15 @@ void RefreshManager::scheduleRefresh(tlm::tlm_generic_payload& payload, sc_time } } + ScheduledCommand refreshAllMaster(Command::AutoRefresh, time, getExecutionTime(Command::AutoRefresh, refreshPayloads[Bank(0)]), + DramExtension::getExtension(refreshPayloads[Bank(0)])); + controllerCore.getCommandChecker(Command::AutoRefresh).delayToSatisfyConstraints(refreshAllMaster); + for (Bank bank : controllerCore.getBanks()) { - ScheduledCommand refresh(Command::AutoRefresh, time, getExecutionTime(Command::AutoRefresh, refreshPayloads[bank]), - DramExtension::getExtension(refreshPayloads[bank])); - controllerCore.getCommandChecker(Command::AutoRefresh).delayToSatisfyConstraints(refresh); + ScheduledCommand refresh(Command::AutoRefresh, refreshAllMaster.getStart(), refreshAllMaster.getExecutionTime(),refreshPayloads[bank]); controllerCore.state.change(refresh); controllerCore.controller.send(refresh, refreshPayloads[bank]); - DramExtension::getExtension(refreshPayloads[bank]).incrementRow(); } diff --git a/dram/src/controller/scheduler/FifoStrict.cpp b/dram/src/controller/scheduler/FifoStrict.cpp index a38c3b17..9c45f326 100644 --- a/dram/src/controller/scheduler/FifoStrict.cpp +++ b/dram/src/controller/scheduler/FifoStrict.cpp @@ -19,7 +19,7 @@ void FifoStrict::printFrontElementState() } } -void FifoStrict::NotifyBeginRD() +void FifoStrict::NotifyBeginRDWR() { buffer.erase(buffer.begin()); printDebugMessage("Front element finished. New front Element: "); diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index 87b9cc13..25510d86 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -26,7 +26,6 @@ using namespace std; using namespace tlm; -; using namespace Data; diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index 2da7a398..6c36a842 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -39,7 +39,8 @@ int sc_main(int argc, char **argv) if(argc > 1) simulationToRun = argv[1]; else - simulationToRun = resources + "/simulations/sim-batch.xml"; + //simulationToRun = resources + "/simulations/sim-batch.xml"; + simulationToRun = "/home/jungma/projects/dram.vp.system/dram/resources/simulations/sim-batch.xml"; SimulationManager manager(resources); manager.loadSimulationsFromXML(simulationToRun);