Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/36885 )

Change subject: dev-arm: Add parent SimObject to constructor of SMMUv3 classes
......................................................................

dev-arm: Add parent SimObject to constructor of SMMUv3 classes

SMMUv3BaseCache and the derived classes and SMMUv3DeviceInterface
constructors need the reference to the corresponding parent
SimObject to bind the stats of the cache to the parent's stats.

Change-Id: I7a99f7288d39b0ce0b4548c1bfebcd4b522f2772
Signed-off-by: Hoa Nguyen <hoangu...@ucdavis.edu>
---
M src/dev/arm/smmu_v3_caches.cc
M src/dev/arm/smmu_v3_caches.hh
M src/dev/arm/smmu_v3_deviceifc.cc
M src/dev/arm/smmu_v3_deviceifc.hh
4 files changed, 22 insertions(+), 17 deletions(-)



diff --git a/src/dev/arm/smmu_v3_caches.cc b/src/dev/arm/smmu_v3_caches.cc
index a56b8a3..fd103a7 100644
--- a/src/dev/arm/smmu_v3_caches.cc
+++ b/src/dev/arm/smmu_v3_caches.cc
@@ -58,7 +58,8 @@
  * TODO: move more code into this base class to reduce duplication.
  */

-SMMUv3BaseCache::SMMUv3BaseCache(const std::string &policy_name, uint32_t seed) : +SMMUv3BaseCache::SMMUv3BaseCache(const std::string &policy_name, uint32_t seed,
+                                 SimObject *parent) :
     replacementPolicy(decodePolicyName(policy_name)),
     nextToReplace(0),
     random(seed),
@@ -144,9 +145,9 @@
  */

 SMMUTLB::SMMUTLB(unsigned numEntries, unsigned _associativity,
-                 const std::string &policy)
+                 const std::string &policy, SimObject *parent)
 :
-    SMMUv3BaseCache(policy, SMMUTLB_SEED),
+    SMMUv3BaseCache(policy, SMMUTLB_SEED, parent),
     associativity(_associativity)
 {
     if (associativity == 0)
@@ -424,9 +425,9 @@
  */

 ARMArchTLB::ARMArchTLB(unsigned numEntries, unsigned _associativity,
-                       const std::string &policy)
+                       const std::string &policy, SimObject *parent)
 :
-    SMMUv3BaseCache(policy, ARMARCHTLB_SEED),
+    SMMUv3BaseCache(policy, ARMARCHTLB_SEED, parent),
     associativity(_associativity)
 {
     if (associativity == 0)
@@ -623,9 +624,9 @@
  */

 IPACache::IPACache(unsigned numEntries, unsigned _associativity,
-                   const std::string &policy)
+                   const std::string &policy, SimObject *parent)
 :
-    SMMUv3BaseCache(policy, IPACACHE_SEED),
+    SMMUv3BaseCache(policy, IPACACHE_SEED, parent),
     associativity(_associativity)
 {
     if (associativity == 0)
@@ -967,8 +968,9 @@
  */

WalkCache::WalkCache(const std::array<unsigned, 2*WALK_CACHE_LEVELS> &_sizes,
-                     unsigned _associativity, const std::string &policy) :
-    SMMUv3BaseCache(policy, WALKCACHE_SEED),
+                     unsigned _associativity, const std::string &policy,
+                     SimObject *parent) :
+    SMMUv3BaseCache(policy, WALKCACHE_SEED, parent),
     associativity(_associativity),
     sizes()
 {
diff --git a/src/dev/arm/smmu_v3_caches.hh b/src/dev/arm/smmu_v3_caches.hh
index 0dfab72..a2bdf73 100644
--- a/src/dev/arm/smmu_v3_caches.hh
+++ b/src/dev/arm/smmu_v3_caches.hh
@@ -81,7 +81,8 @@
     static int decodePolicyName(const std::string &policy_name);

   public:
-    SMMUv3BaseCache(const std::string &policy_name, uint32_t seed);
+    SMMUv3BaseCache(const std::string &policy_name, uint32_t seed,
+                    SimObject *parent);
     virtual ~SMMUv3BaseCache() {}

     virtual void regStats(const std::string &name);
@@ -118,7 +119,7 @@
     };

     SMMUTLB(unsigned numEntries, unsigned _associativity,
-            const std::string &policy);
+            const std::string &policy, SimObject *parent);
     SMMUTLB(const SMMUTLB& tlb) = delete;
     virtual ~SMMUTLB() {}

@@ -167,7 +168,7 @@
     };

     ARMArchTLB(unsigned numEntries, unsigned _associativity,
-               const std::string &policy);
+               const std::string &policy, SimObject *parent);
     virtual ~ARMArchTLB() {}

     const Entry *lookup(Addr va, uint16_t asid, uint16_t vmid,
@@ -210,7 +211,7 @@
     };

     IPACache(unsigned numEntries, unsigned _associativity,
-             const std::string &policy);
+             const std::string &policy, SimObject *parent);
     virtual ~IPACache() {}

     const Entry *lookup(Addr ipa, uint16_t vmid, bool updStats=true);
@@ -258,7 +259,7 @@
     };

     ConfigCache(unsigned numEntries, unsigned _associativity,
-                const std::string &policy);
+                const std::string &policy, SimObject *parent);
     virtual ~ConfigCache() {}

     const Entry *lookup(uint32_t sid, uint32_t ssid, bool updStats=true);
@@ -301,7 +302,8 @@
     };

     WalkCache(const std::array<unsigned, 2*WALK_CACHE_LEVELS> &_sizes,
-              unsigned _associativity, const std::string &policy);
+              unsigned _associativity, const std::string &policy,
+              SimObject *parent);
     virtual ~WalkCache() {}

     const Entry *lookup(Addr va, Addr vaMask, uint16_t asid, uint16_t vmid,
diff --git a/src/dev/arm/smmu_v3_deviceifc.cc b/src/dev/arm/smmu_v3_deviceifc.cc
index 985ca17..035bd52 100644
--- a/src/dev/arm/smmu_v3_deviceifc.cc
+++ b/src/dev/arm/smmu_v3_deviceifc.cc
@@ -43,7 +43,7 @@
 #include "dev/arm/smmu_v3_transl.hh"

 SMMUv3DeviceInterface::SMMUv3DeviceInterface(
-    const SMMUv3DeviceInterfaceParams &p) :
+    const SMMUv3DeviceInterfaceParams &p, SimObject *parent) :
     ClockedObject(p),
     smmu(nullptr),
     microTLB(new SMMUTLB(p.utlb_entries,
diff --git a/src/dev/arm/smmu_v3_deviceifc.hh b/src/dev/arm/smmu_v3_deviceifc.hh
index c324a6a..0f0d1b8 100644
--- a/src/dev/arm/smmu_v3_deviceifc.hh
+++ b/src/dev/arm/smmu_v3_deviceifc.hh
@@ -118,7 +118,8 @@
     Port& getPort(const std::string &name, PortID id) override;

   public:
-    SMMUv3DeviceInterface(const SMMUv3DeviceInterfaceParams &p);
+    SMMUv3DeviceInterface(const SMMUv3DeviceInterfaceParams &p,
+                          SimObject *parent);

     ~SMMUv3DeviceInterface()
     {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/36885
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: I7a99f7288d39b0ce0b4548c1bfebcd4b522f2772
Gerrit-Change-Number: 36885
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to