Add new protocol to trace player.
This commit is contained in:
@@ -229,7 +229,7 @@ void Controller::controllerMethod()
|
||||
manageResponses();
|
||||
|
||||
// (2) Insert new request into scheduler and send END_REQ or use backpressure
|
||||
manageRequests();
|
||||
manageRequests(SC_ZERO_TIME);
|
||||
|
||||
// (3) Start refresh and power-down managers to issue requests for the current time
|
||||
for (auto it : refreshManagers)
|
||||
@@ -299,6 +299,7 @@ void Controller::controllerMethod()
|
||||
if (isCasCommand(command))
|
||||
{
|
||||
scheduler->removeRequest(payload);
|
||||
manageRequests(thinkDelayFw);
|
||||
respQueue->insertPayload(payload, sc_time_stamp()
|
||||
+ thinkDelayFw + phyDelayFw
|
||||
+ memSpec->getIntervalOnDataStrobe(command).end
|
||||
@@ -371,7 +372,7 @@ unsigned int Controller::transport_dbg(tlm_generic_payload &trans)
|
||||
return iSocket->transport_dbg(trans);
|
||||
}
|
||||
|
||||
void Controller::manageRequests()
|
||||
void Controller::manageRequests(sc_time delay)
|
||||
{
|
||||
if (transToAcquire.payload != nullptr && transToAcquire.time <= sc_time_stamp())
|
||||
{
|
||||
@@ -397,7 +398,7 @@ void Controller::manageRequests()
|
||||
bankMachines[bank.ID()]->start();
|
||||
|
||||
transToAcquire.payload->set_response_status(TLM_OK_RESPONSE);
|
||||
sendToFrontend(transToAcquire.payload, END_REQ, SC_ZERO_TIME);
|
||||
sendToFrontend(transToAcquire.payload, END_REQ, delay);
|
||||
transToAcquire.payload = nullptr;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
} transToAcquire, transToRelease;
|
||||
|
||||
void manageResponses();
|
||||
void manageRequests();
|
||||
void manageRequests(sc_time);
|
||||
|
||||
sc_event beginReqEvent, endRespEvent, controllerEvent, dataResponseEvent;
|
||||
};
|
||||
|
||||
@@ -125,12 +125,10 @@ void ArbiterReorder::end_of_elaboration()
|
||||
tlm_sync_enum Arbiter::nb_transport_fw(int id, tlm_generic_payload &payload,
|
||||
tlm_phase &phase, sc_time &fwDelay)
|
||||
{
|
||||
sc_time notDelay = fwDelay;
|
||||
sc_time notDelay = std::ceil((sc_time_stamp() + fwDelay) / tCK) * tCK - sc_time_stamp();
|
||||
|
||||
if (phase == BEGIN_REQ)
|
||||
{
|
||||
notDelay = std::ceil((sc_time_stamp() + fwDelay) / tCK) * tCK - sc_time_stamp();
|
||||
|
||||
// TODO: do not adjust address permanently
|
||||
// adjust address offset:
|
||||
uint64_t adjustedAddress = payload.get_address() - Configuration::getInstance().addressOffset;
|
||||
|
||||
@@ -102,18 +102,19 @@ void StlPlayer::nextPayload()
|
||||
std::copy(lineIterator->data.begin(), lineIterator->data.end(), payload->get_data_ptr());
|
||||
|
||||
sc_time sendingOffset;
|
||||
sc_time sendingTime;
|
||||
|
||||
if (lastSendingTime == sc_time_stamp())
|
||||
if (lastEndReq == sc_time_stamp())
|
||||
sendingOffset = playerClk;
|
||||
else
|
||||
sendingOffset = SC_ZERO_TIME;
|
||||
|
||||
if (!relative)
|
||||
lastSendingTime = std::max(sc_time_stamp() + sendingOffset, lineIterator->sendingTime);
|
||||
sendingTime = std::max(sc_time_stamp() + sendingOffset, lineIterator->sendingTime);
|
||||
else
|
||||
lastSendingTime = sc_time_stamp() + std::max(sendingOffset, lineIterator->sendingTime);
|
||||
sendingTime = sc_time_stamp() + std::max(sendingOffset, lineIterator->sendingTime);
|
||||
|
||||
sendToTarget(*payload, BEGIN_REQ, lastSendingTime - sc_time_stamp());
|
||||
sendToTarget(*payload, BEGIN_REQ, sendingTime - sc_time_stamp());
|
||||
|
||||
transactionsSent++;
|
||||
PRINTDEBUGMESSAGE(name(), "Performing request #" + std::to_string(transactionsSent));
|
||||
|
||||
@@ -78,7 +78,6 @@ private:
|
||||
unsigned int burstlength;
|
||||
unsigned int dataLength;
|
||||
sc_time playerClk; // May be different from the memory clock!
|
||||
sc_time lastSendingTime = sc_max_time();
|
||||
|
||||
static constexpr unsigned lineBufferSize = 10000;
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ void TracePlayer::peqCallback(tlm_generic_payload &payload,
|
||||
{
|
||||
if (phase == END_REQ)
|
||||
{
|
||||
lastEndReq = sc_time_stamp();
|
||||
nextPayload();
|
||||
}
|
||||
else if (phase == BEGIN_RESP)
|
||||
|
||||
@@ -69,6 +69,7 @@ protected:
|
||||
uint64_t numberOfTransactions = 0;
|
||||
uint64_t transactionsSent = 0;
|
||||
bool finished = false;
|
||||
sc_time lastEndReq = sc_max_time();
|
||||
|
||||
private:
|
||||
tlm::tlm_sync_enum nb_transport_bw(tlm::tlm_generic_payload &payload, tlm::tlm_phase &phase,
|
||||
|
||||
Reference in New Issue
Block a user