From 3ce54b8faa6b9e1dc2d637df918c7e11cfc6441a Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Wed, 17 May 2023 12:02:35 +0200 Subject: [PATCH] Fix readability-misleading-indentation warnings --- .../DRAMSys/controller/BankMachine.cpp | 180 +++++++++--------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/src/libdramsys/DRAMSys/controller/BankMachine.cpp b/src/libdramsys/DRAMSys/controller/BankMachine.cpp index fb74fe6d..cdcebf56 100644 --- a/src/libdramsys/DRAMSys/controller/BankMachine.cpp +++ b/src/libdramsys/DRAMSys/controller/BankMachine.cpp @@ -171,7 +171,7 @@ void BankMachineOpen::evaluate() if (!(sleeping || blocked)) { - tlm_generic_payload* newPayload = scheduler.getNextRequest(*this); + tlm_generic_payload *newPayload = scheduler.getNextRequest(*this); if (newPayload == nullptr) return; @@ -180,27 +180,27 @@ void BankMachineOpen::evaluate() { if (ControllerExtension::getRow(*newPayload) == openRow) currentPayload = newPayload; - } - else - { - currentPayload = newPayload; - } + } + else + { + currentPayload = newPayload; + } - if (state == State::Precharged) // bank precharged - nextCommand = Command::ACT; - else if (state == State::Activated) + if (state == State::Precharged) // bank precharged + nextCommand = Command::ACT; + else if (state == State::Activated) + { + if (ControllerExtension::getRow(*currentPayload) == openRow) // row hit { - if (ControllerExtension::getRow(*currentPayload) == openRow) // row hit - { - assert(currentPayload->is_read() || currentPayload->is_write()); - if (currentPayload->is_read()) - nextCommand = Command::RD; - else - nextCommand = Command::WR; - } - else // row miss - nextCommand = Command::PREPB; + assert(currentPayload->is_read() || currentPayload->is_write()); + if (currentPayload->is_read()) + nextCommand = Command::RD; + else + nextCommand = Command::WR; } + else // row miss + nextCommand = Command::PREPB; + } } } @@ -213,7 +213,7 @@ void BankMachineClosed::evaluate() if (!(sleeping || blocked)) { - tlm_generic_payload* newPayload = scheduler.getNextRequest(*this); + tlm_generic_payload *newPayload = scheduler.getNextRequest(*this); if (newPayload == nullptr) return; @@ -222,22 +222,22 @@ void BankMachineClosed::evaluate() { if (ControllerExtension::getRow(*newPayload) == openRow) currentPayload = newPayload; - } - else - { - currentPayload = newPayload; - } + } + else + { + currentPayload = newPayload; + } - if (state == State::Precharged) // bank precharged - nextCommand = Command::ACT; - else if (state == State::Activated) - { - assert(currentPayload->is_read() || currentPayload->is_write()); - if (currentPayload->is_read()) - nextCommand = Command::RDA; - else - nextCommand = Command::WRA; - } + if (state == State::Precharged) // bank precharged + nextCommand = Command::ACT; + else if (state == State::Activated) + { + assert(currentPayload->is_read() || currentPayload->is_write()); + if (currentPayload->is_read()) + nextCommand = Command::RDA; + else + nextCommand = Command::WRA; + } } } @@ -250,7 +250,7 @@ void BankMachineOpenAdaptive::evaluate() if (!(sleeping || blocked)) { - tlm_generic_payload* newPayload = scheduler.getNextRequest(*this); + tlm_generic_payload *newPayload = scheduler.getNextRequest(*this); if (newPayload == nullptr) return; @@ -259,39 +259,39 @@ void BankMachineOpenAdaptive::evaluate() { if (ControllerExtension::getRow(*newPayload) == openRow) currentPayload = newPayload; - } - else - { - currentPayload = newPayload; - } + } + else + { + currentPayload = newPayload; + } - if (state == State::Precharged) // bank precharged - nextCommand = Command::ACT; - else if (state == State::Activated) + if (state == State::Precharged) // bank precharged + nextCommand = Command::ACT; + else if (state == State::Activated) + { + if (ControllerExtension::getRow(*currentPayload) == openRow) // row hit { - if (ControllerExtension::getRow(*currentPayload) == openRow) // row hit + if (scheduler.hasFurtherRequest(bank, currentPayload->get_command()) && + !scheduler.hasFurtherRowHit(bank, openRow, currentPayload->get_command())) { - if (scheduler.hasFurtherRequest(bank, currentPayload->get_command()) - && !scheduler.hasFurtherRowHit(bank, openRow, currentPayload->get_command())) - { - assert(currentPayload->is_read() || currentPayload->is_write()); - if (currentPayload->is_read()) - nextCommand = Command::RDA; - else - nextCommand = Command::WRA; - } + assert(currentPayload->is_read() || currentPayload->is_write()); + if (currentPayload->is_read()) + nextCommand = Command::RDA; else - { - assert(currentPayload->is_read() || currentPayload->is_write()); - if (currentPayload->is_read()) - nextCommand = Command::RD; - else - nextCommand = Command::WR; - } + nextCommand = Command::WRA; + } + else + { + assert(currentPayload->is_read() || currentPayload->is_write()); + if (currentPayload->is_read()) + nextCommand = Command::RD; + else + nextCommand = Command::WR; } - else // row miss - nextCommand = Command::PREPB; } + else // row miss + nextCommand = Command::PREPB; + } } } @@ -305,7 +305,7 @@ void BankMachineClosedAdaptive::evaluate() if (!(sleeping || blocked)) { - tlm_generic_payload* newPayload = scheduler.getNextRequest(*this); + tlm_generic_payload *newPayload = scheduler.getNextRequest(*this); if (newPayload == nullptr) return; @@ -314,38 +314,38 @@ void BankMachineClosedAdaptive::evaluate() { if (ControllerExtension::getRow(*newPayload) == openRow) currentPayload = newPayload; - } - else - { - currentPayload = newPayload; - } + } + else + { + currentPayload = newPayload; + } - if (state == State::Precharged) // bank precharged - nextCommand = Command::ACT; - else if (state == State::Activated) + if (state == State::Precharged) // bank precharged + nextCommand = Command::ACT; + else if (state == State::Activated) + { + if (ControllerExtension::getRow(*currentPayload) == openRow) // row hit { - if (ControllerExtension::getRow(*currentPayload) == openRow) // row hit + if (scheduler.hasFurtherRowHit(bank, openRow, currentPayload->get_command())) { - if (scheduler.hasFurtherRowHit(bank, openRow, currentPayload->get_command())) - { - assert(currentPayload->is_read() || currentPayload->is_write()); - if (currentPayload->is_read()) - nextCommand = Command::RD; - else - nextCommand = Command::WR; - } + assert(currentPayload->is_read() || currentPayload->is_write()); + if (currentPayload->is_read()) + nextCommand = Command::RD; else - { - assert(currentPayload->is_read() || currentPayload->is_write()); - if (currentPayload->is_read()) - nextCommand = Command::RDA; - else - nextCommand = Command::WRA; - } + nextCommand = Command::WR; + } + else + { + assert(currentPayload->is_read() || currentPayload->is_write()); + if (currentPayload->is_read()) + nextCommand = Command::RDA; + else + nextCommand = Command::WRA; } - else // row miss, can happen when RD/WR mode is switched - nextCommand = Command::PREPB; } + else // row miss, can happen when RD/WR mode is switched + nextCommand = Command::PREPB; + } } }