|
|
|
|
@@ -39,18 +39,18 @@
|
|
|
|
|
using namespace sc_core;
|
|
|
|
|
using namespace tlm;
|
|
|
|
|
|
|
|
|
|
CheckerHBM3::CheckerHBM3(const Configuration& config)
|
|
|
|
|
CheckerHBM3::CheckerHBM3(const Configuration &config)
|
|
|
|
|
{
|
|
|
|
|
memSpec = dynamic_cast<const MemSpecHBM3 *>(config.memSpec.get());
|
|
|
|
|
if (memSpec == nullptr)
|
|
|
|
|
SC_REPORT_FATAL("CheckerHBM3", "Wrong MemSpec chosen");
|
|
|
|
|
|
|
|
|
|
lastScheduledByCommandAndBank = std::vector<std::vector<sc_time>>
|
|
|
|
|
(Command::numberOfCommands(), std::vector<sc_time>(memSpec->banksPerChannel, sc_max_time()));
|
|
|
|
|
lastScheduledByCommandAndBankGroup = std::vector<std::vector<sc_time>>
|
|
|
|
|
(Command::numberOfCommands(), std::vector<sc_time>(memSpec->bankGroupsPerChannel, sc_max_time()));
|
|
|
|
|
lastScheduledByCommandAndRank = std::vector<std::vector<sc_time>>
|
|
|
|
|
(Command::numberOfCommands(), std::vector<sc_time>(memSpec->ranksPerChannel, sc_max_time()));
|
|
|
|
|
lastScheduledByCommandAndBank = std::vector<std::vector<sc_time>>(
|
|
|
|
|
Command::numberOfCommands(), std::vector<sc_time>(memSpec->banksPerChannel, sc_max_time()));
|
|
|
|
|
lastScheduledByCommandAndBankGroup = std::vector<std::vector<sc_time>>(
|
|
|
|
|
Command::numberOfCommands(), std::vector<sc_time>(memSpec->bankGroupsPerChannel, sc_max_time()));
|
|
|
|
|
lastScheduledByCommandAndRank = std::vector<std::vector<sc_time>>(
|
|
|
|
|
Command::numberOfCommands(), std::vector<sc_time>(memSpec->ranksPerChannel, sc_max_time()));
|
|
|
|
|
lastScheduledByCommand = std::vector<sc_time>(Command::numberOfCommands(), sc_max_time());
|
|
|
|
|
lastCommandOnRasBus = sc_max_time();
|
|
|
|
|
lastCommandOnCasBus = sc_max_time();
|
|
|
|
|
@@ -58,35 +58,62 @@ CheckerHBM3::CheckerHBM3(const Configuration& config)
|
|
|
|
|
|
|
|
|
|
bankwiseRefreshCounter = std::vector<unsigned>(memSpec->ranksPerChannel);
|
|
|
|
|
|
|
|
|
|
tBURST = memSpec->defaultBurstLength / memSpec->dataRate * memSpec->tCK;
|
|
|
|
|
tRDPDE = memSpec->tRL + memSpec->tPL + tBURST + memSpec->tCK;
|
|
|
|
|
tRDSRE = tRDPDE;
|
|
|
|
|
tWRPRE = memSpec->tWL + tBURST + memSpec->tWR;
|
|
|
|
|
tWRPDE = memSpec->tWL + memSpec->tPL + tBURST + memSpec->tCK + memSpec->tWR;
|
|
|
|
|
tWRAPDE = memSpec->tWL + memSpec->tPL + tBURST + memSpec->tCK + memSpec->tWR;
|
|
|
|
|
tWRRDS = memSpec->tWL + tBURST + memSpec->tWTRS;
|
|
|
|
|
tWRRDL = memSpec->tWL + tBURST + memSpec->tWTRL;
|
|
|
|
|
tRDPDE = memSpec->tRL + memSpec->tPL + 2 * memSpec->tCK;
|
|
|
|
|
tRDSRE = memSpec->tRL + memSpec->tPL + 3 * memSpec->tCK;
|
|
|
|
|
tWRPRE = memSpec->tWL + 2 * memSpec->tCK + memSpec->tWR;
|
|
|
|
|
tWRPDE = memSpec->tWL + memSpec->tPL + 3 * memSpec->tCK + memSpec->tWR;
|
|
|
|
|
tWRAPDE = memSpec->tWL + memSpec->tPL + 3 * memSpec->tCK + memSpec->tWR;
|
|
|
|
|
tWRRDS = memSpec->tWL + 2 * memSpec->tCK + memSpec->tWTRS;
|
|
|
|
|
tWRRDL = memSpec->tWL + 2 * memSpec->tCK + memSpec->tWTRL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic_payload& payload) const
|
|
|
|
|
sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic_payload &payload) const
|
|
|
|
|
{
|
|
|
|
|
Rank rank = DramExtension::getRank(payload);
|
|
|
|
|
BankGroup bankGroup = DramExtension::getBankGroup(payload);
|
|
|
|
|
Bank bank = DramExtension::getBank(payload);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sc_time lastCommandStart;
|
|
|
|
|
sc_time earliestTimeToStart = sc_time_stamp();
|
|
|
|
|
|
|
|
|
|
if (command == Command::RD || command == Command::RDA)
|
|
|
|
|
if (command == Command::PREPB)
|
|
|
|
|
{
|
|
|
|
|
unsigned burstLength = DramExtension::getBurstLength(payload);
|
|
|
|
|
assert(!(memSpec->ranksPerChannel == 1) || (burstLength == 2 || burstLength == 4)); // Legacy mode
|
|
|
|
|
// assert(!(memSpec->ranksPerChannel == 2) || (burstLength == 4)); // Pseudo-channel mode
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::PREPB][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPPD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPPD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::RD)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDRD + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
@@ -103,12 +130,9 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS);
|
|
|
|
|
|
|
|
|
|
if (command == Command::RDA)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE - memSpec->tRTP);
|
|
|
|
|
}
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
@@ -126,30 +150,42 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::WR || command == Command::WRA)
|
|
|
|
|
else if (command == Command::WR)
|
|
|
|
|
{
|
|
|
|
|
unsigned burstLength = DramExtension::getBurstLength(payload);
|
|
|
|
|
assert(!(memSpec->ranksPerChannel == 1) || (burstLength == 2)); // Legacy mode
|
|
|
|
|
// assert(!(memSpec->ranksPerChannel == 2) || (burstLength == 4)); // Pseudo-channel mode
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDWR + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RDA][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
@@ -166,7 +202,112 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::RDA)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDRD + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RDA][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tWL + 2 * memSpec->tCK +
|
|
|
|
|
std::max(memSpec->tWR - memSpec->tRTP, memSpec->tWTRL));
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WR][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WRA][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::WRA)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRCDWR + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RDA][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTW);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WR][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WR][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WRA][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDL);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCDS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
@@ -188,11 +329,13 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RDA][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + memSpec->tRP - memSpec->tCK);
|
|
|
|
|
earliestTimeToStart =
|
|
|
|
|
std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + memSpec->tRP - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WRA][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP - memSpec->tCK);
|
|
|
|
|
earliestTimeToStart =
|
|
|
|
|
std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::PREPB][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
@@ -202,11 +345,11 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXP];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXP][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
@@ -218,37 +361,85 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::REFPB][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RFMPB][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RFMPB][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::SREFEX][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
if (last4Activates[rank.ID()].size() >= 4)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, last4Activates[rank.ID()].front() + memSpec->tFAW - memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart =
|
|
|
|
|
std::max(earliestTimeToStart, last4Activates[rank.ID()].front() + memSpec->tFAW);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::PREPB)
|
|
|
|
|
else if (command == Command::REFAB)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::ACT][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + memSpec->tCK);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXP][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::SREFEX][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::PREAB)
|
|
|
|
|
@@ -273,7 +464,15 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPPD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPPD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
@@ -284,46 +483,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::REFAB)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::ACT][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXP];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::REFPB)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
@@ -353,11 +512,11 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXP];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXP][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
@@ -369,6 +528,34 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::REFPB][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RFMPB][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RFMPB][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::SREFEX][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
@@ -378,66 +565,167 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
|
|
|
|
|
if (last4Activates[rank.ID()].size() >= 4)
|
|
|
|
|
earliestTimeToStart =
|
|
|
|
|
std::max(earliestTimeToStart, last4Activates[rank.ID()].front() + memSpec->tFAW);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::SREFEN)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::ACT][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart =
|
|
|
|
|
std::max(earliestTimeToStart, lastCommandStart + std::max(memSpec->tRTP + memSpec->tRP, tRDSRE));
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PREAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXP][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::SREFEX][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
|
|
|
|
|
|
|
|
|
|
if (last4Activates[rank.ID()].size() >= 4)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, last4Activates[rank.ID()].front() + memSpec->tFAW);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::RFMAB)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::ACT][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::RFMAB)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::ACT][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRRDL + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::ACT][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRRDS + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::REFPB][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::REFPB][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMAB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RFMPB][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RFMPB][bankGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RFMPB][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::PDEA)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RD];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RDA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WR];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WR][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WRA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCKE);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::PDXA)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDEA];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::PDEP)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RD];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RD][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RDA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::RDA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WRA];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::WRA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAPDE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXP];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDXP][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCKE);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::SREFEX][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
|
|
|
|
|
|
|
|
|
|
@@ -445,62 +733,32 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::PDXP)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDEP];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDEP][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::SREFEN)
|
|
|
|
|
else if (command == Command::PDXA)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::ACT];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::PDEA][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + memSpec->tCK);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RDA];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + std::max(memSpec->tRTP + memSpec->tRP, tRDSRE));
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WRA];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PREPB];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PREAB];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::PDXP];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::REFAB];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::REFPB];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else if (command == Command::SREFEX)
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::SREFEN];
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndRank[Command::SREFEN][rank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCKESR);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SC_REPORT_FATAL("CheckerHBM3", "Unknown command!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (command.isRasCommand())
|
|
|
|
|
{
|
|
|
|
|
@@ -516,14 +774,14 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|
|
|
|
return earliestTimeToStart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CheckerHBM3::insert(Command command, const tlm_generic_payload& payload)
|
|
|
|
|
void CheckerHBM3::insert(Command command, const tlm_generic_payload &payload)
|
|
|
|
|
{
|
|
|
|
|
Rank rank = DramExtension::getRank(payload);
|
|
|
|
|
BankGroup bankGroup = DramExtension::getBankGroup(payload);
|
|
|
|
|
Bank bank = DramExtension::getBank(payload);
|
|
|
|
|
|
|
|
|
|
PRINTDEBUGMESSAGE("CheckerHBM3", "Changing state on bank " + std::to_string(bank.ID())
|
|
|
|
|
+ " command is " + command.toString());
|
|
|
|
|
PRINTDEBUGMESSAGE("CheckerHBM3",
|
|
|
|
|
"Changing state on bank " + std::to_string(bank.ID()) + " command is " + command.toString());
|
|
|
|
|
|
|
|
|
|
lastScheduledByCommandAndBank[command][bank.ID()] = sc_time_stamp();
|
|
|
|
|
lastScheduledByCommandAndBankGroup[command][bankGroup.ID()] = sc_time_stamp();
|
|
|
|
|
|