bool need_retry = false;
- /*
- * If the packet was piped through and needs a response, we don't need
- * to touch the packet and can forward it directly as a response.
- * Otherwise, we need to make a response and send the transformed
- * packet.
- */
- if (extension.isPipeThrough()) {
- if (packet->isResponse()) {
- need_retry = !bridgeResponsePort.sendTimingResp(packet);
- }
- } else if (packet->needsResponse()) {
+ // If there is another gem5 model under the receiver side, and already
+ // make a response packet back, we can simply send it back. Otherwise,
+ // we make a response packet before sending it back to the initiator
+ // side gem5 module.
+ if (packet->needsResponse()) {
packet->makeResponse();
+ }
+ if (packet->isResponse()) {
need_retry = !bridgeResponsePort.sendTimingResp(packet);
}
Gem5Extension::Gem5Extension(PacketPtr _packet)
{
packet = _packet;
- pipeThrough = false;
}
Gem5Extension &
const tlm::tlm_generic_payload &payload);
PacketPtr getPacket();
- bool isPipeThrough() const { return pipeThrough; }
- void setPipeThrough() { pipeThrough = true; }
-
private:
PacketPtr packet;
- bool pipeThrough;
};
} // namespace Gem5SystemC
// world and we can pipe through the original packet. Otherwise, we
// generate a new packet based on the transaction.
if (extension != nullptr) {
- extension->setPipeThrough();
pkt = extension->getPacket();
} else {
pkt = payload2packet(_id, trans);
// If there is an extension, this transaction was initiated by the gem5
// world and we can pipe through the original packet.
if (extension != nullptr) {
- extension->setPipeThrough();
pkt = extension->getPacket();
} else {
pkt = payload2packet(_id, trans);
// If there is an extension, this transaction was initiated by the gem5
// world and we can pipe through the original packet.
if (extension != nullptr) {
- extension->setPipeThrough();
bmp.sendFunctional(extension->getPacket());
} else {
auto pkt = payload2packet(_id, trans);
// If there is an extension, this transaction was initiated by the gem5
// world and we can pipe through the original packet.
if (extension != nullptr) {
- extension->setPipeThrough();
pkt = extension->getPacket();
} else {
pkt = payload2packet(_id, trans);
// delete it. The packet travels back with the transaction.
if (extension == nullptr)
destroyPacket(pkt);
- else
- sc_assert(extension->isPipeThrough());
sendBeginResp(trans, delay);
trans.release();
Gem5Extension::Gem5Extension(PacketPtr packet)
{
Packet = packet;
- pipeThrough = false;
}
Gem5Extension& Gem5Extension::getExtension(const tlm_generic_payload *payload)
getExtension(const tlm::tlm_generic_payload &payload);
PacketPtr getPacket();
- bool isPipeThrough() const { return pipeThrough; }
- void setPipeThrough() { pipeThrough = true; }
-
private:
PacketPtr Packet;
- bool pipeThrough;
};
}
// world and we can pipe through the original packet. Otherwise, we
// generate a new packet based on the transaction.
if (extension != nullptr) {
- extension->setPipeThrough();
pkt = extension->getPacket();
} else {
pkt = generatePacket(trans);
// If there is an extension, this transaction was initiated by the gem5
// world and we can pipe through the original packet.
if (extension != nullptr) {
- extension->setPipeThrough();
pkt = extension->getPacket();
} else {
pkt = generatePacket(trans);
// If there is an extension, this transaction was initiated by the gem5
// world and we can pipe through the original packet.
if (extension != nullptr) {
- extension->setPipeThrough();
sendFunctional(extension->getPacket());
} else {
auto pkt = generatePacket(trans);
// delete it. The packet travels back with the transaction.
if (extension == nullptr)
destroyPacket(pkt);
- else
- sc_assert(extension->isPipeThrough());
sendBeginResp(trans, delay);
trans.release();
bool need_retry = false;
- /*
- * If the packet was piped through and needs a response, we don't need
- * to touch the packet and can forward it directly as a response.
- * Otherwise, we need to make a response and send the transformed
- * packet.
- */
- if (extension.isPipeThrough()) {
- if (packet->isResponse()) {
- need_retry = !sendTimingResp(packet);
- }
- } else if (packet->needsResponse()) {
+ // If there is another gem5 model under the receiver side, and already
+ // make a response packet back, we can simply send it back. Otherwise,
+ // we make a response packet before sending it back to the initiator
+ // side gem5 module.
+ if (packet->needsResponse()) {
packet->makeResponse();
- need_retry = !sendTimingResp(packet);
+ }
+ if (packet->isResponse()) {
+ need_retry = !bridgeResponsePort.sendTimingResp(packet);
}
if (need_retry) {