Wei-Han Chen has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/69478?usp=email )
Change subject: systemc: Add helper function to set AXI4 attributes from
flag
......................................................................
systemc: Add helper function to set AXI4 attributes from flag
This CL adds helper function to setup AXI4 cache attributes in
ControlExtension from AXI4 cache attribute flag.
Change-Id: Id4e8f234fe2ca88282b24fda9fcbe2f5fdcc4a3d
M src/systemc/tlm_bridge/sc_ext.cc
M src/systemc/tlm_bridge/sc_ext.hh
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/systemc/tlm_bridge/sc_ext.cc
b/src/systemc/tlm_bridge/sc_ext.cc
index 10daa9a..2b78508 100644
--- a/src/systemc/tlm_bridge/sc_ext.cc
+++ b/src/systemc/tlm_bridge/sc_ext.cc
@@ -387,4 +387,13 @@
write_allocate = std::move(wa);
}
+void
+ControlExtension::setAXI4CacheAttributesFromFlag(uint32_t axi4_flag)
+{
- 
setBufferable((axi4_flag >> 0) & 1);
 
- 
setModifiable((axi4_flag >> 1) & 1);
 
- 
setReadAllocate((axi4_flag >> 2) & 1);
 
- 
setWriteAllocate((axi4_flag >> 3) & 1);
+}
 
- 
}  // namespace Gem5SystemC
diff --git a/src/systemc/tlm_bridge/sc_ext.hh
b/src/systemc/tlm_bridge/sc_ext.hh
index 96e679c..bc33e48 100644
--- a/src/systemc/tlm_bridge/sc_ext.hh
+++ b/src/systemc/tlm_bridge/sc_ext.hh
@@ -138,6 +138,8 @@
std::optional<bool> getWriteAllocate() const;
void setWriteAllocate(std::optional<bool> wa);
 
- 
void setAXI4CacheAttributesFromFlag(uint32_t axi4_flag);
 
- 
private:
/* Secure and privileged access */
bool privileged;
 
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69478?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: Id4e8f234fe2ca88282b24fda9fcbe2f5fdcc4a3d
Gerrit-Change-Number: 69478
Gerrit-PatchSet: 1
Gerrit-Owner: Wei-Han Chen weihanchen@google.com
Gerrit-MessageType: newchange
 
                Wei-Han Chen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/69478?usp=email )
Change subject: systemc: Add helper function to set AXI4 attributes from  
flag
......................................................................
systemc: Add helper function to set AXI4 attributes from flag
This CL adds helper function to setup AXI4 cache attributes in
ControlExtension from AXI4 cache attribute flag.
Change-Id: Id4e8f234fe2ca88282b24fda9fcbe2f5fdcc4a3d
---
M src/systemc/tlm_bridge/sc_ext.cc
M src/systemc/tlm_bridge/sc_ext.hh
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/systemc/tlm_bridge/sc_ext.cc  
b/src/systemc/tlm_bridge/sc_ext.cc
index 10daa9a..2b78508 100644
--- a/src/systemc/tlm_bridge/sc_ext.cc
+++ b/src/systemc/tlm_bridge/sc_ext.cc
@@ -387,4 +387,13 @@
      write_allocate = std::move(wa);
  }
+void
+ControlExtension::setAXI4CacheAttributesFromFlag(uint32_t axi4_flag)
+{
+    setBufferable((axi4_flag >> 0) & 1);
+    setModifiable((axi4_flag >> 1) & 1);
+    setReadAllocate((axi4_flag >> 2) & 1);
+    setWriteAllocate((axi4_flag >> 3) & 1);
+}
+
  }  // namespace Gem5SystemC
diff --git a/src/systemc/tlm_bridge/sc_ext.hh  
b/src/systemc/tlm_bridge/sc_ext.hh
index 96e679c..bc33e48 100644
--- a/src/systemc/tlm_bridge/sc_ext.hh
+++ b/src/systemc/tlm_bridge/sc_ext.hh
@@ -138,6 +138,8 @@
      std::optional<bool> getWriteAllocate() const;
      void setWriteAllocate(std::optional<bool> wa);
+    void setAXI4CacheAttributesFromFlag(uint32_t axi4_flag);
+
    private:
      /* Secure and privileged access */
      bool privileged;
-- 
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/69478?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: Id4e8f234fe2ca88282b24fda9fcbe2f5fdcc4a3d
Gerrit-Change-Number: 69478
Gerrit-PatchSet: 1
Gerrit-Owner: Wei-Han Chen <weihanchen@google.com>
Gerrit-MessageType: newchange