Fix clock sync in STL player.
This commit is contained in:
@@ -101,18 +101,18 @@ void StlPlayer::nextPayload()
|
||||
payload->set_command(lineIterator->cmd);
|
||||
std::copy(lineIterator->data.begin(), lineIterator->data.end(), payload->get_data_ptr());
|
||||
|
||||
sc_time sendingOffset;
|
||||
sc_time sendingTime;
|
||||
sc_time sendingOffset;
|
||||
|
||||
if (lastEndReq == sc_time_stamp())
|
||||
sendingOffset = playerClk;
|
||||
else
|
||||
if (numberOfTransactions == 1)
|
||||
sendingOffset = SC_ZERO_TIME;
|
||||
else
|
||||
sendingOffset = playerClk - (sc_time_stamp() % playerClk);
|
||||
|
||||
if (!relative)
|
||||
sendingTime = std::max(sc_time_stamp() + sendingOffset, lineIterator->sendingTime);
|
||||
else
|
||||
sendingTime = sc_time_stamp() + std::max(sendingOffset, lineIterator->sendingTime);
|
||||
sendingTime = sc_time_stamp() + sendingOffset + lineIterator->sendingTime;
|
||||
|
||||
sendToTarget(*payload, BEGIN_REQ, sendingTime - sc_time_stamp());
|
||||
|
||||
|
||||
@@ -72,10 +72,7 @@ void TracePlayer::peqCallback(tlm_generic_payload &payload,
|
||||
const tlm_phase &phase)
|
||||
{
|
||||
if (phase == END_REQ)
|
||||
{
|
||||
lastEndReq = sc_time_stamp();
|
||||
nextPayload();
|
||||
}
|
||||
else if (phase == BEGIN_RESP)
|
||||
{
|
||||
payload.release();
|
||||
|
||||
@@ -69,7 +69,6 @@ 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