Add support for falling edge commands for HBM3
This commit is contained in:
@@ -237,11 +237,14 @@ Controller::Controller(const sc_module_name& name, const Configuration& config)
|
|||||||
|
|
||||||
void Controller::controllerMethod()
|
void Controller::controllerMethod()
|
||||||
{
|
{
|
||||||
// (1) Finish last response (END_RESP) and start new response (BEGIN_RESP)
|
if (isFullCycle(sc_time_stamp()))
|
||||||
manageResponses();
|
{
|
||||||
|
// (1) Finish last response (END_RESP) and start new response (BEGIN_RESP)
|
||||||
|
manageResponses();
|
||||||
|
|
||||||
// (2) Insert new request into scheduler and send END_REQ or use backpressure
|
// (2) Insert new request into scheduler and send END_REQ or use backpressure
|
||||||
manageRequests(SC_ZERO_TIME);
|
manageRequests(SC_ZERO_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
// (3) Start refresh and power-down managers to issue requests for the current time
|
// (3) Start refresh and power-down managers to issue requests for the current time
|
||||||
for (auto& it : refreshManagers)
|
for (auto& it : refreshManagers)
|
||||||
@@ -331,6 +334,7 @@ void Controller::controllerMethod()
|
|||||||
powerDownManagers[rank.ID()]->triggerEntry();
|
powerDownManagers[rank.ID()]->triggerEntry();
|
||||||
|
|
||||||
sc_time fwDelay = thinkDelayFw + phyDelayFw;
|
sc_time fwDelay = thinkDelayFw + phyDelayFw;
|
||||||
|
|
||||||
sendToDram(command, *payload, fwDelay);
|
sendToDram(command, *payload, fwDelay);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -511,3 +515,9 @@ void Controller::sendToDram(Command command, tlm_generic_payload& payload, sc_ti
|
|||||||
tlm_phase phase = command.toPhase();
|
tlm_phase phase = command.toPhase();
|
||||||
iSocket->nb_transport_fw(payload, phase, delay);
|
iSocket->nb_transport_fw(payload, phase, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Controller::isFullCycle(const sc_core::sc_time& time) const
|
||||||
|
{
|
||||||
|
sc_time aligedAtHalfCycle = std::floor((time * 2 / memSpec.tCK + 0.5)) / 2 * memSpec.tCK;
|
||||||
|
return aligedAtHalfCycle % memSpec.tCK == SC_ZERO_TIME;
|
||||||
|
}
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ private:
|
|||||||
void manageResponses();
|
void manageResponses();
|
||||||
void manageRequests(const sc_core::sc_time &delay);
|
void manageRequests(const sc_core::sc_time &delay);
|
||||||
|
|
||||||
|
bool isFullCycle(const sc_core::sc_time& time) const;
|
||||||
|
|
||||||
sc_core::sc_event beginReqEvent, endRespEvent, controllerEvent, dataResponseEvent;
|
sc_core::sc_event beginReqEvent, endRespEvent, controllerEvent, dataResponseEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|||||||
if (lastCommandStart != sc_max_time())
|
if (lastCommandStart != sc_max_time())
|
||||||
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tXP);
|
||||||
|
|
||||||
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK / 2);
|
||||||
}
|
}
|
||||||
else if (command == Command::RD)
|
else if (command == Command::RD)
|
||||||
{
|
{
|
||||||
@@ -480,7 +480,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|||||||
if (lastCommandStart != sc_max_time())
|
if (lastCommandStart != sc_max_time())
|
||||||
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandStart + memSpec->tRFCPB);
|
||||||
|
|
||||||
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK / 2);
|
||||||
}
|
}
|
||||||
else if (command == Command::REFAB)
|
else if (command == Command::REFAB)
|
||||||
{
|
{
|
||||||
@@ -760,17 +760,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
|||||||
SC_REPORT_FATAL("CheckerHBM3", "Unknown command!");
|
SC_REPORT_FATAL("CheckerHBM3", "Unknown command!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.isRasCommand())
|
|
||||||
{
|
|
||||||
if (lastCommandOnRasBus != sc_max_time())
|
|
||||||
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnRasBus + memSpec->tCK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (lastCommandOnCasBus != sc_max_time())
|
|
||||||
earliestTimeToStart = std::max(earliestTimeToStart, lastCommandOnCasBus + memSpec->tCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
return earliestTimeToStart;
|
return earliestTimeToStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user