|
|
|
|
@@ -76,41 +76,39 @@ CheckerDDR5::CheckerDDR5()
|
|
|
|
|
lastBurstLengthByCommandAndBankInGroup = std::vector<std::vector<uint8_t>>
|
|
|
|
|
(4, std::vector<uint8_t>(memSpec->numberOfRanks * memSpec->banksPerGroup));
|
|
|
|
|
|
|
|
|
|
cmdOffset = memSpec->cmdMode * memSpec->tCK;
|
|
|
|
|
cmdLengthDiff = memSpec->cmdMode * memSpec->tCK;
|
|
|
|
|
|
|
|
|
|
tRD_BURST = 8 * memSpec->tCK;
|
|
|
|
|
tWR_BURST = 8 * memSpec->tCK;
|
|
|
|
|
tBURST16 = 8 * memSpec->tCK;
|
|
|
|
|
tBURST32 = 16 * memSpec->tCK;
|
|
|
|
|
tWTRA = memSpec->tWR - memSpec->tRTP;
|
|
|
|
|
tWRRDA = memSpec->tWL + tWR_BURST + tWTRA; // tWTRA = tWR - tRTP
|
|
|
|
|
tWRPRE = memSpec->tWL + tWR_BURST + memSpec->tWR;
|
|
|
|
|
tWRRDA = memSpec->tWL + tBURST16 + tWTRA; // tWTRA = tWR - tRTP
|
|
|
|
|
tWRPRE = memSpec->tWL + tBURST16 + memSpec->tWR;
|
|
|
|
|
tRDAACT = memSpec->tRTP + memSpec->tRP;
|
|
|
|
|
tWRAACT = tWRPRE + memSpec->tRP;
|
|
|
|
|
tCCD_L_RTW_slr = memSpec->tRL - memSpec->tWL + tRD_BURST + 2 * memSpec->tCK
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tCCD_S_RTW_slr = memSpec->tRL - memSpec->tWL + tRD_BURST + 2 * memSpec->tCK
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tCCD_RTW_dlr = memSpec->tRL - memSpec->tWL + tRD_BURST + 2 * memSpec->tCK
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tRDRD_dpr = tRD_BURST + memSpec->tRTRS;
|
|
|
|
|
tRDRD_ddr = tRD_BURST + memSpec->tRTRS;
|
|
|
|
|
tRDWR_dpr = memSpec->tRL - memSpec->tWL + tRD_BURST + memSpec->tRTRS
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tRDWR_ddr = memSpec->tRL - memSpec->tWL + tRD_BURST + memSpec->tRTRS
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tCCD_L_WTR_slr = memSpec->tWL + tWR_BURST + memSpec->tWTR_L;
|
|
|
|
|
tCCD_S_WTR_slr = memSpec->tWL + tWR_BURST + memSpec->tWTR_S;
|
|
|
|
|
tCCD_WTR_dlr = memSpec->tWL + tWR_BURST + memSpec->tWTR_S;
|
|
|
|
|
tWRWR_dpr = std::max(memSpec->tCCD_WR_dpr, tWR_BURST + memSpec->tRTRS);
|
|
|
|
|
tWRWR_ddr = tWR_BURST + memSpec->tRTRS;
|
|
|
|
|
tWRRD_dpr = memSpec->tWL - memSpec->tRL + tWR_BURST + memSpec->tRTRS
|
|
|
|
|
+ memSpec->tRDDQS + memSpec->tWPST + memSpec->tRPRE;
|
|
|
|
|
tWRRD_ddr = memSpec->tWL - memSpec->tRL + tWR_BURST + memSpec->tRTRS
|
|
|
|
|
+ memSpec->tRDDQS + memSpec->tWPST + memSpec->tRPRE;
|
|
|
|
|
tRDPDEN = memSpec->tRL + tRD_BURST + cmdOffset;
|
|
|
|
|
tWRPDEN = memSpec->tWL + tWR_BURST + memSpec->tWR + cmdOffset;
|
|
|
|
|
tWRAPDEN = memSpec->tWL + tWR_BURST + memSpec->tWR + cmdOffset;
|
|
|
|
|
|
|
|
|
|
// TODO: tRTP BL 32 (similar to LPDDR4)
|
|
|
|
|
tCCD_L_RTW_slr = memSpec->tRL - memSpec->tWL + tBURST16 + 2 * memSpec->tCK
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tCCD_S_RTW_slr = memSpec->tRL - memSpec->tWL + tBURST16 + 2 * memSpec->tCK
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tCCD_RTW_dlr = memSpec->tRL - memSpec->tWL + tBURST16 + 2 * memSpec->tCK
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tRDRD_dpr = tBURST16 + memSpec->tRTRS;
|
|
|
|
|
tRDRD_ddr = tBURST16 + memSpec->tRTRS;
|
|
|
|
|
tRDWR_dpr = memSpec->tRL - memSpec->tWL + tBURST16 + memSpec->tRTRS
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tRDWR_ddr = memSpec->tRL - memSpec->tWL + tBURST16 + memSpec->tRTRS
|
|
|
|
|
- memSpec->tRDDQS + memSpec->tRPST + memSpec->tWPRE;
|
|
|
|
|
tCCD_L_WTR_slr = memSpec->tWL + tBURST16 + memSpec->tWTR_L;
|
|
|
|
|
tCCD_S_WTR_slr = memSpec->tWL + tBURST16 + memSpec->tWTR_S;
|
|
|
|
|
tCCD_WTR_dlr = memSpec->tWL + tBURST16 + memSpec->tWTR_S;
|
|
|
|
|
tWRWR_dpr = std::max(memSpec->tCCD_WR_dpr, tBURST16 + memSpec->tRTRS);
|
|
|
|
|
tWRWR_ddr = tBURST16 + memSpec->tRTRS;
|
|
|
|
|
tWRRD_dpr = memSpec->tWL - memSpec->tRL + tBURST16 + memSpec->tRTRS
|
|
|
|
|
+ memSpec->tRDDQS + memSpec->tWPST + memSpec->tRPRE;
|
|
|
|
|
tWRRD_ddr = memSpec->tWL - memSpec->tRL + tBURST16 + memSpec->tRTRS
|
|
|
|
|
+ memSpec->tRDDQS + memSpec->tWPST + memSpec->tRPRE;
|
|
|
|
|
tRDPDEN = memSpec->tRL + tBURST16 + cmdLengthDiff;
|
|
|
|
|
tWRPDEN = memSpec->tWL + tBURST16 + memSpec->tWR + cmdLengthDiff;
|
|
|
|
|
tWRAPDEN = memSpec->tWL + tBURST16 + memSpec->tWR + cmdLengthDiff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGroup bankgroup, Bank bank,
|
|
|
|
|
@@ -133,93 +131,73 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RD][bankgroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::RD][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 tCK
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_slr); // 16 tCK
|
|
|
|
|
}
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_slr);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::RD][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::RD][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 tCK
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_slr); // 16 tCK
|
|
|
|
|
}
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_slr);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::RD][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::RD][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 tCK
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_dlr); // 16 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST32);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RD];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RD][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RD][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RD][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RD][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::RD][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr + tRD_BURST); // 16 tCK + tRTRS
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr); // 16 tCK + tRTRS
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::RD][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr + tRD_BURST); // 16 tCK + tRTRS
|
|
|
|
|
if (lastBurstLengthByCommand[Command::RD] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr); // 16 tCK + tRTRS
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::RDA][bankgroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::RDA][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 tCK
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_slr); // 16 tCK
|
|
|
|
|
}
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_slr);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::RDA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::RDA][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 tCK
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_slr); // 16 tCK
|
|
|
|
|
}
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_slr);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 tCK
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_dlr); // 16 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST32);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RDA];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RDA][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RDA][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::RDA][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr + tRD_BURST); // 16 tCK + tRTRS
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr); // 16 tCK + tRTRS
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr + tRD_BURST); // 16 tCK + tRTRS
|
|
|
|
|
if (lastBurstLengthByCommand[Command::RDA] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr); // 16 tCK + tRTRS
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDRD_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -229,9 +207,9 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBank[Command::WR][bank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDA + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDA + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDA); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRDA);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -239,45 +217,45 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::WR][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WR][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WR][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::WR][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::WR][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WR];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WR][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WR][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WR][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WR][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::WR][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommand[Command::WR] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -285,45 +263,45 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::WRA][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_WTR_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WRA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WRA][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_WTR_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_WTR_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WRA];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WRA][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WRA][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::WRA][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommand[Command::WRA] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRRD_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -337,45 +315,45 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::RD][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::RD][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::RD][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::RD][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::RD][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RD];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RD][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RD][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RD][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RD][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::RD][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommand[Command::RD] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -383,45 +361,45 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::RDA][bankgroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_L_RTW_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::RDA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::RDA][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_S_RTW_slr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tCCD_RTW_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::RDA];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RDA][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::RDA][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::RDA][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommand[Command::RDA] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr + tRD_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDWR_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -430,14 +408,14 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::WR][bankgroup.ID()] == 32)
|
|
|
|
|
{
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWR_BURST + memSpec->tCCD_L_WR_slr);
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4) // second WR requires RMW
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST16 + memSpec->tCCD_L_WR_slr);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWR_BURST + memSpec->tCCD_L_WR2_slr);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST16 + memSpec->tCCD_L_WR2_slr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4)
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4) // second WR requires RMW
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_WR_slr);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_WR2_slr);
|
|
|
|
|
@@ -446,38 +424,33 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WR][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WR][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 clocks
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_WR_slr); // 16 clocks
|
|
|
|
|
}
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_WR_slr);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::WR][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::WR][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 clocks
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_WR_dlr); // 16 clocks
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST32);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_WR_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WR];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WR][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WR][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WR][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WR][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::WR][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommand[Command::WR] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -486,14 +459,14 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankGroup[Command::WRA][bankgroup.ID()] == 32)
|
|
|
|
|
{
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWR_BURST + memSpec->tCCD_L_WR_slr);
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4) // second WR requires RMW
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST16 + memSpec->tCCD_L_WR_slr);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWR_BURST + memSpec->tCCD_L_WR2_slr);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST16 + memSpec->tCCD_L_WR2_slr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4)
|
|
|
|
|
if (burstLength == 16 && memSpec->bitWidth == 4) // second WR requires RMW
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_WR_slr);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_L_WR2_slr);
|
|
|
|
|
@@ -502,38 +475,33 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WRA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WRA][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 clocks
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_WR_slr); // 16 clocks
|
|
|
|
|
}
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_S_WR_slr);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + 16 * memSpec->tCK); // 16 clocks
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_WR_dlr); // 16 clocks
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tBURST32);
|
|
|
|
|
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tCCD_WR_dlr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommand[Command::WRA];
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()])
|
|
|
|
|
if (lastCommandStart != lastScheduledByCommandAndPhysicalRank[Command::WRA][physicalrank.ID()]) // different physical rank
|
|
|
|
|
{
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WRA][dimmrank.ID()])
|
|
|
|
|
if (lastCommandStart == lastScheduledByCommandAndDimmRank[Command::WRA][dimmrank.ID()]) // same DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndDimmRank[Command::WRA][dimmrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_dpr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // different DIMM
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommand[Command::WRA] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRWR_ddr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -563,42 +531,42 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBank[Command::WRA][bank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT + tWR_BURST); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT + tBURST16);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::PRE][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::PREA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::PRESB][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRP - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::REFA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC_slr - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFC_slr - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
// TODO: No tRFC_dlr and tRFC_dpr between REFA and ACT?
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::REFSB][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCsb_slr - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCsb_slr - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
// TODO: No tRFCsb_dlr between REFSB and ACT?
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::REFSB][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tREFSBRD_slr - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tREFSBRD_slr - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::REFSB][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tREFSBRD_dlr - cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tREFSBRD_dlr - cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
if (last4ActivatesLogical[logicalrank.ID()].size() >= 4)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, last4ActivatesLogical[logicalrank.ID()].front()
|
|
|
|
|
@@ -612,19 +580,19 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::ACT][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::RD][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBank[Command::WR][bank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tWR_BURST + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tBURST16 + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::PRE][physicalrank.ID()];
|
|
|
|
|
@@ -643,32 +611,32 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::ACT][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::RD][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::RDA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WR][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WR][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tWR_BURST + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tBURST16 + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WRA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WRA][logicalrank.ID()])
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tWR_BURST + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tBURST16 + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::PRE][physicalrank.ID()];
|
|
|
|
|
@@ -685,32 +653,32 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::ACT][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRAS + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::RD][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::RDA][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRTP + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::WR][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankInGroup[Command::WR][bankInGroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tWR_BURST + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tBURST16 + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::WRA][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankInGroup[Command::WRA][bankInGroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tWR_BURST + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tBURST16 + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::PRE][physicalrank.ID()];
|
|
|
|
|
@@ -727,19 +695,19 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::ACT][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndPhysicalRank[Command::RDA][physicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDAACT + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDAACT + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::WRA][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndLogicalRank[Command::WRA][logicalrank.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tWR_BURST + memSpec->tRP + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + tBURST16 + memSpec->tRP + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRPRE + memSpec->tRP + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::PRE][logicalrank.ID()];
|
|
|
|
|
@@ -769,23 +737,23 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, Rank rank, BankGr
|
|
|
|
|
{
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::ACT][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRC + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndLogicalRank[Command::ACT][logicalrank.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRRD_L_slr + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRRD_L_slr + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::RDA][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDAACT + cmdOffset);
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tRDAACT + cmdLengthDiff);
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::WRA][bankInGroup.ID()];
|
|
|
|
|
if (lastCommandStart != sc_max_time())
|
|
|
|
|
{
|
|
|
|
|
if (lastBurstLengthByCommandAndBankInGroup[Command::WRA][bankInGroup.ID()] == 32)
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT + tWR_BURST + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT + tBURST16 + cmdLengthDiff);
|
|
|
|
|
else
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT + cmdOffset); // + 8 tCK
|
|
|
|
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + tWRAACT + cmdLengthDiff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandStart = lastScheduledByCommandAndBankInGroup[Command::PRE][bankInGroup.ID()];
|
|
|
|
|
@@ -861,9 +829,6 @@ void CheckerDDR5::insert(Command command, Rank rank, BankGroup bankgroup, Bank b
|
|
|
|
|
lastScheduledByCommandAndBankGroup[command][bankgroup.ID()] = sc_time_stamp();
|
|
|
|
|
lastScheduledByCommandAndBank[command][bank.ID()] = sc_time_stamp();
|
|
|
|
|
lastScheduledByCommand[command] = sc_time_stamp();
|
|
|
|
|
|
|
|
|
|
lastCommandOnBus = sc_time_stamp() + memSpec->getCommandLength(command) - memSpec->tCK;
|
|
|
|
|
|
|
|
|
|
lastScheduledByCommandAndBankInGroup[command][bankInGroup.ID()] = sc_time_stamp();
|
|
|
|
|
|
|
|
|
|
if (isCasCommand(command))
|
|
|
|
|
@@ -878,11 +843,13 @@ void CheckerDDR5::insert(Command command, Rank rank, BankGroup bankgroup, Bank b
|
|
|
|
|
|
|
|
|
|
if (burstLength == 32)
|
|
|
|
|
{
|
|
|
|
|
dummyCommandOnBus.start = sc_time_stamp() + tRD_BURST;
|
|
|
|
|
dummyCommandOnBus.end = sc_time_stamp() + tRD_BURST + memSpec->getCommandLength(command);
|
|
|
|
|
dummyCommandOnBus.start = sc_time_stamp() + tBURST16;
|
|
|
|
|
dummyCommandOnBus.end = sc_time_stamp() + tBURST16 + memSpec->getCommandLength(command);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lastCommandOnBus = sc_time_stamp() + memSpec->getCommandLength(command) - memSpec->tCK;
|
|
|
|
|
|
|
|
|
|
if (command == Command::ACT || command == Command::REFSB)
|
|
|
|
|
{
|
|
|
|
|
if (last4ActivatesLogical[logicalRank.ID()].size() == 4)
|
|
|
|
|
|