mem: Make DRAMCtrl::decodeAddr const
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Tue, 12 Feb 2019 13:20:42 +0000 (14:20 +0100)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Fri, 19 Apr 2019 16:34:00 +0000 (16:34 +0000)
DRAMCtrl's decodeAddr does not need to modify the packet it
receives, nor should it modify the contents of the class,
and therefore both the packet and the function are made const.

Change-Id: I577f48d9a43611ba54878a9a793cb7b4fbb326f4
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17540
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
src/mem/dram_ctrl.cc
src/mem/dram_ctrl.hh

index e89a47a724df9b7cb9fef134c3d8a318f03cd5f5..429e9ef5e9952bb527a23a04dca03ca79c7e342f 100644 (file)
@@ -303,8 +303,8 @@ DRAMCtrl::writeQueueFull(unsigned int neededEntries) const
 }
 
 DRAMCtrl::DRAMPacket*
-DRAMCtrl::decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned size,
-                       bool isRead)
+DRAMCtrl::decodeAddr(const PacketPtr pkt, Addr dramPktAddr, unsigned size,
+                     bool isRead) const
 {
     // decode the address based on the address mapping scheme, with
     // Ro, Ra, Co, Ba and Ch denoting row, rank, column, bank and
index d09223b4b7d58d371d891853fb4bec44ff83a956..54826e0a882a9e3eb5325a1140996da41f05109a 100644 (file)
@@ -839,8 +839,8 @@ class DRAMCtrl : public QoS::MemCtrl
      * @param isRead Is the request for a read or a write to DRAM
      * @return A DRAMPacket pointer with the decoded information
      */
-    DRAMPacket* decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned int size,
-                           bool isRead);
+    DRAMPacket* decodeAddr(const PacketPtr pkt, Addr dramPktAddr,
+                           unsigned int size, bool isRead) const;
 
     /**
      * The memory schduler/arbiter - picks which request needs to