Fix arbitration delay in reorder arbiter.
This commit is contained in:
@@ -224,6 +224,7 @@ void ArbiterSimple::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase
|
||||
sc_time tDelay = arbitrationDelayBw;
|
||||
|
||||
tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(cbPayload, tPhase, tDelay);
|
||||
// Early completion from initiator
|
||||
if (returnValue == TLM_UPDATED)
|
||||
payloadEventQueue.notify(cbPayload, tPhase, tDelay);
|
||||
threadIsBusy[threadId] = true;
|
||||
@@ -250,6 +251,7 @@ void ArbiterSimple::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase
|
||||
sc_time tDelay = tCK + arbitrationDelayBw;
|
||||
|
||||
tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
// Early completion from initiator
|
||||
if (returnValue == TLM_UPDATED)
|
||||
payloadEventQueue.notify(tPayload, tPhase, tDelay);
|
||||
}
|
||||
@@ -280,25 +282,10 @@ void ArbiterFifo::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase &c
|
||||
|
||||
tSocket[static_cast<int>(threadId)]->nb_transport_bw(cbPayload, tPhase, tDelay);
|
||||
|
||||
// TODO: move to REQ_ARBITRATION PEQ
|
||||
payloadEventQueue.notify(cbPayload, REQ_ARBITRATION, arbitrationDelayFw);
|
||||
//pendingRequests[channelId].push(&cbPayload);
|
||||
}
|
||||
else
|
||||
outstandingEndReq[threadId] = &cbPayload;
|
||||
|
||||
// TODO: move to REQ_ARBITRATION
|
||||
// if (!channelIsBusy[channelId] && !pendingRequests[channelId].empty())
|
||||
// {
|
||||
// channelIsBusy[channelId] = true;
|
||||
//
|
||||
// tlm_generic_payload &tPayload = *pendingRequests[channelId].front();
|
||||
// pendingRequests[channelId].pop();
|
||||
// tlm_phase tPhase = BEGIN_REQ;
|
||||
// sc_time tDelay = lastEndReq[channelId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
//
|
||||
// iSocket[static_cast<int>(channelId)]->nb_transport_fw(tPayload, tPhase, tDelay);
|
||||
// }
|
||||
}
|
||||
else if (cbPhase == END_REQ) // from memory controller
|
||||
{
|
||||
@@ -326,23 +313,7 @@ void ArbiterFifo::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase &c
|
||||
iSocket[static_cast<int>(channelId)]->nb_transport_fw(cbPayload, tPhase, tDelay);
|
||||
}
|
||||
|
||||
// TODO: move to PEQ with RESP_ARBITRATION
|
||||
payloadEventQueue.notify(cbPayload, RESP_ARBITRATION, arbitrationDelayBw);
|
||||
//pendingResponses[threadId].push(&cbPayload);
|
||||
|
||||
// if (!threadIsBusy[threadId])
|
||||
// {
|
||||
// threadIsBusy[threadId] = true;
|
||||
//
|
||||
// tlm_generic_payload &tPayload = *pendingResponses[threadId].front();
|
||||
// pendingResponses[threadId].pop();
|
||||
// tlm_phase tPhase = BEGIN_RESP;
|
||||
// sc_time tDelay = lastEndResp[threadId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
//
|
||||
// tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
// if (returnValue == TLM_UPDATED)
|
||||
// payloadEventQueue.notify(tPayload, tPhase, tDelay);
|
||||
// }
|
||||
}
|
||||
else if (cbPhase == END_RESP) // from initiator
|
||||
{
|
||||
@@ -363,20 +334,7 @@ void ArbiterFifo::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase &c
|
||||
|
||||
tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
|
||||
// TODO: move into REQ_ARBITRATION PEQ
|
||||
payloadEventQueue.notify(tPayload, REQ_ARBITRATION, arbitrationDelayFw);
|
||||
|
||||
// if (!channelIsBusy[tChannelId])
|
||||
// {
|
||||
// channelIsBusy[tChannelId] = true;
|
||||
//
|
||||
// tPhase = BEGIN_REQ;
|
||||
// tDelay = lastEndReq[tChannelId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
//
|
||||
// iSocket[static_cast<int>(tChannelId)]->nb_transport_fw(tPayload, tPhase, tDelay);
|
||||
// }
|
||||
// else
|
||||
// pendingRequests[tChannelId].push(&tPayload);
|
||||
}
|
||||
else
|
||||
activeTransactions[threadId]--;
|
||||
@@ -389,6 +347,7 @@ void ArbiterFifo::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase &c
|
||||
sc_time tDelay = tCK;
|
||||
|
||||
tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
// Early completion from initiator
|
||||
if (returnValue == TLM_UPDATED)
|
||||
payloadEventQueue.notify(tPayload, tPhase, tDelay);
|
||||
}
|
||||
@@ -454,22 +413,10 @@ void ArbiterReorder::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase
|
||||
|
||||
tSocket[static_cast<int>(threadId)]->nb_transport_bw(cbPayload, tPhase, tDelay);
|
||||
|
||||
pendingRequests[channelId].push(&cbPayload);
|
||||
payloadEventQueue.notify(cbPayload, REQ_ARBITRATION, arbitrationDelayFw);
|
||||
}
|
||||
else
|
||||
outstandingEndReq[threadId] = &cbPayload;
|
||||
|
||||
if (!channelIsBusy[channelId] && !pendingRequests[channelId].empty())
|
||||
{
|
||||
channelIsBusy[channelId] = true;
|
||||
|
||||
tlm_generic_payload &tPayload = *pendingRequests[channelId].front();
|
||||
pendingRequests[channelId].pop();
|
||||
tlm_phase tPhase = BEGIN_REQ;
|
||||
sc_time tDelay = lastEndReq[channelId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
|
||||
iSocket[static_cast<int>(channelId)]->nb_transport_fw(tPayload, tPhase, tDelay);
|
||||
}
|
||||
}
|
||||
else if (cbPhase == END_REQ) // from memory controller
|
||||
{
|
||||
@@ -496,26 +443,7 @@ void ArbiterReorder::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase
|
||||
iSocket[static_cast<int>(channelId)]->nb_transport_fw(cbPayload, tPhase, tDelay);
|
||||
}
|
||||
|
||||
pendingResponses[threadId].insert(&cbPayload);
|
||||
|
||||
if (!threadIsBusy[threadId])
|
||||
{
|
||||
tlm_generic_payload &tPayload = **pendingResponses[threadId].begin();
|
||||
|
||||
if (DramExtension::getThreadPayloadID(tPayload) == nextThreadPayloadIDToReturn[threadId])
|
||||
{
|
||||
nextThreadPayloadIDToReturn[threadId]++;
|
||||
pendingResponses[threadId].erase(pendingResponses[threadId].begin());
|
||||
threadIsBusy[threadId] = true;
|
||||
|
||||
tlm_phase tPhase = BEGIN_RESP;
|
||||
sc_time tDelay = lastEndResp[threadId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
|
||||
tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
if (returnValue == TLM_UPDATED)
|
||||
payloadEventQueue.notify(tPayload, tPhase, tDelay);
|
||||
}
|
||||
}
|
||||
payloadEventQueue.notify(cbPayload, RESP_ARBITRATION, arbitrationDelayBw);
|
||||
}
|
||||
else if (cbPhase == END_RESP) // from initiator
|
||||
{
|
||||
@@ -536,17 +464,7 @@ void ArbiterReorder::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase
|
||||
|
||||
tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
|
||||
if (!channelIsBusy[tChannelId])
|
||||
{
|
||||
channelIsBusy[tChannelId] = true;
|
||||
|
||||
tPhase = BEGIN_REQ;
|
||||
tDelay = lastEndReq[tChannelId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
|
||||
iSocket[static_cast<int>(tChannelId)]->nb_transport_fw(tPayload, tPhase, tDelay);
|
||||
}
|
||||
else
|
||||
pendingRequests[tChannelId].push(&tPayload);
|
||||
payloadEventQueue.notify(tPayload, REQ_ARBITRATION, arbitrationDelayFw);
|
||||
}
|
||||
else
|
||||
activeTransactions[threadId]--;
|
||||
@@ -563,12 +481,51 @@ void ArbiterReorder::peqCallback(tlm_generic_payload &cbPayload, const tlm_phase
|
||||
sc_time tDelay = tCK;
|
||||
|
||||
tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
// Early completion from initiator
|
||||
if (returnValue == TLM_UPDATED)
|
||||
payloadEventQueue.notify(tPayload, tPhase, tDelay);
|
||||
}
|
||||
else
|
||||
{
|
||||
threadIsBusy[threadId] = false;
|
||||
}
|
||||
else if (cbPhase == REQ_ARBITRATION)
|
||||
{
|
||||
pendingRequests[channelId].push(&cbPayload);
|
||||
|
||||
if (!channelIsBusy[channelId])
|
||||
{
|
||||
channelIsBusy[channelId] = true;
|
||||
|
||||
tlm_generic_payload &tPayload = *pendingRequests[channelId].front();
|
||||
pendingRequests[channelId].pop();
|
||||
tlm_phase tPhase = BEGIN_REQ;
|
||||
sc_time tDelay = lastEndReq[channelId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
|
||||
iSocket[static_cast<int>(channelId)]->nb_transport_fw(tPayload, tPhase, tDelay);
|
||||
}
|
||||
}
|
||||
else if (cbPhase == RESP_ARBITRATION)
|
||||
{
|
||||
pendingResponses[threadId].insert(&cbPayload);
|
||||
|
||||
if (!threadIsBusy[threadId])
|
||||
{
|
||||
tlm_generic_payload &tPayload = **pendingResponses[threadId].begin();
|
||||
|
||||
if (DramExtension::getThreadPayloadID(tPayload) == nextThreadPayloadIDToReturn[threadId])
|
||||
{
|
||||
threadIsBusy[threadId] = true;
|
||||
|
||||
nextThreadPayloadIDToReturn[threadId]++;
|
||||
pendingResponses[threadId].erase(pendingResponses[threadId].begin());
|
||||
tlm_phase tPhase = BEGIN_RESP;
|
||||
sc_time tDelay = lastEndResp[threadId] == sc_time_stamp() ? tCK : SC_ZERO_TIME;
|
||||
|
||||
tlm_sync_enum returnValue = tSocket[static_cast<int>(threadId)]->nb_transport_bw(tPayload, tPhase, tDelay);
|
||||
// Early completion from initiator
|
||||
if (returnValue == TLM_UPDATED)
|
||||
payloadEventQueue.notify(tPayload, tPhase, tDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user