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

Change subject: fastmodel: Create amba_pv extension if not exist
......................................................................

fastmodel: Create amba_pv extension if not exist

This CL create amba_pv extension is it doesn't exist in tlm to amba
bridge. Also, when creating a new amba_pv extension, it tries to set
that correctly.

Change-Id: I5cbb537192e95a615ff7e606657f73426f2c79a8
---
M src/arch/arm/fastmodel/amba_from_tlm_bridge.cc
1 file changed, 22 insertions(+), 1 deletion(-)



diff --git a/src/arch/arm/fastmodel/amba_from_tlm_bridge.cc b/src/arch/arm/fastmodel/amba_from_tlm_bridge.cc
index d21b5f8..34a63bb 100644
--- a/src/arch/arm/fastmodel/amba_from_tlm_bridge.cc
+++ b/src/arch/arm/fastmodel/amba_from_tlm_bridge.cc
@@ -108,8 +108,29 @@

     amba_pv::amba_pv_extension *amba_ex = nullptr;
     trans.get_extension(amba_ex);
+
     if (!amba_ex) {
-        return;
+        amba_ex = new amba_pv::amba_pv_extension();
+
+        // Codes are copied from amba_pv_from_tlm_bridge header.
+        // It tries to initiate a new amba_pv extension correctly.
+        unsigned int l = trans.get_data_length();
+        unsigned int w = amba_pv_m.get_bus_width_bytes();
+        if (l > w) {
+            amba_ex->set_size(w);
+            amba_ex->set_length(l / w);
+            if (trans.get_streaming_width() < l) {
+                amba_ex->set_burst(amba_pv::AMBA_PV_FIXED);
+            }
+        } else {
+            amba_ex->set_size(l);
+        }
+
+        if (trans.has_mm()) {
+            trans.set_auto_extension(amba_ex);
+        } else {
+            trans.set_extension(amba_ex);
+        }
     }

     amba_ex->set_privileged(control_ex->isPrivileged());

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69481?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: I5cbb537192e95a615ff7e606657f73426f2c79a8
Gerrit-Change-Number: 69481
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