From 72f3d04189956e39aad6a99ba08b7cb1ed758ce5 Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Fri, 16 Jun 2023 13:42:14 +0200 Subject: [PATCH] Fix bug in checker, remove redundant checks. --- .../controller/checker/CheckerHBM3.cpp | 66 +------------------ 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/extensions/standards/HBM3/DRAMSys/controller/checker/CheckerHBM3.cpp b/extensions/standards/HBM3/DRAMSys/controller/checker/CheckerHBM3.cpp index 16b69f06..8327953f 100644 --- a/extensions/standards/HBM3/DRAMSys/controller/checker/CheckerHBM3.cpp +++ b/extensions/standards/HBM3/DRAMSys/controller/checker/CheckerHBM3.cpp @@ -95,7 +95,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE); - lastCommandStart = lastScheduledByCommandAndRank[Command::PREPB][bank.ID()]; + lastCommandStart = lastScheduledByCommandAndRank[Command::PREPB][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPPD); @@ -115,10 +115,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDRD + memSpec->tCK); - lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); @@ -135,10 +131,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS); - lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDL); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDL); @@ -167,30 +159,14 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDWR + memSpec->tCK); - lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RDA][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); @@ -219,10 +195,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDRD + memSpec->tCK); - lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); @@ -272,30 +244,14 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDWR + memSpec->tCK); - lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RDA][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW); - lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL); @@ -382,10 +338,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RFMPB][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); - lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); @@ -533,10 +485,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::REFPB][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); - lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); @@ -549,10 +497,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RFMPB][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); - lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); @@ -662,10 +606,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::REFPB][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); - lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); @@ -678,10 +618,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB); - lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RFMPB][bankGroup.ID()]; - if (lastCommandStart != scMaxTime) - earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD); - lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()]; if (lastCommandStart != scMaxTime) earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);