Eden Avivi has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33512 )

Change subject: sim: MasterID to UniqueID
......................................................................

sim: MasterID to UniqueID

Change-Id: I6fafa29509bf8d83d71d5c26d2c988d3e65fe327
---
M src/sim/probe/mem.hh
M src/sim/system.cc
M src/sim/system.hh
3 files changed, 23 insertions(+), 23 deletions(-)



diff --git a/src/sim/probe/mem.hh b/src/sim/probe/mem.hh
index fed7bcf..e8200c4 100644
--- a/src/sim/probe/mem.hh
+++ b/src/sim/probe/mem.hh
@@ -56,7 +56,7 @@
     uint32_t size;
     Request::FlagsType flags;
     Addr pc;
-    MasterID master;
+    UniqueID master;

     explicit PacketInfo(const PacketPtr& pkt) :
         cmd(pkt->cmd),
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 8185f13..69fc4d7 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -247,7 +247,7 @@
warn_once("Cache line size is neither 16, 32, 64 nor 128 bytes.\n");

     // Get the generic system master IDs
-    MasterID tmp_id M5_VAR_USED;
+    UniqueID tmp_id M5_VAR_USED;
     tmp_id = getMasterId(this, "writebacks");
     assert(tmp_id == Request::wbMasterId);
     tmp_id = getMasterId(this, "functional");
@@ -420,7 +420,7 @@
 }

 void
-System::addDeviceMemory(MasterID masterId, AbstractMemory *deviceMemory)
+System::addDeviceMemory(UniqueID masterId, AbstractMemory *deviceMemory)
 {
     if (!deviceMemMap.count(masterId)) {
         deviceMemMap.insert(std::make_pair(masterId, deviceMemory));
@@ -430,17 +430,17 @@
 bool
 System::isDeviceMemAddr(PacketPtr pkt) const
 {
-    const MasterID& mid = pkt->masterId();
+    const UniqueID& mid = pkt->masterId();

     return (deviceMemMap.count(mid) &&
             deviceMemMap.at(mid)->getAddrRange().contains(pkt->getAddr()));
 }

 AbstractMemory *
-System::getDeviceMemory(MasterID mid) const
+System::getDeviceMemory(UniqueID mid) const
 {
     panic_if(!deviceMemMap.count(mid),
-             "No device memory found for MasterID %d\n", mid);
+             "No device memory found for UniqueID %d\n", mid);
     return deviceMemMap.at(mid);
 }

@@ -553,10 +553,10 @@
     }
 }

-MasterID
+UniqueID
 System::lookupMasterId(const SimObject* obj) const
 {
-    MasterID id = Request::invldMasterId;
+    UniqueID id = Request::invldMasterId;

     // number of occurrences of the SimObject pointer
     // in the master list.
@@ -570,13 +570,13 @@
     }

     fatal_if(obj_number > 1,
-        "Cannot lookup MasterID by SimObject pointer: "
+        "Cannot lookup UniqueID by SimObject pointer: "
         "More than one master is sharing the same SimObject\n");

     return id;
 }

-MasterID
+UniqueID
 System::lookupMasterId(const std::string& master_name) const
 {
     std::string name = stripSystemName(master_name);
@@ -590,20 +590,20 @@
     return Request::invldMasterId;
 }

-MasterID
+UniqueID
 System::getGlobalMasterId(const std::string& master_name)
 {
     return _getMasterId(nullptr, master_name);
 }

-MasterID
+UniqueID
 System::getMasterId(const SimObject* master, std::string submaster)
 {
     auto master_name = leafMasterName(master, submaster);
     return _getMasterId(master, master_name);
 }

-MasterID
+UniqueID
System::_getMasterId(const SimObject* master, const std::string& master_name)
 {
     std::string name = stripSystemName(master_name);
@@ -624,8 +624,8 @@
                 "You must do so in init().\n");
     }

-    // Generate a new MasterID incrementally
-    MasterID master_id = masters.size();
+    // Generate a new UniqueID incrementally
+    UniqueID master_id = masters.size();

     // Append the new Master metadata to the group of system Masters.
     masters.emplace_back(master, name, master_id);
@@ -646,7 +646,7 @@
 }

 std::string
-System::getMasterName(MasterID master_id)
+System::getMasterName(UniqueID master_id)
 {
     if (master_id >= masters.size())
         fatal("Invalid master_id passed to getMasterName()\n");
diff --git a/src/sim/system.hh b/src/sim/system.hh
index 8e2c472..5ab5144 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -99,7 +99,7 @@
     SystemPort _systemPort;

// Map of memory address ranges for devices with their own backing stores
-    std::unordered_map<MasterID, AbstractMemory *> deviceMemMap;
+    std::unordered_map<UniqueID, AbstractMemory *> deviceMemMap;

   public:

@@ -361,19 +361,19 @@
      * be considered a non-PIO memory address if the masterId of the packet
      * and range match something in the device memory map.
      */
-    void addDeviceMemory(MasterID masterID, AbstractMemory *deviceMemory);
+    void addDeviceMemory(UniqueID masterID, AbstractMemory *deviceMemory);

     /**
      * Similar to isMemAddr but for devices. Checks if a physical address
* of the packet match an address range of a device corresponding to the
-     * MasterId of the request.
+     * UniqueId of the request.
      */
     bool isDeviceMemAddr(PacketPtr pkt) const;

     /**
      * Return a pointer to the device memory.
      */
-    AbstractMemory *getDeviceMemory(MasterID masterID) const;
+    AbstractMemory *getDeviceMemory(UniqueID masterID) const;

     /**
      * Get the architecture.
@@ -448,7 +448,7 @@
* appropriately name the bins of their per-master stats before the stats
      * are finalized.
      *
-     * Registers a MasterID:
+     * Registers a UniqueID:
      * This method takes two parameters, one of which is optional.
      * The first one is the master object, and it is compulsory; in case
      * a object has multiple (sub)masters, a second parameter must be
@@ -471,11 +471,11 @@
      * @param submaster String containing the submaster's name
      * @return the master's ID.
      */
-    MasterID getMasterId(const SimObject* master,
+    UniqueID getMasterId(const SimObject* master,
                          std::string submaster = std::string());

     /**
-     * Registers a GLOBAL MasterID, which is a MasterID not related
+     * Registers a GLOBAL UniqueID, which is a UniqueID not related
      * to any particular SimObject; since no SimObject is passed,
      * the master gets registered by providing the full master name.
      *

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33512
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: I6fafa29509bf8d83d71d5c26d2c988d3e65fe327
Gerrit-Change-Number: 33512
Gerrit-PatchSet: 1
Gerrit-Owner: Eden Avivi <eav...@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