systemc: Send response to TLM side if a packet does not need response
A completed TLM transaction includes request and response parts. Currently, if a gem5 packet does not need a reponse, the bridge would not send BEGIN_RESP to its upstream. It causes stuck on TLM side. To fix this problem, the bridge should send BEGIN_RESP by itself in this case. Change-Id: I318dec21bc3f291693715c0d70bc624addf05076 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32735 Reviewed-by: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
@@ -162,8 +162,15 @@ TlmToGem5Bridge<BITWIDTH>::handleBeginReq(tlm::tlm_generic_payload &trans)
|
||||
auto tlmSenderState = new TlmSenderState(trans);
|
||||
pkt->pushSenderState(tlmSenderState);
|
||||
|
||||
// If the packet doesn't need a response, we should send BEGIN_RESP by
|
||||
// ourselves.
|
||||
bool needsResponse = pkt->needsResponse();
|
||||
if (bmp.sendTimingReq(pkt)) { // port is free -> send END_REQ immediately
|
||||
sendEndReq(trans);
|
||||
if (!needsResponse) {
|
||||
auto delay = sc_core::SC_ZERO_TIME;
|
||||
sendBeginResp(trans, delay);
|
||||
}
|
||||
trans.release();
|
||||
} else { // port is blocked -> wait for retry before sending END_REQ
|
||||
waitForRetry = true;
|
||||
@@ -429,12 +436,19 @@ TlmToGem5Bridge<BITWIDTH>::recvReqRetry()
|
||||
sc_assert(pendingRequest != nullptr);
|
||||
sc_assert(pendingPacket != nullptr);
|
||||
|
||||
// If the packet doesn't need a response, we should send BEGIN_RESP by
|
||||
// ourselves.
|
||||
bool needsResponse = pendingPacket->needsResponse();
|
||||
if (bmp.sendTimingReq(pendingPacket)) {
|
||||
waitForRetry = false;
|
||||
pendingPacket = nullptr;
|
||||
|
||||
auto &trans = *pendingRequest;
|
||||
sendEndReq(trans);
|
||||
if (!needsResponse) {
|
||||
auto delay = sc_core::SC_ZERO_TIME;
|
||||
sendBeginResp(trans, delay);
|
||||
}
|
||||
trans.release();
|
||||
|
||||
pendingRequest = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user