mem-cache: Fix setting prefetch bit
[gem5.git] / src / mem / addr_mapper.hh
index 6b47cfcb8e35239131b5b66dcb86a5e94ba04111..2fad1330cae146fd2894bd349e690b691f88aa40 100644 (file)
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Andreas Hansson
  */
 
 #ifndef __MEM_ADDR_MAPPER_HH__
 #define __MEM_ADDR_MAPPER_HH__
 
-#include "mem/mem_object.hh"
+#include "mem/port.hh"
 #include "params/AddrMapper.hh"
 #include "params/RangeAddrMapper.hh"
+#include "sim/sim_object.hh"
 
 /**
  * An address mapper changes the packet addresses in going from the
- * slave port side of the mapper to the master port side. When the
- * slave port is queried for the address ranges, it also performs the
+ * response port side of the mapper to the request port side. When the
+ * response port is queried for the address ranges, it also performs the
  * necessary range updates. Note that snoop requests that travel from
- * the master port (i.e. the memory side) to the slave port are
+ * the request port (i.e. the memory side) to the response port are
  * currently not modified.
  */
 
-class AddrMapper : public MemObject
+class AddrMapper : public SimObject
 {
 
   public:
 
-    AddrMapper(const AddrMapperParamsparams);
+    AddrMapper(const AddrMapperParams &params);
 
     virtual ~AddrMapper() { }
 
     Port &getPort(const std::string &if_name,
                   PortID idx=InvalidPortID) override;
 
-    virtual void init();
+    void init() override;
 
   protected:
 
@@ -99,13 +98,13 @@ class AddrMapper : public MemObject
 
     };
 
-    class MapperMasterPort : public MasterPort
+    class MapperRequestPort : public RequestPort
     {
 
       public:
 
-        MapperMasterPort(const std::string& _name, AddrMapper& _mapper)
-            : MasterPort(_name, &_mapper), mapper(_mapper)
+        MapperRequestPort(const std::string& _name, AddrMapper& _mapper)
+            : RequestPort(_name, &_mapper), mapper(_mapper)
         { }
 
       protected:
@@ -151,16 +150,16 @@ class AddrMapper : public MemObject
 
     };
 
-    /** Instance of master port, facing the memory side */
-    MapperMasterPort masterPort;
+    /** Instance of request port, facing the memory side */
+    MapperRequestPort memSidePort;
 
-    class MapperSlavePort : public SlavePort
+    class MapperResponsePort : public ResponsePort
     {
 
       public:
 
-        MapperSlavePort(const std::string& _name, AddrMapper& _mapper)
-            : SlavePort(_name, &_mapper), mapper(_mapper)
+        MapperResponsePort(const std::string& _name, AddrMapper& _mapper)
+            : ResponsePort(_name, &_mapper), mapper(_mapper)
         { }
 
       protected:
@@ -201,8 +200,8 @@ class AddrMapper : public MemObject
 
     };
 
-    /** Instance of slave port, i.e. on the CPU side */
-    MapperSlavePort slavePort;
+    /** Instance of response port, i.e. on the CPU side */
+    MapperResponsePort cpuSidePort;
 
     void recvFunctional(PacketPtr pkt);
 
@@ -242,7 +241,7 @@ class RangeAddrMapper : public AddrMapper
 
   public:
 
-    RangeAddrMapper(const RangeAddrMapperParamsp);
+    RangeAddrMapper(const RangeAddrMapperParams &p);
 
     ~RangeAddrMapper() { }