gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dram_ctrl.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2019 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2013 Amin Farmahini-Farahani
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40  * Authors: Andreas Hansson
41  * Ani Udipi
42  * Neha Agarwal
43  * Omar Naji
44  * Matthias Jung
45  * Wendy Elsasser
46  * Radhika Jagtap
47  */
48 
54 #ifndef __MEM_DRAM_CTRL_HH__
55 #define __MEM_DRAM_CTRL_HH__
56 
57 #include <deque>
58 #include <string>
59 #include <unordered_set>
60 #include <vector>
61 
62 #include "base/callback.hh"
63 #include "base/statistics.hh"
64 #include "enums/AddrMap.hh"
65 #include "enums/MemSched.hh"
66 #include "enums/PageManage.hh"
67 #include "mem/drampower.hh"
68 #include "mem/qos/mem_ctrl.hh"
69 #include "mem/qport.hh"
70 #include "params/DRAMCtrl.hh"
71 #include "sim/eventq.hh"
72 
98 class DRAMCtrl : public QoS::MemCtrl
99 {
100 
101  private:
102 
103  // For now, make use of a queued slave port to avoid dealing with
104  // flow control for the responses being sent back
106  {
107 
110 
111  public:
112 
113  MemoryPort(const std::string& name, DRAMCtrl& _memory);
114 
115  protected:
116 
118 
119  void recvFunctional(PacketPtr pkt);
120 
121  bool recvTimingReq(PacketPtr);
122 
123  virtual AddrRangeList getAddrRanges() const;
124 
125  };
126 
132 
137 
143 
144 
145 
150  struct Command {
151  Data::MemCommand::cmds type;
152  uint8_t bank;
154 
155  constexpr Command(Data::MemCommand::cmds _type, uint8_t _bank,
156  Tick time_stamp)
157  : type(_type), bank(_bank), timeStamp(time_stamp)
158  { }
159  };
160 
170  class Bank
171  {
172 
173  public:
174 
175  static const uint32_t NO_ROW = -1;
176 
177  uint32_t openRow;
178  uint8_t bank;
179  uint8_t bankgr;
180 
185 
186  uint32_t rowAccesses;
187  uint32_t bytesAccessed;
188 
189  Bank() :
190  openRow(NO_ROW), bank(0), bankgr(0),
191  rdAllowedAt(0), wrAllowedAt(0), preAllowedAt(0), actAllowedAt(0),
192  rowAccesses(0), bytesAccessed(0)
193  { }
194  };
195 
196 
224  enum PowerState {
225  PWR_IDLE = 0,
231  };
232 
264  REF_IDLE = 0,
271  };
272 
273  class Rank;
274  struct RankStats : public Stats::Group
275  {
276  RankStats(DRAMCtrl& memory, Rank &rank);
277 
278  void regStats() override;
279  void resetStats() override;
280  void preDumpStats() override;
281 
283 
284  /*
285  * Command energies
286  */
292 
293  /*
294  * Active Background Energy
295  */
297 
298  /*
299  * Precharge Background Energy
300  */
302 
303  /*
304  * Active Power-Down Energy
305  */
307 
308  /*
309  * Precharge Power-Down Energy
310  */
312 
313  /*
314  * self Refresh Energy
315  */
317 
320 
326 
331  };
332 
340  class Rank : public EventManager
341  {
342 
343  private:
344 
349 
355 
360 
365 
370 
374  void updatePowerStats();
375 
383  void schedulePowerEvent(PowerState pwr_state, Tick tick);
384 
385  public:
386 
391 
396 
401 
405  uint8_t rank;
406 
410  uint32_t readEntries;
411 
415  uint32_t writeEntries;
416 
423 
428 
433 
441 
447 
452  unsigned int numBanksActive;
453 
456 
457  Rank(DRAMCtrl& _memory, const DRAMCtrlParams* _p, int rank);
458 
459  const std::string name() const
460  {
461  return csprintf("%s_%d", memory.name(), rank);
462  }
463 
470  void startup(Tick ref_tick);
471 
475  void suspend();
476 
483  bool inRefIdleState() const { return refreshState == REF_IDLE; }
484 
492  bool inPwrIdleState() const { return pwrState == PWR_IDLE; }
493 
504  bool forceSelfRefreshExit() const {
505  return (readEntries != 0) ||
506  ((memory.busStateNext == WRITE) && (writeEntries != 0));
507  }
508 
515  bool isQueueEmpty() const;
516 
521  void checkDrainDone();
522 
529  void flushCmdList();
530 
531  /*
532  * Function to register Stats
533  */
534  void regStats();
535 
539  void computeStats();
540 
544  void resetStats();
545 
552  void powerDownSleep(PowerState pwr_state, Tick tick);
553 
561  void scheduleWakeUpEvent(Tick exit_delay);
562 
563  void processWriteDoneEvent();
565 
566  void processActivateEvent();
568 
569  void processPrechargeEvent();
571 
572  void processRefreshEvent();
574 
575  void processPowerEvent();
577 
578  void processWakeUpEvent();
580 
581  protected:
583  };
584 
591  class BurstHelper {
592 
593  public:
594 
596  const unsigned int burstCount;
597 
599  unsigned int burstsServiced;
600 
601  BurstHelper(unsigned int _burstCount)
602  : burstCount(_burstCount), burstsServiced(0)
603  { }
604  };
605 
610  class DRAMPacket {
611 
612  public:
613 
616 
619 
621  const PacketPtr pkt;
622 
625 
626  const bool read;
627 
629  const uint8_t rank;
630  const uint8_t bank;
631  const uint32_t row;
632 
638  const uint16_t bankId;
639 
647 
652  unsigned int size;
653 
661 
665  uint8_t _qosValue;
666 
671  inline void qosValue(const uint8_t qv) { _qosValue = qv; }
672 
677  inline uint8_t qosValue() const { return _qosValue; }
678 
683  inline MasterID masterId() const { return _masterId; }
684 
689  inline unsigned int getSize() const { return size; }
690 
695  inline Addr getAddr() const { return addr; }
696 
701  inline bool isRead() const { return read; }
702 
707  inline bool isWrite() const { return !read; }
708 
709 
710  DRAMPacket(PacketPtr _pkt, bool is_read, uint8_t _rank, uint8_t _bank,
711  uint32_t _row, uint16_t bank_id, Addr _addr,
712  unsigned int _size, Bank& bank_ref, Rank& rank_ref)
713  : entryTime(curTick()), readyTime(curTick()), pkt(_pkt),
714  _masterId(pkt->masterId()),
715  read(is_read), rank(_rank), bank(_bank), row(_row),
716  bankId(bank_id), addr(_addr), size(_size), burstHelper(NULL),
717  bankRef(bank_ref), rankRef(rank_ref), _qosValue(_pkt->qosValue())
718  { }
719 
720  };
721 
722  // The DRAM packets are store in a multiple dequeue structure,
723  // based on their QoS priority
725 
732  void processNextReqEvent();
734 
735  void processRespondEvent();
737 
744  bool readQueueFull(unsigned int pktCount) const;
745 
752  bool writeQueueFull(unsigned int pktCount) const;
753 
768  void addToReadQueue(PacketPtr pkt, unsigned int pktCount);
769 
781  void addToWriteQueue(PacketPtr pkt, unsigned int pktCount);
782 
793  void doDRAMAccess(DRAMPacket* dram_pkt);
794 
804  void accessAndRespond(PacketPtr pkt, Tick static_latency);
805 
818  DRAMPacket* decodeAddr(const PacketPtr pkt, Addr dramPktAddr,
819  unsigned int size, bool isRead) const;
820 
831  {
832  return range.getOffset(addr);
833  }
834 
846  DRAMPacketQueue::iterator chooseNext(DRAMPacketQueue& queue,
847  Tick extra_col_delay);
848 
857  DRAMPacketQueue::iterator chooseNextFRFCFS(DRAMPacketQueue& queue,
858  Tick extra_col_delay);
859 
871  minBankPrep(const DRAMPacketQueue& queue, Tick min_col_at) const;
872 
884  void activateBank(Rank& rank_ref, Bank& bank_ref, Tick act_tick,
885  uint32_t row);
886 
897  void prechargeBank(Rank& rank_ref, Bank& bank_ref,
898  Tick pre_at, bool trace = true);
899 
903  void printQs() const;
904 
912  Addr burstAlign(Addr addr) const { return (addr & ~(Addr(burstSize - 1))); }
913 
919 
927  std::unordered_set<Addr> isInWriteQueue;
928 
938 
943 
950  const uint32_t deviceSize;
951  const uint32_t deviceBusWidth;
952  const uint32_t burstLength;
953  const uint32_t deviceRowBufferSize;
954  const uint32_t devicesPerRank;
955  const uint32_t burstSize;
956  const uint32_t rowBufferSize;
957  const uint32_t columnsPerRowBuffer;
958  const uint32_t columnsPerStripe;
959  const uint32_t ranksPerChannel;
960  const uint32_t bankGroupsPerRank;
961  const bool bankGroupArch;
962  const uint32_t banksPerRank;
963  uint32_t rowsPerBank;
964  const uint32_t readBufferSize;
965  const uint32_t writeBufferSize;
966  const uint32_t writeHighThreshold;
967  const uint32_t writeLowThreshold;
968  const uint32_t minWritesPerSwitch;
969  uint32_t writesThisTime;
970  uint32_t readsThisTime;
971 
977  const Tick tRTW;
978  const Tick tCS;
979  const Tick tBURST;
981  const Tick tCCD_L;
982  const Tick tRCD;
983  const Tick tCL;
984  const Tick tRP;
985  const Tick tRAS;
986  const Tick tWR;
987  const Tick tRTP;
988  const Tick tRFC;
989  const Tick tREFI;
990  const Tick tRRD;
991  const Tick tRRD_L;
992  const Tick tXAW;
993  const Tick tXP;
994  const Tick tXS;
995  const uint32_t activationLimit;
999 
1004  Enums::MemSched memSchedPolicy;
1005  Enums::AddrMap addrMapping;
1006  Enums::PageManage pageMgmt;
1007 
1012  const uint32_t maxAccessesPerRow;
1013 
1020 
1027 
1032 
1034 
1042 
1044  struct DRAMStats : public Stats::Group {
1045  DRAMStats(DRAMCtrl &dram);
1046 
1047  void regStats() override;
1048  void resetStats() override;
1049 
1051 
1061 
1062  // Average queue lengths
1065 
1066  // Latencies summed over all requests
1070 
1071  // Average latencies per request
1075 
1078 
1079  // Row hit count and rate
1084 
1092 
1098 
1099  // Average bandwidth
1105 
1109 
1112 
1113  // per-master bytes read and written to memory
1116 
1117  // per-master bytes read and written to memory rate
1120 
1121  // per-master read and write serviced memory accesses
1124 
1125  // per-master read and write total memory access latency
1128 
1129  // per-master raed and write average memory access latency
1132 
1133  // DRAM Power Calculation
1135  };
1136 
1138 
1139  // Holds the value of the rank of burst issued
1140  uint8_t activeRank;
1141 
1142  // timestamp offset
1144 
1147 
1150 
1155  std::unique_ptr<Packet> pendingDelete;
1156 
1166  void updatePowerStats(Rank& rank_ref);
1167 
1175  static bool sortTime(const Command& cmd, const Command& cmd_next) {
1176  return cmd.timeStamp < cmd_next.timeStamp;
1177  };
1178 
1179  public:
1180  DRAMCtrl(const DRAMCtrlParams* p);
1181 
1182  DrainState drain() override;
1183 
1184  Port &getPort(const std::string &if_name,
1185  PortID idx=InvalidPortID) override;
1186 
1187  virtual void init() override;
1188  virtual void startup() override;
1189  virtual void drainResume() override;
1190 
1200  bool allRanksDrained() const;
1201 
1202  protected:
1203 
1204  Tick recvAtomic(PacketPtr pkt);
1205  void recvFunctional(PacketPtr pkt);
1206  bool recvTimingReq(PacketPtr pkt);
1207 
1208 };
1209 
1210 #endif //__MEM_DRAM_CTRL_HH__
Stats::Scalar numRdRetry
Definition: dram_ctrl.hh:1076
bool retryWrReq
Definition: dram_ctrl.hh:142
Enums::PageManage pageMgmt
Definition: dram_ctrl.hh:1006
Stats::Scalar preEnergy
Definition: dram_ctrl.hh:288
bool enableDRAMPowerdown
Enable or disable DRAM powerdown states.
Definition: dram_ctrl.hh:1149
Stats::Formula avgBusLat
Definition: dram_ctrl.hh:1073
const uint32_t writeLowThreshold
Definition: dram_ctrl.hh:967
const uint32_t activationLimit
Definition: dram_ctrl.hh:995
Ports are used to interface objects to each other.
Definition: port.hh:60
uint32_t bytesAccessed
Definition: dram_ctrl.hh:187
Stats::Scalar mergedWrBursts
Definition: dram_ctrl.hh:1057
PowerState
The power state captures the different operational states of the DRAM and interacts with the bus read...
Definition: dram_ctrl.hh:224
const Tick entryTime
When did request enter the controller.
Definition: dram_ctrl.hh:615
Stats::Scalar readBursts
Definition: dram_ctrl.hh:1054
Stats::Scalar totalEnergy
Definition: dram_ctrl.hh:318
Stats::Scalar bytesReadDRAM
Definition: dram_ctrl.hh:1093
RankStats stats
Definition: dram_ctrl.hh:582
void prechargeBank(Rank &rank_ref, Bank &bank_ref, Tick pre_at, bool trace=true)
Precharge a given bank and also update when the precharge is done.
Definition: dram_ctrl.cc:1025
#define M5_CLASS_VAR_USED
Definition: compiler.hh:66
void computeStats()
Record stats values like state residency by computing the time difference from previous update...
bool retryRdReq
Remember if we have to retry a request when available.
Definition: dram_ctrl.hh:141
BusState busStateNext
bus state for next request event triggered
Definition: mem_ctrl.hh:124
Stats::Scalar bytesWrittenSys
Definition: dram_ctrl.hh:1097
Stats::Formula busUtil
Definition: dram_ctrl.hh:1106
const Tick tRCD
Definition: dram_ctrl.hh:982
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
Definition: dram_ctrl.cc:2792
const Tick tWR
Definition: dram_ctrl.hh:986
const PortID InvalidPortID
Definition: types.hh:238
std::vector< Command > cmdList
List of commands issued, to be sent to DRAMPpower at refresh and stats dump.
Definition: dram_ctrl.hh:440
std::vector< Rank * > ranks
Vector of ranks.
Definition: dram_ctrl.hh:942
STL pair class.
Definition: stl.hh:61
A stat that calculates the per tick average of a value.
Definition: statistics.hh:2524
DrainState
Object drain/handover states.
Definition: drain.hh:71
void doDRAMAccess(DRAMPacket *dram_pkt)
Actually do the DRAM access - figure out the latency it will take to service the req based on bank st...
Definition: dram_ctrl.cc:1073
EventFunctionWrapper nextReqEvent
Definition: dram_ctrl.hh:733
Stats::Formula avgWrBW
Definition: dram_ctrl.hh:1101
const MasterID _masterId
MasterID associated with the packet.
Definition: dram_ctrl.hh:624
Addr getAddr() const
Get the packet address (interface compatibility with Packet)
Definition: dram_ctrl.hh:695
const Tick tRAS
Definition: dram_ctrl.hh:985
Stats::Formula busUtilRead
Definition: dram_ctrl.hh:1107
std::pair< std::vector< uint32_t >, bool > minBankPrep(const DRAMPacketQueue &queue, Tick min_col_at) const
Find which are the earliest banks ready to issue an activate for the enqueued requests.
Definition: dram_ctrl.cc:1608
A DRAM packet stores packets along with the timestamp of when the packet entered the queue...
Definition: dram_ctrl.hh:610
uint32_t writeEntries
Track number of packets in write queue going to this rank.
Definition: dram_ctrl.hh:415
const Tick tRRD
Definition: dram_ctrl.hh:990
uint32_t openRow
Definition: dram_ctrl.hh:177
bool forceSelfRefreshExit() const
Trigger a self-refresh exit if there are entries enqueued Exit if there are any read entries regardle...
Definition: dram_ctrl.hh:504
Stats::Vector perBankRdBursts
Definition: dram_ctrl.hh:1059
DRAMPacketQueue::iterator chooseNextFRFCFS(DRAMPacketQueue &queue, Tick extra_col_delay)
For FR-FCFS policy reorder the read/write queue depending on row buffer hits and earliest bursts avai...
Definition: dram_ctrl.cc:777
uint32_t readEntries
Track number of packets in read queue going to this rank.
Definition: dram_ctrl.hh:410
Tick lastStatsResetTick
The time when stats were last reset used to calculate average power.
Definition: dram_ctrl.hh:1146
MemoryPort(const std::string &name, DRAMCtrl &_memory)
Definition: dram_ctrl.cc:2786
const Tick frontendLatency
Pipeline latency of the controller frontend.
Definition: dram_ctrl.hh:1019
Stats::Vector masterReadTotalLat
Definition: dram_ctrl.hh:1126
ip6_addr_t addr
Definition: inet.hh:335
const Tick tXP
Definition: dram_ctrl.hh:993
Stats::Formula pageHitRate
Definition: dram_ctrl.hh:1134
Stats::Scalar selfRefreshEnergy
Definition: dram_ctrl.hh:316
bool inPwrIdleState() const
Check if the current rank has all banks closed and is not in a low power state.
Definition: dram_ctrl.hh:492
Stats::Histogram wrPerTurnAround
Definition: dram_ctrl.hh:1091
Stats::Formula avgWrBWSys
Definition: dram_ctrl.hh:1103
DRAMCtrl(const DRAMCtrlParams *p)
Definition: dram_ctrl.cc:62
DrainState drain() override
Notify an object that it needs to drain its state.
Definition: dram_ctrl.cc:2719
uint32_t rowAccesses
Definition: dram_ctrl.hh:186
MasterID masterId() const
Get the packet MasterID (interface compatibility with Packet)
Definition: dram_ctrl.hh:683
std::deque< DRAMPacket * > respQueue
Response queue where read packets wait after we&#39;re done working with them, but it&#39;s not time to send ...
Definition: dram_ctrl.hh:937
const Tick tCL
Definition: dram_ctrl.hh:983
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:66
unsigned int burstsServiced
Number of DRAM bursts serviced so far for a system packet.
Definition: dram_ctrl.hh:599
Stats::Vector memoryStateTime
Track time spent in each power state.
Definition: dram_ctrl.hh:330
Stats::Formula avgQLat
Definition: dram_ctrl.hh:1072
RefreshState refreshState
current refresh state
Definition: dram_ctrl.hh:395
Addr addr
The starting address of the DRAM packet.
Definition: dram_ctrl.hh:646
A vector of scalar stats.
Definition: statistics.hh:2550
bool writeQueueFull(unsigned int pktCount) const
Check if the write queue has room for more entries.
Definition: dram_ctrl.cc:294
uint8_t bank
Definition: dram_ctrl.hh:178
Tick refreshDueAt
Keep track of when a refresh is due.
Definition: dram_ctrl.hh:369
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
Definition: qport.hh:60
const Tick rankToRankDly
Definition: dram_ctrl.hh:996
The DRAM controller is a single-channel memory controller capturing the most important timing constra...
Definition: dram_ctrl.hh:98
Stats::Scalar totGap
Definition: dram_ctrl.hh:1110
Stats::Vector writePktSize
Definition: dram_ctrl.hh:1086
uint8_t rank
Current Rank index.
Definition: dram_ctrl.hh:405
std::deque< DRAMPacket * > DRAMPacketQueue
Definition: dram_ctrl.hh:724
const uint32_t burstLength
Definition: dram_ctrl.hh:952
const uint32_t ranksPerChannel
Definition: dram_ctrl.hh:959
bool readQueueFull(unsigned int pktCount) const
Check if the read queue has room for more entries.
Definition: dram_ctrl.cc:283
Stats::Formula avgRdBW
Definition: dram_ctrl.hh:1100
Declaration of Statistics objects.
DRAMStats stats
Definition: dram_ctrl.hh:1137
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2508
const uint32_t deviceRowBufferSize
Definition: dram_ctrl.hh:953
A burst helper helps organize and manage a packet that is larger than the DRAM burst size...
Definition: dram_ctrl.hh:591
STL vector class.
Definition: stl.hh:40
const uint16_t bankId
Bank id is calculated considering banks in all the ranks eg: 2 ranks each with 8 banks, then bankId = 0 –> rank0, bank0 and bankId = 8 –> rank1, bank0.
Definition: dram_ctrl.hh:638
virtual void init() override
Initialise this memory.
Definition: dram_ctrl.cc:191
uint8_t outstandingEvents
Number of ACT, RD, and WR events currently scheduled Incremented when a refresh event is started as w...
Definition: dram_ctrl.hh:422
EventFunctionWrapper activateEvent
Definition: dram_ctrl.hh:567
Stats::Scalar writeEnergy
Definition: dram_ctrl.hh:290
unsigned int numBanksActive
To track number of banks which are currently active for this rank.
Definition: dram_ctrl.hh:452
Stats::Vector perBankWrBursts
Definition: dram_ctrl.hh:1060
Stats::Formula peakBW
Definition: dram_ctrl.hh:1104
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
Definition: dram_ctrl.cc:2800
bool isTimingMode
Remember if the memory system is in timing mode.
Definition: dram_ctrl.hh:136
Stats::Scalar numWrRetry
Definition: dram_ctrl.hh:1077
A basic class to track the bank state, i.e.
Definition: dram_ctrl.hh:170
Addr getCtrlAddr(Addr addr)
Get an address in a dense range which starts from 0.
Definition: dram_ctrl.hh:830
Declaration of the queued port.
const Tick tCCD_L_WR
Definition: dram_ctrl.hh:980
const uint32_t maxAccessesPerRow
Max column accesses (read and write) per row, before forcefully closing it.
Definition: dram_ctrl.hh:1012
const uint32_t bankGroupsPerRank
Definition: dram_ctrl.hh:960
const Tick tREFI
Definition: dram_ctrl.hh:989
Tick curTick()
The current simulated tick.
Definition: core.hh:47
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
Definition: dram_ctrl.cc:2815
Stats::Vector masterReadBytes
Definition: dram_ctrl.hh:1114
Enums::MemSched memSchedPolicy
Memory controller configuration initialized based on parameter values.
Definition: dram_ctrl.hh:1004
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:162
const Tick backendLatency
Pipeline latency of the backend and PHY.
Definition: dram_ctrl.hh:1026
EventFunctionWrapper prechargeEvent
Definition: dram_ctrl.hh:570
Stats::Vector wrQLenPdf
Definition: dram_ctrl.hh:1088
Stats::Scalar servicedByWrQ
Definition: dram_ctrl.hh:1056
void updatePowerStats(Rank &rank_ref)
This function increments the energy when called.
BurstHelper * burstHelper
A pointer to the BurstHelper if this DRAMPacket is a split packet If not a split packet (common case)...
Definition: dram_ctrl.hh:658
const Tick tRP
Definition: dram_ctrl.hh:984
std::vector< Bank > banks
Vector of Banks.
Definition: dram_ctrl.hh:446
uint64_t Tick
Tick count type.
Definition: types.hh:63
void qosValue(const uint8_t qv)
Set the packet QoS value (interface compatibility with Packet)
Definition: dram_ctrl.hh:671
Stats::Formula avgGap
Definition: dram_ctrl.hh:1111
PowerState pwrState
Current power state.
Definition: dram_ctrl.hh:390
EventFunctionWrapper respondEvent
Definition: dram_ctrl.hh:736
BurstHelper(unsigned int _burstCount)
Definition: dram_ctrl.hh:601
const Tick tRFC
Definition: dram_ctrl.hh:988
std::deque< Tick > actTicks
List to keep track of activate ticks.
Definition: dram_ctrl.hh:455
Stats::Vector masterWriteAccesses
Definition: dram_ctrl.hh:1123
virtual void preDumpStats()
Callback before stats are dumped.
Definition: group.cc:97
uint64_t timeStampOffset
Definition: dram_ctrl.hh:1143
Stats::Formula readRowHitRate
Definition: dram_ctrl.hh:1082
virtual void resetStats()
Callback to reset stats.
Definition: group.cc:84
std::vector< DRAMPacketQueue > readQueue
The controller&#39;s main read and write queues, with support for QoS reordering.
Definition: dram_ctrl.hh:917
Stats::Vector rdQLenPdf
Definition: dram_ctrl.hh:1087
A simple histogram stat.
Definition: statistics.hh:2629
uint32_t writesThisTime
Definition: dram_ctrl.hh:969
Stats::Scalar totQLat
Definition: dram_ctrl.hh:1067
const Tick tRTP
Definition: dram_ctrl.hh:987
Stats::Scalar writeReqs
Definition: dram_ctrl.hh:1053
Stats::Scalar readReqs
Definition: dram_ctrl.hh:1052
Stats::Scalar readEnergy
Definition: dram_ctrl.hh:289
All statistics that the model needs to capture.
Definition: dram_ctrl.hh:1044
const Tick rdToWrDly
Definition: dram_ctrl.hh:998
DRAMPower declaration.
Stats::Formula masterReadAvgLat
Definition: dram_ctrl.hh:1130
Tick pwrStateTick
Track when we transitioned to the current power state.
Definition: dram_ctrl.hh:364
Stats::Vector masterReadAccesses
Definition: dram_ctrl.hh:1122
static bool sortTime(const Command &cmd, const Command &cmd_next)
Function for sorting Command structures based on timeStamp.
Definition: dram_ctrl.hh:1175
Stats::Scalar prePowerDownEnergy
Definition: dram_ctrl.hh:311
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Stats::Scalar bytesReadWrQ
Definition: dram_ctrl.hh:1094
EventFunctionWrapper writeDoneEvent
Definition: dram_ctrl.hh:564
Stats::Formula avgMemAccLat
Definition: dram_ctrl.hh:1074
uint16_t MasterID
Definition: request.hh:86
uint8_t bankgr
Definition: dram_ctrl.hh:179
DRAMCtrl & memory
A reference to the parent DRAMCtrl instance.
Definition: dram_ctrl.hh:348
virtual const std::string name() const
Definition: sim_object.hh:120
const uint8_t rank
Will be populated by address decoder.
Definition: dram_ctrl.hh:629
void activateBank(Rank &rank_ref, Bank &bank_ref, Tick act_tick, uint32_t row)
Keep track of when row activations happen, in order to enforce the maximum number of activations in t...
Definition: dram_ctrl.cc:924
PowerState pwrStatePostRefresh
Previous low-power state, which will be re-entered after refresh.
Definition: dram_ctrl.hh:359
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
RespPacketQueue queue
Definition: dram_ctrl.hh:108
const Tick tCS
Definition: dram_ctrl.hh:978
const Tick M5_CLASS_VAR_USED tCK
Basic memory timing parameters initialized based on parameter values.
Definition: dram_ctrl.hh:976
bool isRead() const
Return true if its a read packet (interface compatibility with Packet)
Definition: dram_ctrl.hh:701
Statistics container.
Definition: group.hh:85
Tick prevArrival
Definition: dram_ctrl.hh:1033
Stats::Scalar averagePower
Definition: dram_ctrl.hh:319
const Tick tXAW
Definition: dram_ctrl.hh:992
const uint32_t row
Definition: dram_ctrl.hh:631
const unsigned int burstCount
Number of DRAM bursts requred for a system packet.
Definition: dram_ctrl.hh:596
std::unique_ptr< Packet > pendingDelete
Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent c...
Definition: dram_ctrl.hh:1155
void addToWriteQueue(PacketPtr pkt, unsigned int pktCount)
Decode the incoming pkt, create a dram_pkt and push to the back of the write queue.
Definition: dram_ctrl.cc:487
const uint32_t rowBufferSize
Definition: dram_ctrl.hh:956
bool inRefIdleState() const
Check if there is no refresh and no preparation of refresh ongoing i.e.
Definition: dram_ctrl.hh:483
const uint32_t devicesPerRank
Definition: dram_ctrl.hh:954
uint32_t rowsPerBank
Definition: dram_ctrl.hh:963
PowerState pwrStateTrans
Since we are taking decisions out of order, we need to keep track of what power transition is happeni...
Definition: dram_ctrl.hh:354
uint8_t _qosValue
QoS value of the encapsulated packet read at queuing time.
Definition: dram_ctrl.hh:665
const uint32_t minWritesPerSwitch
Definition: dram_ctrl.hh:968
Stats::Formula masterWriteRate
Definition: dram_ctrl.hh:1119
A formula for statistics that is calculated when printed.
Definition: statistics.hh:3012
void accessAndRespond(PacketPtr pkt, Tick static_latency)
When a packet reaches its "readyTime" in the response Q, use the "access()" method in AbstractMemory ...
Definition: dram_ctrl.cc:887
const uint32_t deviceBusWidth
Definition: dram_ctrl.hh:951
const Tick tXS
Definition: dram_ctrl.hh:994
Stats::Scalar bytesReadSys
Definition: dram_ctrl.hh:1096
Stats::Formula avgRdBWSys
Definition: dram_ctrl.hh:1102
EventFunctionWrapper powerEvent
Definition: dram_ctrl.hh:576
AddrRange range
const uint32_t writeHighThreshold
Definition: dram_ctrl.hh:966
Enums::AddrMap addrMapping
Definition: dram_ctrl.hh:1005
Tick nextReqTime
The soonest you have to start thinking about the next request is the longest access time that can occ...
Definition: dram_ctrl.hh:1041
Stats::Scalar neitherReadNorWriteReqs
Definition: dram_ctrl.hh:1058
bool allRanksDrained() const
Return true once refresh is complete for all ranks and there are no additional commands enqueued...
Definition: dram_ctrl.cc:2753
Stats::Scalar preBackEnergy
Definition: dram_ctrl.hh:301
RefreshState
The refresh state is used to control the progress of the refresh scheduling.
Definition: dram_ctrl.hh:263
DRAMPacket(PacketPtr _pkt, bool is_read, uint8_t _rank, uint8_t _bank, uint32_t _row, uint16_t bank_id, Addr _addr, unsigned int _size, Bank &bank_ref, Rank &rank_ref)
Definition: dram_ctrl.hh:710
const Tick tRTW
Definition: dram_ctrl.hh:977
Stats::Scalar totBusLat
Definition: dram_ctrl.hh:1068
Stats::Average avgRdQLen
Definition: dram_ctrl.hh:1063
EventFunctionWrapper wakeUpEvent
Definition: dram_ctrl.hh:579
const std::string name() const
Definition: dram_ctrl.hh:459
DRAMPacket * decodeAddr(const PacketPtr pkt, Addr dramPktAddr, unsigned int size, bool isRead) const
Address decoder to figure out physical mapping onto ranks, banks, and rows.
Definition: dram_ctrl.cc:304
DRAMPower power
One DRAMPower instance per rank.
Definition: dram_ctrl.hh:432
Stats::Scalar writeRowHits
Definition: dram_ctrl.hh:1081
unsigned int getSize() const
Get the packet size (interface compatibility with Packet)
Definition: dram_ctrl.hh:689
Stats::Scalar totalIdleTime
Stat to track total DRAM idle time.
Definition: dram_ctrl.hh:325
const Tick tCCD_L
Definition: dram_ctrl.hh:981
uint64_t size() const
Get the memory size.
Tick wakeUpAllowedAt
delay power-down and self-refresh exit until this requirement is met
Definition: dram_ctrl.hh:427
Stats::Formula busUtilWrite
Definition: dram_ctrl.hh:1108
Stats::Formula writeRowHitRate
Definition: dram_ctrl.hh:1083
void processNextReqEvent()
Bunch of things requires to setup "events" in gem5 When event "respondEvent" occurs for example...
Definition: dram_ctrl.cc:1302
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:106
Stats::Scalar actEnergy
Definition: dram_ctrl.hh:287
std::unordered_set< Addr > isInWriteQueue
To avoid iterating over the write queue to check for overlapping transactions, maintain a set of burs...
Definition: dram_ctrl.hh:927
const uint32_t columnsPerRowBuffer
Definition: dram_ctrl.hh:957
Stats::Histogram bytesPerActivate
Definition: dram_ctrl.hh:1089
Stats::Formula masterWriteAvgLat
Definition: dram_ctrl.hh:1131
Stats::Scalar actBackEnergy
Definition: dram_ctrl.hh:296
EventFunctionWrapper refreshEvent
Definition: dram_ctrl.hh:573
uint32_t readsThisTime
Definition: dram_ctrl.hh:970
Definition: mem.h:38
Stats::Scalar readRowHits
Definition: dram_ctrl.hh:1080
Simple structure to hold the values needed to keep track of commands for DRAMPower.
Definition: dram_ctrl.hh:150
Stats::Formula masterReadRate
Definition: dram_ctrl.hh:1118
const uint32_t deviceSize
The following are basic design parameters of the memory controller, and are initialized based on para...
Definition: dram_ctrl.hh:950
Addr getOffset(const Addr &a) const
Determine the offset of an address within the range.
Definition: addr_range.hh:524
uint8_t activeRank
Definition: dram_ctrl.hh:1140
Stats::Average avgWrQLen
Definition: dram_ctrl.hh:1064
std::vector< DRAMPacketQueue > writeQueue
Definition: dram_ctrl.hh:918
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
Tick readyTime
When will request leave the controller.
Definition: dram_ctrl.hh:618
const uint32_t columnsPerStripe
Definition: dram_ctrl.hh:958
Stats::Scalar totMemAccLat
Definition: dram_ctrl.hh:1069
const uint8_t bank
Definition: dram_ctrl.hh:630
Data::MemCommand::cmds type
Definition: dram_ctrl.hh:151
Tick nextBurstAt
Till when must we wait before issuing next RD/WR burst?
Definition: dram_ctrl.hh:1031
void processRespondEvent()
Definition: dram_ctrl.cc:650
const uint32_t writeBufferSize
Definition: dram_ctrl.hh:965
const uint32_t burstSize
Definition: dram_ctrl.hh:955
const uint32_t banksPerRank
Definition: dram_ctrl.hh:962
const uint32_t readBufferSize
Definition: dram_ctrl.hh:964
DRAMPower is a standalone tool which calculates the power consumed by a DRAM in the system...
Definition: drampower.hh:55
uint8_t qosValue() const
Get the packet QoS value (interface compatibility with Packet)
Definition: dram_ctrl.hh:677
Bitfield< 0 > p
const Tick tRRD_L
Definition: dram_ctrl.hh:991
virtual void drainResume() override
Resume execution after a successful drain.
Definition: dram_ctrl.cc:2768
virtual void startup() override
startup() is the final initialization call before simulation.
Definition: dram_ctrl.cc:239
Addr burstAlign(Addr addr) const
Burst-align an address.
Definition: dram_ctrl.hh:912
Stats::Vector masterWriteBytes
Definition: dram_ctrl.hh:1115
The QoS::MemCtrl is a base class for Memory objects which support QoS - it provides access to a set o...
Definition: mem_ctrl.hh:61
Stats::Vector readPktSize
Definition: dram_ctrl.hh:1085
const Tick wrToRdDly
Definition: dram_ctrl.hh:997
void addToReadQueue(PacketPtr pkt, unsigned int pktCount)
When a new read comes in, first check if the write q has a pending request to the same address...
Definition: dram_ctrl.cc:380
Stats::Scalar actPowerDownEnergy
Definition: dram_ctrl.hh:306
void printQs() const
Used for debugging to observe the contents of the queues.
Definition: dram_ctrl.cc:561
unsigned int size
The size of this dram packet in bytes It is always equal or smaller than DRAM burst size...
Definition: dram_ctrl.hh:652
bool recvTimingReq(PacketPtr)
Receive a timing request from the peer.
Definition: dram_ctrl.cc:2821
const bool bankGroupArch
Definition: dram_ctrl.hh:961
Stats::Vector masterWriteTotalLat
Definition: dram_ctrl.hh:1127
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: dram_ctrl.cc:2709
Stats::Scalar writeBursts
Definition: dram_ctrl.hh:1055
const PacketPtr pkt
This comes from the outside world.
Definition: dram_ctrl.hh:621
constexpr Command(Data::MemCommand::cmds _type, uint8_t _bank, Tick time_stamp)
Definition: dram_ctrl.hh:155
Stats::Histogram rdPerTurnAround
Definition: dram_ctrl.hh:1090
Rank class includes a vector of banks.
Definition: dram_ctrl.hh:340
Stats::Scalar bytesWritten
Definition: dram_ctrl.hh:1095
bool inLowPowerState
rank is in or transitioning to power-down or self-refresh
Definition: dram_ctrl.hh:400
MemoryPort port
Our incoming port, for a multi-ported controller add a crossbar in front of it.
Definition: dram_ctrl.hh:131
bool isWrite() const
Return true if its a write packet (interface compatibility with Packet)
Definition: dram_ctrl.hh:707
const Tick tBURST
Definition: dram_ctrl.hh:979
Stats::Scalar refreshEnergy
Definition: dram_ctrl.hh:291
DRAMPacketQueue::iterator chooseNext(DRAMPacketQueue &queue, Tick extra_col_delay)
The memory schduler/arbiter - picks which request needs to go next, based on the specified policy suc...
Definition: dram_ctrl.cc:742

Generated on Fri Feb 28 2020 16:27:02 for gem5 by doxygen 1.8.13