Add lastCommandOn{C,R}asBus != scMaxTime check for HBM2 and HBM3

This commit is contained in:
2023-07-04 10:27:41 +02:00
parent e3bd773cac
commit 81eaccf3d6
5 changed files with 41 additions and 48 deletions

View File

@@ -107,6 +107,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK / 2);
}
else if (command == Command::RD)
@@ -151,6 +152,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
if (lastCommandOnCasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
}
else if (command == Command::WR)
@@ -187,6 +189,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
if (lastCommandOnCasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
}
else if (command == Command::RDA)
@@ -236,6 +239,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
if (lastCommandOnCasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
}
else if (command == Command::WRA)
@@ -272,6 +276,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
if (lastCommandOnCasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
}
else if (command == Command::ACT)
@@ -349,6 +354,8 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (last4Activates[rank].size() >= 4)
earliestTimeToStart =
std::max(earliestTimeToStart, last4Activates[rank].front() + memSpec->tFAW);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::REFAB)
@@ -397,6 +404,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PREAB)
@@ -437,6 +445,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK / 2);
}
else if (command == Command::REFPB)
@@ -517,6 +526,8 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (last4Activates[rank].size() >= 4)
earliestTimeToStart =
std::max(earliestTimeToStart, last4Activates[rank].front() + memSpec->tFAW);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::SREFEN)
@@ -558,6 +569,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::RFMAB)
@@ -582,6 +594,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::RFMAB)
@@ -622,6 +635,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRREFD);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDEA)
@@ -646,6 +660,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCKE);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDEP)
@@ -670,6 +685,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDXP)
@@ -678,6 +694,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDXA)
@@ -686,6 +703,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::SREFEX)
@@ -694,6 +712,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCKESR);
if (lastCommandOnRasBus != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else

View File

@@ -135,8 +135,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::PDXA];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
}
else if (command == Command::WR || command == Command::WRA)
{
@@ -175,8 +173,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::PDXA];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
}
else if (command == Command::ACT)
{
@@ -234,8 +230,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
if (last4Activates[rank].size() >= 4)
earliestTimeToStart = std::max(earliestTimeToStart, last4Activates[rank].front() + memSpec->tFAW - memSpec->tCK);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PREPB)
{
@@ -254,8 +248,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::PDXA];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PREAB)
{
@@ -286,8 +278,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommandAndRank[Command::REFPB][rank];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCSB);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::REFAB)
{
@@ -326,8 +316,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::REFPB)
{
@@ -390,8 +378,6 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
if (last4Activates[rank].size() >= 4)
earliestTimeToStart = std::max(earliestTimeToStart, last4Activates[rank].front() + memSpec->tFAW);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDEA)
{
@@ -414,16 +400,12 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::PDXA];
if (lastCommandStart != scMaxTime)
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 != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDEP)
{
@@ -446,16 +428,12 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::PDXP)
{
lastCommandStart = lastScheduledByCommand[Command::PDEP];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tPD);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::SREFEN)
{
@@ -494,16 +472,12 @@ sc_time CheckerHBM2::timeToSatisfyConstraints(Command command, const tlm_generic
lastCommandStart = lastScheduledByCommand[Command::SREFEX];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXS);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else if (command == Command::SREFEX)
{
lastCommandStart = lastScheduledByCommand[Command::SREFEN];
if (lastCommandStart != scMaxTime)
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCKESR);
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
}
else
SC_REPORT_FATAL("CheckerHBM2", "Unknown command!");