gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dram_ctrl.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2016 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  */
47 
53 #ifndef __MEM_DRAM_CTRL_HH__
54 #define __MEM_DRAM_CTRL_HH__
55 
56 #include <deque>
57 #include <string>
58 #include <unordered_set>
59 
60 #include "base/callback.hh"
61 #include "base/statistics.hh"
62 #include "enums/AddrMap.hh"
63 #include "enums/MemSched.hh"
64 #include "enums/PageManage.hh"
65 #include "mem/abstract_mem.hh"
66 #include "mem/qport.hh"
67 #include "params/DRAMCtrl.hh"
68 #include "sim/eventq.hh"
69 #include "mem/drampower.hh"
70 
96 class DRAMCtrl : public AbstractMemory
97 {
98 
99  private:
100 
101  // For now, make use of a queued slave port to avoid dealing with
102  // flow control for the responses being sent back
104  {
105 
108 
109  public:
110 
111  MemoryPort(const std::string& name, DRAMCtrl& _memory);
112 
113  protected:
114 
116 
117  void recvFunctional(PacketPtr pkt);
118 
119  bool recvTimingReq(PacketPtr);
120 
121  virtual AddrRangeList getAddrRanges() const;
122 
123  };
124 
130 
135 
141 
146  enum BusState {
147  READ = 0,
149  };
150 
152 
153  /* bus state for next request event triggered */
155 
160  struct Command {
161  Data::MemCommand::cmds type;
162  uint8_t bank;
164 
165  constexpr Command(Data::MemCommand::cmds _type, uint8_t _bank,
166  Tick time_stamp)
167  : type(_type), bank(_bank), timeStamp(time_stamp)
168  { }
169  };
170 
180  class Bank
181  {
182 
183  public:
184 
185  static const uint32_t NO_ROW = -1;
186 
187  uint32_t openRow;
188  uint8_t bank;
189  uint8_t bankgr;
190 
194 
195  uint32_t rowAccesses;
196  uint32_t bytesAccessed;
197 
198  Bank() :
199  openRow(NO_ROW), bank(0), bankgr(0),
202  { }
203  };
204 
205 
233  enum PowerState {
234  PWR_IDLE = 0,
240  };
241 
273  REF_IDLE = 0,
280  };
281 
289  class Rank : public EventManager
290  {
291 
292  private:
293 
298 
304 
309 
314 
319 
320  /*
321  * Command energies
322  */
328 
329  /*
330  * Active Background Energy
331  */
333 
334  /*
335  * Precharge Background Energy
336  */
338 
339  /*
340  * Active Power-Down Energy
341  */
343 
344  /*
345  * Precharge Power-Down Energy
346  */
348 
349  /*
350  * self Refresh Energy
351  */
353 
356 
362 
367 
371  void updatePowerStats();
372 
380  void schedulePowerEvent(PowerState pwr_state, Tick tick);
381 
382  public:
383 
388 
393 
398 
402  uint8_t rank;
403 
407  uint32_t readEntries;
408 
412  uint32_t writeEntries;
413 
420 
425 
430 
438 
444 
449  unsigned int numBanksActive;
450 
453 
454  Rank(DRAMCtrl& _memory, const DRAMCtrlParams* _p);
455 
456  const std::string name() const
457  {
458  return csprintf("%s_%d", memory.name(), rank);
459  }
460 
467  void startup(Tick ref_tick);
468 
472  void suspend();
473 
483  bool isAvailable() 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 lowPowerEntryReady() 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 
547  void powerDownSleep(PowerState pwr_state, Tick tick);
548 
556  void scheduleWakeUpEvent(Tick exit_delay);
557 
558  void processWriteDoneEvent();
561 
562  void processActivateEvent();
565 
566  void processPrechargeEvent();
569 
570  void processRefreshEvent();
573 
574  void processPowerEvent();
577 
578  void processWakeUpEvent();
581 
582  };
583 
584  // define the process to compute stats on simulation exit
585  // defined per rank as the per rank stats are based on state
586  // transition and periodically updated, requiring re-sync at
587  // exit.
588  class RankDumpCallback : public Callback
589  {
591  public:
593  virtual void process() { ranks->computeStats(); };
594  };
595 
602  class BurstHelper {
603 
604  public:
605 
607  const unsigned int burstCount;
608 
610  unsigned int burstsServiced;
611 
612  BurstHelper(unsigned int _burstCount)
613  : burstCount(_burstCount), burstsServiced(0)
614  { }
615  };
616 
621  class DRAMPacket {
622 
623  public:
624 
627 
630 
632  const PacketPtr pkt;
633 
634  const bool isRead;
635 
637  const uint8_t rank;
638  const uint8_t bank;
639  const uint32_t row;
640 
646  const uint16_t bankId;
647 
655 
660  unsigned int size;
661 
669 
670  DRAMPacket(PacketPtr _pkt, bool is_read, uint8_t _rank, uint8_t _bank,
671  uint32_t _row, uint16_t bank_id, Addr _addr,
672  unsigned int _size, Bank& bank_ref, Rank& rank_ref)
674  pkt(_pkt), isRead(is_read), rank(_rank), bank(_bank), row(_row),
675  bankId(bank_id), addr(_addr), size(_size), burstHelper(NULL),
676  bankRef(bank_ref), rankRef(rank_ref)
677  { }
678 
679  };
680 
687  void processNextReqEvent();
689 
690  void processRespondEvent();
692 
699  bool readQueueFull(unsigned int pktCount) const;
700 
707  bool writeQueueFull(unsigned int pktCount) const;
708 
723  void addToReadQueue(PacketPtr pkt, unsigned int pktCount);
724 
736  void addToWriteQueue(PacketPtr pkt, unsigned int pktCount);
737 
748  void doDRAMAccess(DRAMPacket* dram_pkt);
749 
759  void accessAndRespond(PacketPtr pkt, Tick static_latency);
760 
773  DRAMPacket* decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned int size,
774  bool isRead);
775 
788  bool chooseNext(std::deque<DRAMPacket*>& queue, Tick extra_col_delay);
789 
799  bool reorderQueue(std::deque<DRAMPacket*>& queue, Tick extra_col_delay);
800 
812  Tick min_col_at) const;
813 
825  void activateBank(Rank& rank_ref, Bank& bank_ref, Tick act_tick,
826  uint32_t row);
827 
838  void prechargeBank(Rank& rank_ref, Bank& bank_ref,
839  Tick pre_at, bool trace = true);
840 
844  void printQs() const;
845 
853  Addr burstAlign(Addr addr) const { return (addr & ~(Addr(burstSize - 1))); }
854 
860 
868  std::unordered_set<Addr> isInWriteQueue;
869 
879 
884 
891  const uint32_t deviceSize;
892  const uint32_t deviceBusWidth;
893  const uint32_t burstLength;
894  const uint32_t deviceRowBufferSize;
895  const uint32_t devicesPerRank;
896  const uint32_t burstSize;
897  const uint32_t rowBufferSize;
898  const uint32_t columnsPerRowBuffer;
899  const uint32_t columnsPerStripe;
900  const uint32_t ranksPerChannel;
901  const uint32_t bankGroupsPerRank;
902  const bool bankGroupArch;
903  const uint32_t banksPerRank;
904  const uint32_t channels;
905  uint32_t rowsPerBank;
906  const uint32_t readBufferSize;
907  const uint32_t writeBufferSize;
908  const uint32_t writeHighThreshold;
909  const uint32_t writeLowThreshold;
910  const uint32_t minWritesPerSwitch;
911  uint32_t writesThisTime;
912  uint32_t readsThisTime;
913 
919  const Tick tWTR;
920  const Tick tRTW;
921  const Tick tCS;
922  const Tick tBURST;
923  const Tick tCCD_L;
924  const Tick tRCD;
925  const Tick tCL;
926  const Tick tRP;
927  const Tick tRAS;
928  const Tick tWR;
929  const Tick tRTP;
930  const Tick tRFC;
931  const Tick tREFI;
932  const Tick tRRD;
933  const Tick tRRD_L;
934  const Tick tXAW;
935  const Tick tXP;
936  const Tick tXS;
937  const uint32_t activationLimit;
938 
943  Enums::MemSched memSchedPolicy;
944  Enums::AddrMap addrMapping;
945  Enums::PageManage pageMgmt;
946 
951  const uint32_t maxAccessesPerRow;
952 
959 
966 
971 
973 
981 
982  // All statistics that the model needs to capture
1007 
1008  // Latencies summed over all requests
1012 
1013  // Average latencies per request
1017 
1018  // Average bandwidth
1027 
1028  // Average queue lengths
1031 
1032  // Row hit count and rate
1038 
1039  // DRAM Power Calculation
1041 
1042  // Holds the value of the rank of burst issued
1043  uint8_t activeRank;
1044 
1045  // timestamp offset
1047 
1052  std::unique_ptr<Packet> pendingDelete;
1053 
1063  void updatePowerStats(Rank& rank_ref);
1064 
1072  static bool sortTime(const Command& cmd, const Command& cmd_next) {
1073  return cmd.timeStamp < cmd_next.timeStamp;
1074  };
1075 
1076  public:
1077 
1078  void regStats() override;
1079 
1080  DRAMCtrl(const DRAMCtrlParams* p);
1081 
1082  DrainState drain() override;
1083 
1084  virtual BaseSlavePort& getSlavePort(const std::string& if_name,
1085  PortID idx = InvalidPortID) override;
1086 
1087  virtual void init() override;
1088  virtual void startup() override;
1089  virtual void drainResume() override;
1090 
1100  bool allRanksDrained() const;
1101 
1102  protected:
1103 
1104  Tick recvAtomic(PacketPtr pkt);
1105  void recvFunctional(PacketPtr pkt);
1106  bool recvTimingReq(PacketPtr pkt);
1107 
1108 };
1109 
1110 #endif //__MEM_DRAM_CTRL_HH__
Stats::Formula avgRdBW
Definition: dram_ctrl.hh:1019
Stats::Vector rdQLenPdf
Definition: dram_ctrl.hh:1002
Stats::Scalar bytesWritten
Definition: dram_ctrl.hh:989
bool retryWrReq
Definition: dram_ctrl.hh:140
Enums::PageManage pageMgmt
Definition: dram_ctrl.hh:945
const uint32_t writeLowThreshold
Definition: dram_ctrl.hh:909
Stats::Scalar totQLat
Definition: dram_ctrl.hh:1009
Stats::Scalar totMemAccLat
Definition: dram_ctrl.hh:1010
const uint32_t activationLimit
Definition: dram_ctrl.hh:937
uint32_t bytesAccessed
Definition: dram_ctrl.hh:196
PowerState
The power state captures the different operational states of the DRAM and interacts with the bus read...
Definition: dram_ctrl.hh:233
const Tick entryTime
When did request enter the controller.
Definition: dram_ctrl.hh:626
Stats::Scalar preBackEnergy
Definition: dram_ctrl.hh:337
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:1029
void printQs() const
Used for debugging to observe the contents of the queues.
Definition: dram_ctrl.cc:584
#define M5_CLASS_VAR_USED
Definition: compiler.hh:61
Generic callback class.
Definition: callback.hh:41
Stats::Scalar readRowHits
Definition: dram_ctrl.hh:1033
bool retryRdReq
Remember if we have to retry a request when available.
Definition: dram_ctrl.hh:139
const Tick tRCD
Definition: dram_ctrl.hh:924
const Tick tWR
Definition: dram_ctrl.hh:928
const PortID InvalidPortID
Definition: types.hh:182
std::vector< Command > cmdList
List of comamnds issued, to be sent to DRAMPpower at refresh and stats dump.
Definition: dram_ctrl.hh:437
Stats::Scalar numWrRetry
Definition: dram_ctrl.hh:998
std::vector< Rank * > ranks
Vector of ranks.
Definition: dram_ctrl.hh:883
STL pair class.
Definition: stl.hh:61
A stat that calculates the per tick average of a value.
Definition: statistics.hh:2485
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:1077
const Tick tRAS
Definition: dram_ctrl.hh:927
bool writeQueueFull(unsigned int pktCount) const
Check if the write queue has room for more entries.
Definition: dram_ctrl.cc:307
A DRAM packet stores packets along with the timestamp of when the packet entered the queue...
Definition: dram_ctrl.hh:621
uint32_t writeEntries
Track number of packets in write queue going to this rank.
Definition: dram_ctrl.hh:412
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:99
const Tick tRRD
Definition: dram_ctrl.hh:932
uint32_t openRow
Definition: dram_ctrl.hh:187
Stats::Formula avgGap
Definition: dram_ctrl.hh:1037
Stats::Scalar readReqs
Definition: dram_ctrl.hh:983
Stats::Histogram bytesPerActivate
Definition: dram_ctrl.hh:1004
Stats::Scalar bytesReadWrQ
Definition: dram_ctrl.hh:988
uint32_t readEntries
Track number of packets in read queue going to this rank.
Definition: dram_ctrl.hh:407
Stats::Histogram rdPerTurnAround
Definition: dram_ctrl.hh:1005
const Tick tWTR
Definition: dram_ctrl.hh:919
MemoryPort(const std::string &name, DRAMCtrl &_memory)
Definition: dram_ctrl.cc:2699
const Tick frontendLatency
Pipeline latency of the controller frontend.
Definition: dram_ctrl.hh:958
Stats::Formula pageHitRate
Definition: dram_ctrl.hh:1040
ip6_addr_t addr
Definition: inet.hh:335
Stats::Scalar writeEnergy
Definition: dram_ctrl.hh:326
const Tick tXP
Definition: dram_ctrl.hh:935
Stats::Scalar totGap
Definition: dram_ctrl.hh:999
Stats::Average avgWrQLen
Definition: dram_ctrl.hh:1030
const uint32_t channels
Definition: dram_ctrl.hh:904
bool recvTimingReq(PacketPtr pkt)
Definition: dram_ctrl.cc:600
DRAMCtrl(const DRAMCtrlParams *p)
Definition: dram_ctrl.cc:60
DrainState drain() override
Notify an object that it needs to drain its state.
Definition: dram_ctrl.cc:2634
uint32_t rowAccesses
Definition: dram_ctrl.hh:195
std::deque< DRAMPacket * > respQueue
Response queue where read packets wait after we're done working with them, but it's not time to send ...
Definition: dram_ctrl.hh:878
const Tick tCL
Definition: dram_ctrl.hh:925
unsigned int burstsServiced
Number of DRAM bursts serviced so far for a system packet.
Definition: dram_ctrl.hh:610
RefreshState refreshState
current refresh state
Definition: dram_ctrl.hh:392
Addr addr
The starting address of the DRAM packet.
Definition: dram_ctrl.hh:654
A vector of scalar stats.
Definition: statistics.hh:2499
uint8_t bank
Definition: dram_ctrl.hh:188
Tick refreshDueAt
Keep track of when a refresh is due.
Definition: dram_ctrl.hh:318
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
Definition: qport.hh:59
Stats::Formula busUtilWrite
Definition: dram_ctrl.hh:1026
Stats::Scalar selfRefreshEnergy
Definition: dram_ctrl.hh:352
The DRAM controller is a single-channel memory controller capturing the most important timing constra...
Definition: dram_ctrl.hh:96
Stats::Scalar preEnergy
Definition: dram_ctrl.hh:324
uint8_t rank
Current Rank index.
Definition: dram_ctrl.hh:402
Stats::Scalar mergedWrBursts
Definition: dram_ctrl.hh:993
Stats::Average avgRdQLen
Definition: dram_ctrl.hh:1029
const uint32_t burstLength
Definition: dram_ctrl.hh:893
Stats::Scalar writeBursts
Definition: dram_ctrl.hh:986
const uint32_t ranksPerChannel
Definition: dram_ctrl.hh:900
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
Definition: port.hh:139
Declaration of Statistics objects.
Stats::Vector perBankRdBursts
Definition: dram_ctrl.hh:995
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2475
const uint32_t deviceRowBufferSize
Definition: dram_ctrl.hh:894
A burst helper helps organize and manage a packet that is larger than the DRAM burst size...
Definition: dram_ctrl.hh:602
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:646
void computeStats()
Computes stats just prior to dump event.
Definition: dram_ctrl.cc:2270
virtual void init() override
Initialise this memory.
Definition: dram_ctrl.cc:200
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:419
void startup(Tick ref_tick)
Kick off accounting for power and refresh states and schedule initial refresh.
Definition: dram_ctrl.cc:1641
virtual BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a slave port with a given name and index.
Definition: dram_ctrl.cc:2624
unsigned int numBanksActive
To track number of banks which are currently active for this rank.
Definition: dram_ctrl.hh:449
Stats::Vector writePktSize
Definition: dram_ctrl.hh:1001
Stats::Scalar totalIdleTime
Stat to track total DRAM idle time.
Definition: dram_ctrl.hh:361
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the master port.
Definition: dram_ctrl.cc:2713
bool isTimingMode
Remeber if the memory system is in timing mode.
Definition: dram_ctrl.hh:134
void processWriteDoneEvent()
Definition: dram_ctrl.cc:1766
Stats::Scalar actPowerDownEnergy
Definition: dram_ctrl.hh:342
Stats::Formula peakBW
Definition: dram_ctrl.hh:1023
A basic class to track the bank state, i.e.
Definition: dram_ctrl.hh:180
AbstractMemory declaration.
Stats::Histogram wrPerTurnAround
Definition: dram_ctrl.hh:1006
Declaration of the queued port.
Stats::Scalar totBusLat
Definition: dram_ctrl.hh:1011
const uint32_t maxAccessesPerRow
Max column accesses (read and write) per row, before forefully closing it.
Definition: dram_ctrl.hh:951
const uint32_t bankGroupsPerRank
Definition: dram_ctrl.hh:901
const Tick tREFI
Definition: dram_ctrl.hh:931
Tick curTick()
The current simulated tick.
Definition: core.hh:47
Addr burstAlign(Addr addr) const
Burst-align an address.
Definition: dram_ctrl.hh:853
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the master port.
Definition: dram_ctrl.cc:2728
EventWrapper< DRAMCtrl,&DRAMCtrl::processNextReqEvent > nextReqEvent
Definition: dram_ctrl.hh:688
Stats::Formula avgRdBWSys
Definition: dram_ctrl.hh:1021
Enums::MemSched memSchedPolicy
Memory controller configuration initialized based on parameter values.
Definition: dram_ctrl.hh:943
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
const Tick backendLatency
Pipeline latency of the backend and PHY.
Definition: dram_ctrl.hh:965
Rank(DRAMCtrl &_memory, const DRAMCtrlParams *_p)
Definition: dram_ctrl.cc:1629
void processPowerEvent()
Definition: dram_ctrl.cc:2121
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:666
const Tick tRP
Definition: dram_ctrl.hh:926
std::vector< Bank > banks
Vector of Banks.
Definition: dram_ctrl.hh:443
Stats::Formula avgQLat
Definition: dram_ctrl.hh:1014
uint64_t Tick
Tick count type.
Definition: types.hh:63
PowerState pwrState
Current power state.
Definition: dram_ctrl.hh:387
void checkDrainDone()
Let the rank check if it was waiting for requests to drain to allow it to transition states...
Definition: dram_ctrl.cc:1683
void regStats() override
Register Statistics.
Definition: dram_ctrl.cc:2358
BurstHelper(unsigned int _burstCount)
Definition: dram_ctrl.hh:612
const Tick tRFC
Definition: dram_ctrl.hh:930
std::deque< Tick > actTicks
List to keep track of activate ticks.
Definition: dram_ctrl.hh:452
bool chooseNext(std::deque< DRAMPacket * > &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:755
Stats::Formula busUtil
Definition: dram_ctrl.hh:1024
uint64_t timeStampOffset
Definition: dram_ctrl.hh:1046
A simple histogram stat.
Definition: statistics.hh:2551
uint32_t writesThisTime
Definition: dram_ctrl.hh:911
Stats::Vector readPktSize
Definition: dram_ctrl.hh:1000
Stats::Scalar readBursts
Definition: dram_ctrl.hh:985
Tick recvAtomic(PacketPtr pkt)
Definition: dram_ctrl.cc:276
const Tick tRTP
Definition: dram_ctrl.hh:929
Stats::Formula avgMemAccLat
Definition: dram_ctrl.hh:1016
Stats::Scalar bytesReadDRAM
Definition: dram_ctrl.hh:987
DRAMPower declaration.
Tick pwrStateTick
Track when we transitioned to the current power state.
Definition: dram_ctrl.hh:313
static bool sortTime(const Command &cmd, const Command &cmd_next)
Function for sorting Command structures based on timeStamp.
Definition: dram_ctrl.hh:1072
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
std::pair< uint64_t, bool > minBankPrep(const std::deque< DRAMPacket * > &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:1547
Stats::Formula readRowHitRate
Definition: dram_ctrl.hh:1035
uint8_t bankgr
Definition: dram_ctrl.hh:189
DRAMCtrl & memory
A reference to the parent DRAMCtrl instance.
Definition: dram_ctrl.hh:297
bool reorderQueue(std::deque< DRAMPacket * > &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:796
const uint8_t rank
Will be populated by address decoder.
Definition: dram_ctrl.hh:637
Stats::Formula avgWrBWSys
Definition: dram_ctrl.hh:1022
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:929
PowerState pwrStatePostRefresh
Previous low-power state, which will be re-entered after refresh.
Definition: dram_ctrl.hh:308
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
RespPacketQueue queue
Definition: dram_ctrl.hh:106
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
const Tick tCS
Definition: dram_ctrl.hh:921
const Tick M5_CLASS_VAR_USED tCK
Basic memory timing parameters initialized based on parameter values.
Definition: dram_ctrl.hh:918
uint64_t size() const
Get the memory size.
EventWrapper< Rank,&Rank::processRefreshEvent > refreshEvent
Definition: dram_ctrl.hh:572
Stats::Scalar servicedByWrQ
Definition: dram_ctrl.hh:992
void processRefreshEvent()
Definition: dram_ctrl.cc:1777
Tick prevArrival
Definition: dram_ctrl.hh:972
const Tick tXAW
Definition: dram_ctrl.hh:934
Stats::Formula avgBusLat
Definition: dram_ctrl.hh:1015
const std::string name() const
Definition: dram_ctrl.hh:456
DRAMPacket * decodeAddr(PacketPtr pkt, Addr dramPktAddr, unsigned int size, bool isRead)
Address decoder to figure out physical mapping onto ranks, banks, and rows.
Definition: dram_ctrl.cc:315
const uint32_t row
Definition: dram_ctrl.hh:639
const unsigned int burstCount
Number of DRAM bursts requred for a system packet.
Definition: dram_ctrl.hh:607
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:1052
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:517
static const uint32_t NO_ROW
Definition: dram_ctrl.hh:185
const uint32_t rowBufferSize
Definition: dram_ctrl.hh:897
const uint32_t devicesPerRank
Definition: dram_ctrl.hh:895
uint32_t rowsPerBank
Definition: dram_ctrl.hh:905
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:303
const uint32_t minWritesPerSwitch
Definition: dram_ctrl.hh:910
void suspend()
Stop the refresh events.
Definition: dram_ctrl.cc:1653
Stats::Scalar refreshEnergy
Definition: dram_ctrl.hh:327
A formula for statistics that is calculated when printed.
Definition: statistics.hh:2895
Stats::Scalar writeReqs
Definition: dram_ctrl.hh:984
void schedulePowerEvent(PowerState pwr_state, Tick tick)
Schedule a power state transition in the future, and potentially override an already scheduled transi...
Definition: dram_ctrl.cc:1977
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:892
const uint32_t deviceBusWidth
Definition: dram_ctrl.hh:892
const Tick tXS
Definition: dram_ctrl.hh:936
void updatePowerStats()
Function to update Power Stats.
Definition: dram_ctrl.cc:2230
const uint32_t writeHighThreshold
Definition: dram_ctrl.hh:908
EventWrapper< Rank,&Rank::processActivateEvent > activateEvent
Definition: dram_ctrl.hh:564
Enums::AddrMap addrMapping
Definition: dram_ctrl.hh:944
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:980
EventWrapper< DRAMCtrl,&DRAMCtrl::processRespondEvent > respondEvent
Definition: dram_ctrl.hh:691
void processPrechargeEvent()
Definition: dram_ctrl.cc:1736
EventWrapper< Rank,&Rank::processWakeUpEvent > wakeUpEvent
Definition: dram_ctrl.hh:580
virtual const std::string name() const
Definition: sim_object.hh:117
Stats::Vector wrQLenPdf
Definition: dram_ctrl.hh:1003
void powerDownSleep(PowerState pwr_state, Tick tick)
Schedule a transition to power-down (sleep)
Definition: dram_ctrl.cc:1998
std::deque< DRAMPacket * > writeQueue
Definition: dram_ctrl.hh:859
bool lowPowerEntryReady() const
Check if the current rank is idle and should enter a low-pwer state.
Definition: dram_ctrl.cc:1665
RefreshState
The refresh state is used to control the progress of the refresh scheduling.
Definition: dram_ctrl.hh:272
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:670
const Tick tRTW
Definition: dram_ctrl.hh:920
bool readQueueFull(unsigned int pktCount) const
Check if the read queue has room for more entries.
Definition: dram_ctrl.cc:296
void processActivateEvent()
Definition: dram_ctrl.cc:1726
DRAMPower power
One DRAMPower instance per rank.
Definition: dram_ctrl.hh:429
Stats::Scalar averagePower
Definition: dram_ctrl.hh:355
const Tick tCCD_L
Definition: dram_ctrl.hh:923
Tick wakeUpAllowedAt
delay power-down and self-refresh exit until this requirement is met
Definition: dram_ctrl.hh:424
Stats::Scalar actBackEnergy
Definition: dram_ctrl.hh:332
Stats::Vector pwrStateTime
Track time spent in each power state.
Definition: dram_ctrl.hh:366
void processNextReqEvent()
Bunch of things requires to setup "events" in gem5 When event "respondEvent" occurs for example...
Definition: dram_ctrl.cc:1290
BusState busStateNext
Definition: dram_ctrl.hh:154
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:868
const uint32_t columnsPerRowBuffer
Definition: dram_ctrl.hh:898
void recvFunctional(PacketPtr pkt)
Definition: dram_ctrl.cc:2617
Stats::Scalar actEnergy
Definition: dram_ctrl.hh:323
uint32_t readsThisTime
Definition: dram_ctrl.hh:912
EventWrapper< Rank,&Rank::processPowerEvent > powerEvent
Definition: dram_ctrl.hh:576
BusState busState
Definition: dram_ctrl.hh:151
An abstract memory represents a contiguous block of physical memory, with an associated address range...
Simple structure to hold the values needed to keep track of commands for DRAMPower.
Definition: dram_ctrl.hh:160
Stats::Formula avgWrBW
Definition: dram_ctrl.hh:1020
BusState
Bus state used to control the read/write switching and drive the scheduling of the next request...
Definition: dram_ctrl.hh:146
Stats::Scalar bytesReadSys
Definition: dram_ctrl.hh:990
void processWakeUpEvent()
Definition: dram_ctrl.cc:2103
const uint32_t deviceSize
The following are basic design parameters of the memory controller, and are initialized based on para...
Definition: dram_ctrl.hh:891
Stats::Scalar numRdRetry
Definition: dram_ctrl.hh:997
uint8_t activeRank
Definition: dram_ctrl.hh:1043
Stats::Formula busUtilRead
Definition: dram_ctrl.hh:1025
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:181
std::deque< DRAMPacket * > readQueue
The controller's main read and write queues.
Definition: dram_ctrl.hh:858
Tick readyTime
When will request leave the controller.
Definition: dram_ctrl.hh:629
const uint32_t columnsPerStripe
Definition: dram_ctrl.hh:899
bool isAvailable() const
Check if the current rank is available for scheduling.
Definition: dram_ctrl.hh:483
const uint8_t bank
Definition: dram_ctrl.hh:638
Data::MemCommand::cmds type
Definition: dram_ctrl.hh:161
Stats::Scalar prePowerDownEnergy
Definition: dram_ctrl.hh:347
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
Definition: dram_ctrl.cc:2705
bool allRanksDrained() const
Return true once refresh is complete for all ranks and there are no additional commands enqueued...
Definition: dram_ctrl.cc:2668
void processRespondEvent()
Definition: dram_ctrl.cc:661
const uint32_t writeBufferSize
Definition: dram_ctrl.hh:907
const uint32_t burstSize
Definition: dram_ctrl.hh:896
const uint32_t banksPerRank
Definition: dram_ctrl.hh:903
Stats::Scalar totalEnergy
Definition: dram_ctrl.hh:354
const uint32_t readBufferSize
Definition: dram_ctrl.hh:906
DRAMPower is a standalone tool which calculates the power consumed by a DRAM in the system...
Definition: drampower.hh:55
Stats::Formula writeRowHitRate
Definition: dram_ctrl.hh:1036
Bitfield< 0 > p
const Tick tRRD_L
Definition: dram_ctrl.hh:933
virtual void drainResume() override
Resume execution after a successful drain.
Definition: dram_ctrl.cc:2681
Stats::Scalar bytesWrittenSys
Definition: dram_ctrl.hh:991
Stats::Vector perBankWrBursts
Definition: dram_ctrl.hh:996
virtual void startup() override
startup() is the final initialization call before simulation.
Definition: dram_ctrl.cc:252
Tick busBusyUntil
Till when has the main data bus been spoken for already?
Definition: dram_ctrl.hh:970
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:421
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:660
bool recvTimingReq(PacketPtr)
Receive a timing request from the master port.
Definition: dram_ctrl.cc:2734
const bool bankGroupArch
Definition: dram_ctrl.hh:902
Stats::Scalar readEnergy
Definition: dram_ctrl.hh:325
EventWrapper< Rank,&Rank::processPrechargeEvent > prechargeEvent
Definition: dram_ctrl.hh:568
const PacketPtr pkt
This comes from the outside world.
Definition: dram_ctrl.hh:632
void scheduleWakeUpEvent(Tick exit_delay)
schedule and event to wake-up from power-down or self-refresh and update bank timing parameters ...
Definition: dram_ctrl.cc:2052
Stats::Scalar writeRowHits
Definition: dram_ctrl.hh:1034
constexpr Command(Data::MemCommand::cmds _type, uint8_t _bank, Tick time_stamp)
Definition: dram_ctrl.hh:165
Rank class includes a vector of banks.
Definition: dram_ctrl.hh:289
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
bool inLowPowerState
rank is in or transitioning to power-down or self-refresh
Definition: dram_ctrl.hh:397
EventWrapper< Rank,&Rank::processWriteDoneEvent > writeDoneEvent
Definition: dram_ctrl.hh:560
MemoryPort port
Our incoming port, for a multi-ported controller add a crossbar in front of it.
Definition: dram_ctrl.hh:129
void flushCmdList()
Push command out of cmdList queue that are scheduled at or before curTick() to DRAMPower library All ...
Definition: dram_ctrl.cc:1698
virtual void process()
virtual process function that is invoked when the callback queue is executed.
Definition: dram_ctrl.hh:593
const Tick tBURST
Definition: dram_ctrl.hh:922
Stats::Scalar neitherReadNorWrite
Definition: dram_ctrl.hh:994

Generated on Fri Jun 9 2017 13:03:49 for gem5 by doxygen 1.8.6