Wei-Han Chen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67297?usp=email )

Change subject: fastmodel: forward stream ID to gem5
......................................................................

fastmodel: forward stream ID to gem5

This CL enables forwarding stream ID from amba_pv to gem5 world.

The stream ID information is originally stored in master_id of
pv::TransactionAtrribute, then it will be stored to m_id of
amba_pv::amba_pv_extension.

This CL brings the information to stream ID field of
Gem5SystemC::ControlExtension. Then the information can be set to stream
ID of the gem5 packet's request.

After bringing the information to gem5, we can identify the packet's
stream ID from gem5 side. One example usage is PL330. In PL330_DMAC, each
transaction is associated with a stream ID. If we can identitfy the
stream ID, we can, for example, set attribute to specific DMAC channel.

Change-Id: I4bbbe8fb1c2573a796a3a0a7976adf3553bbaa86
---
M src/arch/arm/fastmodel/FastModel.py
M src/arch/arm/fastmodel/amba_to_tlm_bridge.cc
M src/arch/arm/fastmodel/amba_to_tlm_bridge.hh
3 files changed, 43 insertions(+), 10 deletions(-)



diff --git a/src/arch/arm/fastmodel/FastModel.py b/src/arch/arm/fastmodel/FastModel.py
index 8a28522..1ea3c5e 100644
--- a/src/arch/arm/fastmodel/FastModel.py
+++ b/src/arch/arm/fastmodel/FastModel.py
@@ -108,6 +108,10 @@
     amba = AmbaTargetSocket(64, "AMBA PV target socket")
     tlm = TlmInitiatorSocket(64, "TLM initiator socket")

+    set_stream_id = Param.Bool(
+        False, "Set this true to forward stream ID to gem5 world"
+    )
+

 class AmbaFromTlmBridge64(SystemC_ScModule):
     type = "AmbaFromTlmBridge64"
diff --git a/src/arch/arm/fastmodel/amba_to_tlm_bridge.cc b/src/arch/arm/fastmodel/amba_to_tlm_bridge.cc
index 58f6eea..2f065fc 100644
--- a/src/arch/arm/fastmodel/amba_to_tlm_bridge.cc
+++ b/src/arch/arm/fastmodel/amba_to_tlm_bridge.cc
@@ -71,12 +71,14 @@
 namespace fastmodel
 {

-AmbaToTlmBridge64::AmbaToTlmBridge64(const sc_core::sc_module_name& name) :
+AmbaToTlmBridge64::AmbaToTlmBridge64(const AmbaToTlmBridge64Params &params,
+                                     const sc_core::sc_module_name& name) :
     amba_pv::amba_pv_to_tlm_bridge<64>(name),
     targetProxy("target_proxy"),
     initiatorProxy("initiator_proxy"),
     tlmWrapper(initiatorProxy, std::string(name) + ".tlm", -1),
-    ambaWrapper(amba_pv_s, std::string(name) + ".amba", -1)
+    ambaWrapper(amba_pv_s, std::string(name) + ".amba", -1),
+    setStreamId(params.set_stream_id)
 {
     targetProxy.register_b_transport(this, &AmbaToTlmBridge64::bTransport);
     targetProxy.register_get_direct_mem_ptr(
@@ -190,6 +192,10 @@
     control_ex->setSecure(!amba_ex->is_non_secure());
     control_ex->setInstruction(amba_ex->is_instruction());

+    if (setStreamId) {
+        control_ex->setStreamId(amba_ex->get_id());
+    }
+
     if (trans.has_mm()) {
         trans.set_auto_extension(control_ex);
     } else {
@@ -198,11 +204,4 @@
 }

 } // namespace fastmodel
-
-fastmodel::AmbaToTlmBridge64 *
-AmbaToTlmBridge64Params::create() const
-{
-    return new fastmodel::AmbaToTlmBridge64(name.c_str());
-}
-
 } // namespace gem5
diff --git a/src/arch/arm/fastmodel/amba_to_tlm_bridge.hh b/src/arch/arm/fastmodel/amba_to_tlm_bridge.hh
index addaac6..6729604 100644
--- a/src/arch/arm/fastmodel/amba_to_tlm_bridge.hh
+++ b/src/arch/arm/fastmodel/amba_to_tlm_bridge.hh
@@ -33,6 +33,7 @@
 #include "amba_pv.h"
 #pragma GCC diagnostic pop
 #include "arch/arm/fastmodel/amba_ports.hh"
+#include "params/AmbaToTlmBridge64.hh"
 #include "systemc/tlm_port_wrapper.hh"

 namespace gem5
@@ -46,7 +47,11 @@
 class AmbaToTlmBridge64 : public amba_pv::amba_pv_to_tlm_bridge<64>
 {
   public:
-    AmbaToTlmBridge64(const sc_core::sc_module_name &name);
+    AmbaToTlmBridge64(const AmbaToTlmBridge64Params &params,
+                      const sc_core::sc_module_name &name);
+    AmbaToTlmBridge64(const AmbaToTlmBridge64Params &params) :
+      AmbaToTlmBridge64(params, params.name.c_str())
+    {}

gem5::Port &gem5_getPort(const std::string &if_name, int idx=-1) override;

@@ -66,6 +71,7 @@
AmbaToTlmBridge64, 64, tlm::tlm_base_protocol_types> initiatorProxy;
     sc_gem5::TlmInitiatorWrapper<64> tlmWrapper;
     AmbaTarget ambaWrapper;
+    bool setStreamId;
 };

 } // namespace fastmodel

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67297?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: I4bbbe8fb1c2573a796a3a0a7976adf3553bbaa86
Gerrit-Change-Number: 67297
Gerrit-PatchSet: 1
Gerrit-Owner: Wei-Han Chen <weihanc...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to