Included remaining commands.
This commit is contained in:
@@ -4,12 +4,10 @@
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "CheckerDDR3.h"
|
||||
#include "../../timingCalculations.h"
|
||||
#include "../../../../common/DebugManager.h"
|
||||
#include "../../../Command.h"
|
||||
#include "../../../../common/utils.h"
|
||||
//#include "../../configuration/MemSpec.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "../../../../common/DebugManager.h"
|
||||
#include "../../../Command.h"
|
||||
#include "../../../../common/utils.h"
|
||||
//#include "../../configuration/MemSpec.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -24,7 +23,6 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
// TODO: WRA_bank0 -> PREA -> ACT_bank0: WRA_bank0 and ACT_bank0 have TD,
|
||||
// but we only consider PREA -> ACT_bank0 TD
|
||||
// REFA -> PDEP -> PDXP -> ACT
|
||||
|
||||
lastCommand = state.getLastCommand(Command::RDA, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRTP + memSpec->tRP);
|
||||
@@ -65,7 +63,7 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
else if (nextCmd == Command::RD || nextCmd == Command::RDA)
|
||||
{
|
||||
lastCommand = state.getLastCommand(Command::ACT, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
//if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRCD);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::RD, command.getBank());
|
||||
@@ -90,7 +88,7 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
else if (nextCmd == Command::WR || nextCmd == Command::WRA)
|
||||
{
|
||||
lastCommand = state.getLastCommand(Command::ACT, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
//if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRCD);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::RD, command.getBank());
|
||||
@@ -115,7 +113,7 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
else if (nextCmd == Command::PRE)
|
||||
{
|
||||
lastCommand = state.getLastCommand(Command::ACT, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
//if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRAS);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::RD, command.getBank());
|
||||
@@ -154,11 +152,11 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tWL + memSpec->tCCD + memSpec->tWR);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PDXA);
|
||||
lastCommand = state.getLastCommand(Command::PDXA, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tXP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::REFA);
|
||||
lastCommand = state.getLastCommand(Command::REFA, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRFC);
|
||||
|
||||
@@ -168,7 +166,7 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
{
|
||||
// TODO: Remove?
|
||||
lastCommand = state.getLastCommand(Command::ACT);
|
||||
if (lastCommand.isValidCommand())
|
||||
//if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->clk);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::RD);
|
||||
@@ -231,84 +229,72 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->clk);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::SREFEX);
|
||||
lastCommand = state.getLastCommand(Command::SREFEX, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tXS);
|
||||
|
||||
state.bus.moveCommandToNextFreeSlot(command);
|
||||
}
|
||||
// TODO: current position in code
|
||||
else if (nextCmd == Command::SREFEN)
|
||||
{
|
||||
if (lastCommandOnBank.isValidCommand())
|
||||
{
|
||||
switch (LastCmd)
|
||||
{
|
||||
case Command::PRE:
|
||||
case Command::PREA:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tRP_old);
|
||||
break;
|
||||
case Command::RD:
|
||||
case Command::RDA:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tRL + memSpec->getReadAccessTime()
|
||||
+ memSpec->clk);
|
||||
break;
|
||||
case Command::WR:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tWL + memSpec->getWriteAccessTime()
|
||||
+ memSpec->tWR);
|
||||
break;
|
||||
case Command::WRA:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tWL + memSpec->getWriteAccessTime()
|
||||
+ memSpec->tWR + memSpec->clk);
|
||||
break;
|
||||
case Command::REFA:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tRFC_old);
|
||||
break;
|
||||
case Command::PDXA:
|
||||
case Command::PDXP:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tXP);
|
||||
break;
|
||||
case Command::SREFEX:
|
||||
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
|
||||
memSpec->tXS);
|
||||
break;
|
||||
default:
|
||||
reportFatal("CheckerDDR3New", commandToString(nextCmd) + " can not follow "
|
||||
+ commandToString(LastCmd) + ".First: Precharge!");
|
||||
}
|
||||
}
|
||||
lastCommand = state.getLastCommand(Command::RDA);
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRL + 5 * memSpec->clk);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::WRA);
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tWL + 5 * memSpec->clk + memSpec->tWR);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PRE);
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PREA, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PDXP, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tXP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::SREFEX, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tXS);
|
||||
|
||||
state.bus.moveCommandToNextFreeSlot(command);
|
||||
}
|
||||
else if (nextCmd == Command::PDXA)
|
||||
{
|
||||
// Leaving Precharge Power Down
|
||||
command.establishMinDistanceFromStart(state.getLastCommand(Command::PDEA,
|
||||
command.getBank()).getStart(), memSpec->tCKE);
|
||||
lastCommand = state.getLastScheduledCommand(command.getBank());
|
||||
if (lastCommand.getCommand() != Command::PDEA)
|
||||
reportFatal("CheckerDDR3New", "PDXA can not follow " + commandToString(lastCommand.getCommand()));
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tCKE);
|
||||
|
||||
state.bus.moveCommandToNextFreeSlot(command);
|
||||
}
|
||||
else if (nextCmd == Command::PDXP)
|
||||
{
|
||||
// Leaving Precharge Power Down
|
||||
command.establishMinDistanceFromStart(state.getLastCommand(Command::PDEP,
|
||||
command.getBank()).getStart(), memSpec->tCKE);
|
||||
lastCommand = state.getLastScheduledCommand(command.getBank());
|
||||
if (lastCommand.getCommand() != Command::PDEP)
|
||||
reportFatal("CheckerDDR3New", "PDXP can not follow " + commandToString(lastCommand.getCommand()));
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tCKE);
|
||||
|
||||
state.bus.moveCommandToNextFreeSlot(command);
|
||||
}
|
||||
else if (nextCmd == Command::SREFEX)
|
||||
{
|
||||
// Leaving Self Refresh
|
||||
command.establishMinDistanceFromStart(state.getLastCommand(Command::SREFEN,
|
||||
command.getBank()).getStart(), memSpec->tCKESR);
|
||||
lastCommand = state.getLastScheduledCommand(command.getBank());
|
||||
if (lastCommand.getCommand() != Command::SREFEN)
|
||||
reportFatal("CheckerDDR3New", "SREFEX can not follow " + commandToString(lastCommand.getCommand()));
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tCKESR);
|
||||
|
||||
state.bus.moveCommandToNextFreeSlot(command);
|
||||
}
|
||||
else if (nextCmd == Command::REFA)
|
||||
{
|
||||
if (config.BankwiseLogic) {
|
||||
// TODO: Bankwise logic
|
||||
if (config.BankwiseLogic)
|
||||
{
|
||||
if (lastCommandOnBank.isValidCommand())
|
||||
{
|
||||
switch (LastCmd)
|
||||
@@ -348,54 +334,40 @@ void CheckerDDR3New::delayToSatisfyConstraints(ScheduledCommand &command) const
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int bank = 0; bank < memSpec->NumberOfBanks; bank++)
|
||||
{
|
||||
ScheduledCommand lastCommand = state.getLastScheduledCommand(Bank(bank));
|
||||
lastCommand = state.getLastCommand(Command::RDA);
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRTP + memSpec->tRP);
|
||||
|
||||
if (lastCommand.isValidCommand())
|
||||
{
|
||||
switch (lastCommand.getCommand())
|
||||
{
|
||||
case Command::PRE:
|
||||
case Command::PREA:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tRP_old);
|
||||
break;
|
||||
case Command::ACT:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tRCD);
|
||||
break;
|
||||
case Command::RDA:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tRTP + memSpec->tRP_old);
|
||||
break;
|
||||
case Command::WRA:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tWL + memSpec->getWriteAccessTime()
|
||||
+ memSpec->tWR + memSpec->tRP_old);
|
||||
break;
|
||||
case Command::REFA:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tRFC_old);
|
||||
break;
|
||||
case Command::PDXP:
|
||||
case Command::PDXA:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tXP);
|
||||
break;
|
||||
case Command::SREFEX:
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(),
|
||||
memSpec->tXS);
|
||||
break;
|
||||
default:
|
||||
reportFatal("CheckerDDR3New",
|
||||
"Refresh can not follow " + commandToString(LastCmd));
|
||||
}
|
||||
}
|
||||
}
|
||||
lastCommand = state.getLastCommand(Command::WRA);
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tWL + memSpec->tCCD + memSpec->tWR + memSpec->tRP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PRE);
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PREA, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::PDXP, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tXP);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::REFA, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tRFC);
|
||||
|
||||
lastCommand = state.getLastCommand(Command::SREFEX, command.getBank());
|
||||
if (lastCommand.isValidCommand())
|
||||
command.establishMinDistanceFromStart(lastCommand.getStart(), memSpec->tXS);
|
||||
}
|
||||
state.bus.moveCommandToNextFreeSlot(command);
|
||||
}
|
||||
else
|
||||
{
|
||||
reportFatal("CheckerDDR3New", "Unknown command!");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -488,15 +460,6 @@ bool CheckerDDR3New::collidesWithStrobeCommand_RD(ScheduledCommand &read,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CheckerDDR3New::delayToSatisfyDLL(ScheduledCommand &read) const
|
||||
{
|
||||
ScheduledCommand lastSREFX = state.getLastCommand(Command::SREFEX, read.getBank());
|
||||
if (lastSREFX.isValidCommand())
|
||||
read.establishMinDistanceFromStart(lastSREFX.getStart(), memSpec->tXSDLL_old);
|
||||
}
|
||||
|
||||
|
||||
sc_time CheckerDDR3New::writeToRead(ScheduledCommand &write, ScheduledCommand &read) const
|
||||
{
|
||||
sc_assert(read.getCommand() == Command::RD || read.getCommand() == Command::RDA);
|
||||
|
||||
@@ -32,7 +32,6 @@ private:
|
||||
sc_time getTimeConstraintToEnterPowerDown(Command lastCmd, Command pdnCmd) const;
|
||||
|
||||
//used for Read
|
||||
void delayToSatisfyDLL(ScheduledCommand &read) const;
|
||||
bool collidesOnDataStrobe_RD(ScheduledCommand &read) const;
|
||||
bool collidesWithStrobeCommand_RD(ScheduledCommand &read,
|
||||
ScheduledCommand &strobeCommand) const;
|
||||
|
||||
Reference in New Issue
Block a user