From beddeccb647139923bcd19fc9bc8defd2fb9f6c5 Mon Sep 17 00:00:00 2001 From: gernhard2 Date: Tue, 17 Feb 2015 09:22:58 +0100 Subject: [PATCH] Fixed bug in Fifostrict that caused deadlock --- dram/resources/configs/memconfigs/fifo.xml | 2 +- .../configs/memconfigs/fifoStrict.xml | 9 ++++++ dram/resources/simulations/sim-batch.xml | 28 +++++++++++++++++-- dram/src/controller/scheduler/FifoStrict.cpp | 17 ++--------- 4 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 dram/resources/configs/memconfigs/fifoStrict.xml diff --git a/dram/resources/configs/memconfigs/fifo.xml b/dram/resources/configs/memconfigs/fifo.xml index 5cbb790e..35395479 100644 --- a/dram/resources/configs/memconfigs/fifo.xml +++ b/dram/resources/configs/memconfigs/fifo.xml @@ -2,7 +2,7 @@ - + diff --git a/dram/resources/configs/memconfigs/fifoStrict.xml b/dram/resources/configs/memconfigs/fifoStrict.xml new file mode 100644 index 00000000..35395479 --- /dev/null +++ b/dram/resources/configs/memconfigs/fifoStrict.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index bed17c6a..5cfb81b9 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -1,4 +1,4 @@ - + + test.stl- mediabench-epic_32.stl + --> + + + + + + + + + + + + + + + + + + + + voco2.stl + + + diff --git a/dram/src/controller/scheduler/FifoStrict.cpp b/dram/src/controller/scheduler/FifoStrict.cpp index 8699500f..bc7b9b12 100644 --- a/dram/src/controller/scheduler/FifoStrict.cpp +++ b/dram/src/controller/scheduler/FifoStrict.cpp @@ -28,20 +28,9 @@ void FifoStrict::NotifyBeginRD() if(buffer.size() > 0) { - // If the new front element was orginally blocked, because it had to wait on the preceeding fron element, we have to unblock it. - // We only have to unblock if the new fron element is waiting for a RD/WR operation - if(commandIsIn(getNextCommand(*buffer.front()), {Command::Read, Command::Write, Command::ReadA, Command::WriteA}) - && !controllerCore.bankIsBusy(DramExtension::getBank(buffer.front()))) - { - printDebugMessage("Unblocking front element.\n"); - controller.scheduleNextFromScheduler(DramExtension::getBank(buffer.front())); - } - // If the new front element is on the same bank as the old one, we have let it make progress, even when the next command is not a RD/WR - // because we are not calling scheduleNextFromScheduler from the calling side - else if(oldFrontElementBank == DramExtension::getBank(*buffer.front())) - { - controller.scheduleNextFromScheduler(DramExtension::getBank(buffer.front())); - } + // If the new front element was orginally blocked, because it had to wait on the old front element, we have to call + // controller.scheduleNextFromScheduler explicitly, otherwise there will be a deadlock in the system + controller.scheduleNextFromScheduler(DramExtension::getBank(buffer.front())); } }