Yu-hsin Wang has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/63871?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: systemc: fix flexible conversion when reusing transactions
......................................................................
systemc: fix flexible conversion when reusing transactions
To make the all extension states correct, we still need to proceed the
plugins when reusing the transactions, since we don't know the detail of
the plugins.
Change-Id: I18acd64f54be4c82a0678b98e834ea9548de1f58
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63871
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/systemc/tlm_bridge/gem5_to_tlm.cc
M src/systemc/tlm_bridge/tlm_to_gem5.cc
2 files changed, 29 insertions(+), 2 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/systemc/tlm_bridge/gem5_to_tlm.cc
b/src/systemc/tlm_bridge/gem5_to_tlm.cc
index 6f17a8b..07e4821 100644
--- a/src/systemc/tlm_bridge/gem5_to_tlm.cc
+++ b/src/systemc/tlm_bridge/gem5_to_tlm.cc
@@ -112,7 +112,8 @@
* gem5 packet to tlm payload. This can be useful when there exists a
SystemC
* extension that requires information in gem5 packet. For example, if a
user
* defined a SystemC extension the carries stream_id, the user may add a
step
- * here to read stream_id out and set the extension properly.
+ * here to read stream_id out and set the extension properly. Steps should
be
+ * idempotent.
*/
void
addPacketToPayloadConversionStep(PacketToPayloadConversionStep step)
@@ -140,6 +141,10 @@
trans = &tlmSenderState->trans;
trans->set_address(packet->getAddr());
trans->acquire();
+ // Apply all conversion steps necessary in this specific setup.
+ for (auto &step : extraPacketToPayloadSteps) {
+ step(packet, *trans);
+ }
return trans;
}
diff --git a/src/systemc/tlm_bridge/tlm_to_gem5.cc
b/src/systemc/tlm_bridge/tlm_to_gem5.cc
index 84907be..25da42b 100644
--- a/src/systemc/tlm_bridge/tlm_to_gem5.cc
+++ b/src/systemc/tlm_bridge/tlm_to_gem5.cc
@@ -89,7 +89,8 @@
* tlm payload to gem5 packet. This can be useful when there exists a
SystemC
* extension that carries extra information. For example, SystemC user
might
* define an extension to store stream_id, the user may then add an extra
step
- * to set the generated request's stream_id accordingly.
+ * to set the generated request's stream_id accordingly. Steps should be
+ * idempotent.
*/
void
addPayloadToPacketConversionStep(PayloadToPacketConversionStep step)
@@ -117,6 +118,10 @@
auto pkt = extension->getPacket();
// Sync the address which could have changed.
pkt->setAddr(trans.get_address());
+ // Apply all conversion steps necessary in this specific setup.
+ for (auto &step : extraPayloadToPacketSteps) {
+ step(pkt, trans);
+ }
return std::make_pair(pkt, false);
}
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/63871?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I18acd64f54be4c82a0678b98e834ea9548de1f58
Gerrit-Change-Number: 63871
Gerrit-PatchSet: 4
Gerrit-Owner: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-Reviewer: Earl Ou <shunhsin...@google.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Jui-min Lee <f...@google.com>
Gerrit-Reviewer: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org