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()
|
||||
{
|
||||
// (1) Finish last response (END_RESP) and start new response (BEGIN_RESP)
|
||||
manageResponses();
|
||||
if (isFullCycle(sc_time_stamp()))
|
||||
{
|
||||
// (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
|
||||
manageRequests(SC_ZERO_TIME);
|
||||
// (2) Insert new request into scheduler and send END_REQ or use backpressure
|
||||
manageRequests(SC_ZERO_TIME);
|
||||
}
|
||||
|
||||
// (3) Start refresh and power-down managers to issue requests for the current time
|
||||
for (auto& it : refreshManagers)
|
||||
@@ -331,6 +334,7 @@ void Controller::controllerMethod()
|
||||
powerDownManagers[rank.ID()]->triggerEntry();
|
||||
|
||||
sc_time fwDelay = thinkDelayFw + phyDelayFw;
|
||||
|
||||
sendToDram(command, *payload, fwDelay);
|
||||
}
|
||||
else
|
||||
@@ -511,3 +515,9 @@ void Controller::sendToDram(Command command, tlm_generic_payload& payload, sc_ti
|
||||
tlm_phase phase = command.toPhase();
|
||||
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 manageRequests(const sc_core::sc_time &delay);
|
||||
|
||||
bool isFullCycle(const sc_core::sc_time& time) const;
|
||||
|
||||
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())
|
||||
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)
|
||||
{
|
||||
@@ -480,7 +480,7 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
||||
if (lastCommandStart != sc_max_time())
|
||||
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)
|
||||
{
|
||||
@@ -760,17 +760,6 @@ sc_time CheckerHBM3::timeToSatisfyConstraints(Command command, const tlm_generic
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user