Use 1 as first payload ID.

This commit is contained in:
Lukas Steiner
2021-02-02 12:12:48 +01:00
parent 465bbdbe7e
commit fe144934b2
4 changed files with 8 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ public:
CommandTuple::Type selectCommand(ReadyCommands &);
private:
uint64_t nextPayloadID = 0;
uint64_t nextPayloadID = 1;
const MemSpec *memSpec;
};

View File

@@ -46,12 +46,12 @@ tlm_generic_payload *RespQueueReorder::nextPayload()
{
if (!buffer.empty())
{
if (buffer.begin()->first == currentPayloadID)
if (buffer.begin()->first == nextPayloadID)
{
std::pair<tlm_generic_payload *, sc_time> element = buffer.begin()->second;
if (element.second <= sc_time_stamp())
{
buffer.erase(currentPayloadID++);
buffer.erase(nextPayloadID++);
return element.first;
}
}
@@ -63,7 +63,7 @@ sc_time RespQueueReorder::getTriggerTime() const
{
if (!buffer.empty())
{
if (buffer.begin()->first == currentPayloadID)
if (buffer.begin()->first == nextPayloadID)
{
sc_time triggerTime = buffer.begin()->second.second;
if (triggerTime > sc_time_stamp())

View File

@@ -48,8 +48,7 @@ public:
virtual sc_time getTriggerTime() const override;
private:
uint64_t currentPayloadID = 0;
// Muss die Zeit aller Payloads gespeichert werden?
uint64_t nextPayloadID = 1;
std::map<uint64_t, std::pair<tlm::tlm_generic_payload *, sc_time>> buffer;
};

View File

@@ -76,13 +76,13 @@ void Arbiter::end_of_elaboration()
{
// initiator side
threadIsBusy = std::vector<bool>(tSocket.size(), false);
nextThreadPayloadIDToAppend = std::vector<uint64_t>(tSocket.size(), 0);
nextThreadPayloadIDToAppend = std::vector<uint64_t>(tSocket.size(), 1);
// channel side
channelIsBusy = std::vector<bool>(iSocket.size(), false);
pendingRequests = std::vector<std::queue<tlm_generic_payload *>>(iSocket.size(),
std::queue<tlm_generic_payload *>());
nextChannelPayloadIDToAppend = std::vector<uint64_t>(iSocket.size(), 0);
nextChannelPayloadIDToAppend = std::vector<uint64_t>(iSocket.size(), 1);
}
void ArbiterSimple::end_of_elaboration()
@@ -117,7 +117,7 @@ void ArbiterReorder::end_of_elaboration()
outstandingEndReq = std::vector<tlm_generic_payload *>(tSocket.size(), nullptr);
pendingResponses = std::vector<std::set<tlm_generic_payload *, ThreadPayloadIDCompare>>
(tSocket.size(), std::set<tlm_generic_payload *, ThreadPayloadIDCompare>());
nextThreadPayloadIDToReturn = std::vector<uint64_t>(tSocket.size(), 0);
nextThreadPayloadIDToReturn = std::vector<uint64_t>(tSocket.size(), 1);
lastEndReq = std::vector<sc_time>(iSocket.size(), sc_max_time());
lastEndResp = std::vector<sc_time>(tSocket.size(), sc_max_time());