gem5  v20.1.0.0
mem_ctrl.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020 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 
46 #ifndef __MEM_CTRL_HH__
47 #define __MEM_CTRL_HH__
48 
49 #include <deque>
50 #include <string>
51 #include <unordered_set>
52 #include <utility>
53 #include <vector>
54 
55 #include "base/callback.hh"
56 #include "base/statistics.hh"
57 #include "enums/MemSched.hh"
58 #include "mem/qos/mem_ctrl.hh"
59 #include "mem/qport.hh"
60 #include "params/MemCtrl.hh"
61 #include "sim/eventq.hh"
62 
63 class DRAMInterface;
64 class NVMInterface;
65 
73 {
74  public:
75 
77  const unsigned int burstCount;
78 
80  unsigned int burstsServiced;
81 
82  BurstHelper(unsigned int _burstCount)
83  : burstCount(_burstCount), burstsServiced(0)
84  { }
85 };
86 
91 class MemPacket
92 {
93  public:
94 
96  const Tick entryTime;
97 
100 
102  const PacketPtr pkt;
103 
106 
107  const bool read;
108 
110  const bool dram;
111 
113  const uint8_t rank;
114  const uint8_t bank;
115  const uint32_t row;
116 
122  const uint16_t bankId;
123 
131 
136  unsigned int size;
137 
143 
147  uint8_t _qosValue;
148 
153  inline void qosValue(const uint8_t qv) { _qosValue = qv; }
154 
159  inline uint8_t qosValue() const { return _qosValue; }
160 
165  inline RequestorID requestorId() const { return _requestorId; }
166 
171  inline unsigned int getSize() const { return size; }
172 
177  inline Addr getAddr() const { return addr; }
178 
183  inline bool isRead() const { return read; }
184 
189  inline bool isWrite() const { return !read; }
190 
194  inline bool isDram() const { return dram; }
195 
196  MemPacket(PacketPtr _pkt, bool is_read, bool is_dram, uint8_t _rank,
197  uint8_t _bank, uint32_t _row, uint16_t bank_id, Addr _addr,
198  unsigned int _size)
199  : entryTime(curTick()), readyTime(curTick()), pkt(_pkt),
201  read(is_read), dram(is_dram), rank(_rank), bank(_bank), row(_row),
202  bankId(bank_id), addr(_addr), size(_size), burstHelper(NULL),
203  _qosValue(_pkt->qosValue())
204  { }
205 
206 };
207 
208 // The memory packets are store in a multiple dequeue structure,
209 // based on their QoS priority
211 
212 
236 class MemCtrl : public QoS::MemCtrl
237 {
238  private:
239 
240  // For now, make use of a queued response port to avoid dealing with
241  // flow control for the responses being sent back
243  {
244 
247 
248  public:
249 
250  MemoryPort(const std::string& name, MemCtrl& _ctrl);
251 
252  protected:
253 
255 
256  void recvFunctional(PacketPtr pkt);
257 
258  bool recvTimingReq(PacketPtr);
259 
260  virtual AddrRangeList getAddrRanges() const;
261 
262  };
263 
269 
274 
280 
287  void processNextReqEvent();
289 
290  void processRespondEvent();
292 
299  bool readQueueFull(unsigned int pkt_count) const;
300 
307  bool writeQueueFull(unsigned int pkt_count) const;
308 
324  void addToReadQueue(PacketPtr pkt, unsigned int pkt_count, bool is_dram);
325 
338  void addToWriteQueue(PacketPtr pkt, unsigned int pkt_count, bool is_dram);
339 
346  void doBurstAccess(MemPacket* mem_pkt);
347 
357  void accessAndRespond(PacketPtr pkt, Tick static_latency);
358 
364  bool packetReady(MemPacket* pkt);
365 
372 
379 
391  MemPacketQueue::iterator chooseNext(MemPacketQueue& queue,
392  Tick extra_col_delay);
393 
402  MemPacketQueue::iterator chooseNextFRFCFS(MemPacketQueue& queue,
403  Tick extra_col_delay);
404 
411  Tick getBurstWindow(Tick cmd_tick);
412 
416  void printQs() const;
417 
426  Addr burstAlign(Addr addr, bool is_dram) const;
427 
434 
442  std::unordered_set<Addr> isInWriteQueue;
443 
453 
459  std::unordered_multiset<Tick> burstTicks;
460 
465 
470 
477  const uint32_t readBufferSize;
478  const uint32_t writeBufferSize;
479  const uint32_t writeHighThreshold;
480  const uint32_t writeLowThreshold;
481  const uint32_t minWritesPerSwitch;
482  uint32_t writesThisTime;
483  uint32_t readsThisTime;
484 
489  Enums::MemSched memSchedPolicy;
490 
497 
504 
510 
515 
517 
525 
526  struct CtrlStats : public Stats::Group
527  {
529 
530  void regStats() override;
531 
533 
534  // All statistics that the model needs to capture
542  // Average queue lengths
545 
554 
558  // Average bandwidth
561 
564 
565  // per-requestor bytes read and written to memory
568 
569  // per-requestor bytes read and written to memory rate
572 
573  // per-requestor read and write serviced memory accesses
576 
577  // per-requestor read and write total memory access latency
580 
581  // per-requestor raed and write average memory access latency
584  };
585 
587 
592  std::unique_ptr<Packet> pendingDelete;
593 
601  {
602  return (is_read ? readQueue : writeQueue);
603  };
604 
608  void pruneBurstTick();
609 
610  public:
611 
612  MemCtrl(const MemCtrlParams* p);
613 
619  bool allIntfDrained() const;
620 
621  DrainState drain() override;
622 
636  Tick verifySingleCmd(Tick cmd_tick, Tick max_cmds_per_burst);
637 
652  Tick verifyMultiCmd(Tick cmd_tick, Tick max_cmds_per_burst,
653  Tick max_multi_cmd_split = 0);
654 
660  bool respondEventScheduled() const { return respondEvent.scheduled(); }
661 
667  bool requestEventScheduled() const { return nextReqEvent.scheduled(); }
668 
677 
684  bool inReadBusState(bool next_state) const;
685 
692  bool inWriteBusState(bool next_state) const;
693 
694  Port &getPort(const std::string &if_name,
695  PortID idx=InvalidPortID) override;
696 
697  virtual void init() override;
698  virtual void startup() override;
699  virtual void drainResume() override;
700 
701  protected:
702 
704  void recvFunctional(PacketPtr pkt);
705  bool recvTimingReq(PacketPtr pkt);
706 
707 };
708 
709 #endif //__MEM_CTRL_HH__
BurstHelper::burstCount
const unsigned int burstCount
Number of bursts requred for a system packet.
Definition: mem_ctrl.hh:77
MemPacket::rank
const uint8_t rank
Will be populated by address decoder.
Definition: mem_ctrl.hh:113
MemCtrl::CtrlStats::requestorReadAvgLat
Stats::Formula requestorReadAvgLat
Definition: mem_ctrl.hh:582
BurstHelper::burstsServiced
unsigned int burstsServiced
Number of bursts serviced so far for a system packet.
Definition: mem_ctrl.hh:80
MemPacket::requestorId
RequestorID requestorId() const
Get the packet RequestorID (interface compatibility with Packet)
Definition: mem_ctrl.hh:165
MemCtrl::processNextReqEvent
void processNextReqEvent()
Bunch of things requires to setup "events" in gem5 When event "respondEvent" occurs for example,...
Definition: mem_ctrl.cc:857
Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:460
MemCtrl::nextReqEvent
EventFunctionWrapper nextReqEvent
Definition: mem_ctrl.hh:288
MemCtrl::CtrlStats::avgRdQLen
Stats::Average avgRdQLen
Definition: mem_ctrl.hh:543
MemPacket::burstHelper
BurstHelper * burstHelper
A pointer to the BurstHelper if this MemPacket is a split packet If not a split packet (common case),...
Definition: mem_ctrl.hh:142
QoS::MemCtrl
The QoS::MemCtrl is a base class for Memory objects which support QoS - it provides access to a set o...
Definition: mem_ctrl.hh:59
MemCtrl::CtrlStats::writePktSize
Stats::Vector writePktSize
Definition: mem_ctrl.hh:549
MemCtrl::MemoryPort::ctrl
MemCtrl & ctrl
Definition: mem_ctrl.hh:246
MemCtrl::startup
virtual void startup() override
startup() is the final initialization call before simulation.
Definition: mem_ctrl.cc:107
MemCtrl::writeQueueFull
bool writeQueueFull(unsigned int pkt_count) const
Check if the write queue has room for more entries.
Definition: mem_ctrl.cc:170
MemCtrl::CtrlStats::writeReqs
Stats::Scalar writeReqs
Definition: mem_ctrl.hh:536
MemCtrl::CtrlStats::avgRdBWSys
Stats::Formula avgRdBWSys
Definition: mem_ctrl.hh:559
MemCtrl::writeLowThreshold
const uint32_t writeLowThreshold
Definition: mem_ctrl.hh:480
MemPacket::isDram
bool isDram() const
Return true if its a DRAM access.
Definition: mem_ctrl.hh:194
MemPacket::MemPacket
MemPacket(PacketPtr _pkt, bool is_read, bool is_dram, uint8_t _rank, uint8_t _bank, uint32_t _row, uint16_t bank_id, Addr _addr, unsigned int _size)
Definition: mem_ctrl.hh:196
MemCtrl::CtrlStats::requestorWriteBytes
Stats::Vector requestorWriteBytes
Definition: mem_ctrl.hh:567
QoS::MemCtrl::schedule
uint8_t schedule(RequestorID id, uint64_t data)
Definition: mem_ctrl.cc:207
MemPacket::readyTime
Tick readyTime
When will request leave the controller.
Definition: mem_ctrl.hh:99
InvalidPortID
const PortID InvalidPortID
Definition: types.hh:238
MemCtrl::CtrlStats::bytesReadSys
Stats::Scalar bytesReadSys
Definition: mem_ctrl.hh:556
MemCtrl::restartScheduler
void restartScheduler(Tick tick)
restart the controller This can be used by interfaces to restart the scheduler after maintainence com...
Definition: mem_ctrl.hh:676
MemCtrl::CtrlStats::requestorReadAccesses
Stats::Vector requestorReadAccesses
Definition: mem_ctrl.hh:574
MemCtrl::doBurstAccess
void doBurstAccess(MemPacket *mem_pkt)
Actually do the burst based on media specific access function.
Definition: mem_ctrl.cc:800
MemCtrl::CtrlStats::writeBursts
Stats::Scalar writeBursts
Definition: mem_ctrl.hh:538
MemCtrl::CtrlStats::avgGap
Stats::Formula avgGap
Definition: mem_ctrl.hh:563
MemCtrl::writeQueue
std::vector< MemPacketQueue > writeQueue
Definition: mem_ctrl.hh:433
MemCtrl::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: mem_ctrl.cc:1357
MemCtrl::drain
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Definition: mem_ctrl.cc:1378
DRAMInterface
Interface to DRAM devices with media specific parameters, statistics, and functions.
Definition: mem_interface.hh:301
Clocked::tick
Tick tick
Definition: clocked_object.hh:65
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
MemCtrl::CtrlStats::avgWrBWSys
Stats::Formula avgWrBWSys
Definition: mem_ctrl.hh:560
MemCtrl::CtrlStats::numRdRetry
Stats::Scalar numRdRetry
Definition: mem_ctrl.hh:546
PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
std::vector
STL vector class.
Definition: stl.hh:37
MemCtrl::isInWriteQueue
std::unordered_set< Addr > isInWriteQueue
To avoid iterating over the write queue to check for overlapping transactions, maintain a set of burs...
Definition: mem_ctrl.hh:442
MemPacket::getSize
unsigned int getSize() const
Get the packet size (interface compatibility with Packet)
Definition: mem_ctrl.hh:171
MemCtrl::drainResume
virtual void drainResume() override
Resume execution after a successful drain.
Definition: mem_ctrl.cc:1405
MemCtrl::burstAlign
Addr burstAlign(Addr addr, bool is_dram) const
Burst-align an address.
Definition: mem_ctrl.cc:1166
MemCtrl::CtrlStats::servicedByWrQ
Stats::Scalar servicedByWrQ
Definition: mem_ctrl.hh:539
MemCtrl::CtrlStats::readPktSize
Stats::Vector readPktSize
Definition: mem_ctrl.hh:548
Stats::Vector
A vector of scalar stats.
Definition: statistics.hh:2575
MemPacket::isWrite
bool isWrite() const
Return true if its a write packet (interface compatibility with Packet)
Definition: mem_ctrl.hh:189
MemCtrl::CtrlStats::regStats
void regStats() override
Callback to set stat parameters.
Definition: mem_ctrl.cc:1246
MemCtrl::readBufferSize
const uint32_t readBufferSize
The following are basic design parameters of the memory controller, and are initialized based on para...
Definition: mem_ctrl.hh:477
MemCtrl::selQueue
std::vector< MemPacketQueue > & selQueue(bool is_read)
Select either the read or write queue.
Definition: mem_ctrl.hh:600
EventFunctionWrapper
Definition: eventq.hh:1101
MemPacket::entryTime
const Tick entryTime
When did request enter the controller.
Definition: mem_ctrl.hh:96
MemCtrl::retryWrReq
bool retryWrReq
Definition: mem_ctrl.hh:279
Stats::Histogram
A simple histogram stat.
Definition: statistics.hh:2654
MemCtrl::allIntfDrained
bool allIntfDrained() const
Ensure that all interfaced have drained commands.
Definition: mem_ctrl.cc:1367
MemPacket::getAddr
Addr getAddr() const
Get the packet address (interface compatibility with Packet)
Definition: mem_ctrl.hh:177
MemCtrl::MemoryPort
Definition: mem_ctrl.hh:242
MemCtrl::CtrlStats::wrQLenPdf
Stats::Vector wrQLenPdf
Definition: mem_ctrl.hh:551
MemCtrl::CtrlStats::requestorWriteAccesses
Stats::Vector requestorWriteAccesses
Definition: mem_ctrl.hh:575
MemCtrl::readsThisTime
uint32_t readsThisTime
Definition: mem_ctrl.hh:483
DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:71
Stats::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2533
MemCtrl::writesThisTime
uint32_t writesThisTime
Definition: mem_ctrl.hh:482
MemCtrl::CtrlStats::rdQLenPdf
Stats::Vector rdQLenPdf
Definition: mem_ctrl.hh:550
MemPacketQueue
std::deque< MemPacket * > MemPacketQueue
Definition: mem_ctrl.hh:210
RequestorID
uint16_t RequestorID
Definition: request.hh:85
MemCtrl::prevArrival
Tick prevArrival
Definition: mem_ctrl.hh:516
MemCtrl::MemoryPort::recvFunctional
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
Definition: mem_ctrl.cc:1444
MemCtrl::CtrlStats::bytesWrittenSys
Stats::Scalar bytesWrittenSys
Definition: mem_ctrl.hh:557
MemCtrl::CtrlStats::mergedWrBursts
Stats::Scalar mergedWrBursts
Definition: mem_ctrl.hh:540
MemPacket::read
const bool read
Definition: mem_ctrl.hh:107
NVMInterface
Interface to NVM devices with media specific parameters, statistics, and functions.
Definition: mem_interface.hh:1021
MemCtrl::minReadToWriteDataGap
Tick minReadToWriteDataGap()
Calculate the minimum delay used when scheduling a read-to-write transision.
Definition: mem_ctrl.cc:1150
MemCtrl::CtrlStats
Definition: mem_ctrl.hh:526
MemCtrl::CtrlStats::requestorReadTotalLat
Stats::Vector requestorReadTotalLat
Definition: mem_ctrl.hh:578
MemCtrl::CtrlStats::ctrl
MemCtrl & ctrl
Definition: mem_ctrl.hh:532
MemCtrl::minWriteToReadDataGap
Tick minWriteToReadDataGap()
Calculate the minimum delay used when scheduling a write-to-read transision.
Definition: mem_ctrl.cc:1158
MemCtrl::CtrlStats::requestorReadRate
Stats::Formula requestorReadRate
Definition: mem_ctrl.hh:570
MemCtrl::frontendLatency
const Tick frontendLatency
Pipeline latency of the controller frontend.
Definition: mem_ctrl.hh:496
MemCtrl::inWriteBusState
bool inWriteBusState(bool next_state) const
Check the current direction of the memory channel.
Definition: mem_ctrl.cc:787
MemCtrl::respondEvent
EventFunctionWrapper respondEvent
Definition: mem_ctrl.hh:291
MemCtrl::stats
CtrlStats stats
Definition: mem_ctrl.hh:586
MemPacket::row
const uint32_t row
Definition: mem_ctrl.hh:115
statistics.hh
MemCtrl::memSchedPolicy
Enums::MemSched memSchedPolicy
Memory controller configuration initialized based on parameter values.
Definition: mem_ctrl.hh:489
MemCtrl::nextBurstAt
Tick nextBurstAt
Till when must we wait before issuing next RD/WR burst?
Definition: mem_ctrl.hh:514
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
MemCtrl::CtrlStats::readReqs
Stats::Scalar readReqs
Definition: mem_ctrl.hh:535
MemCtrl::pruneBurstTick
void pruneBurstTick()
Remove commands that have already issued from burstTicks.
Definition: mem_ctrl.cc:666
MemPacket::size
unsigned int size
The size of this dram packet in bytes It is always equal or smaller than the burst size.
Definition: mem_ctrl.hh:136
MemPacket::bank
const uint8_t bank
Definition: mem_ctrl.hh:114
MemCtrl::CtrlStats::rdPerTurnAround
Stats::Histogram rdPerTurnAround
Definition: mem_ctrl.hh:552
MemCtrl::MemoryPort::queue
RespPacketQueue queue
Definition: mem_ctrl.hh:245
MemCtrl::MemoryPort::getAddrRanges
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
Definition: mem_ctrl.cc:1429
MemCtrl::CtrlStats::avgWrQLen
Stats::Average avgWrQLen
Definition: mem_ctrl.hh:544
MemCtrl::printQs
void printQs() const
Used for debugging to observe the contents of the queues.
Definition: mem_ctrl.cc:381
MemCtrl::dram
DRAMInterface *const dram
Create pointer to interface of the actual dram media when connected.
Definition: mem_ctrl.hh:464
MemCtrl::processRespondEvent
void processRespondEvent()
Definition: mem_ctrl.cc:483
MemPacket
A memory packet stores packets along with the timestamp of when the packet entered the queue,...
Definition: mem_ctrl.hh:91
QueuedResponsePort
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
Definition: qport.hh:58
MemCtrl::MemoryPort::recvTimingReq
bool recvTimingReq(PacketPtr)
Receive a timing request from the peer.
Definition: mem_ctrl.cc:1465
MemCtrl::writeHighThreshold
const uint32_t writeHighThreshold
Definition: mem_ctrl.hh:479
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Port::name
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:106
MemCtrl::nvm
NVMInterface *const nvm
Create pointer to interface of the actual nvm media when connected.
Definition: mem_ctrl.hh:469
RespPacketQueue
Definition: packet_queue.hh:296
MemCtrl::respondEventScheduled
bool respondEventScheduled() const
Is there a respondEvent scheduled?
Definition: mem_ctrl.hh:660
MemCtrl::packetReady
bool packetReady(MemPacket *pkt)
Determine if there is a packet that can issue.
Definition: mem_ctrl.cc:1143
MemCtrl::init
virtual void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: mem_ctrl.cc:97
MemCtrl::retryRdReq
bool retryRdReq
Remember if we have to retry a request when available.
Definition: mem_ctrl.hh:278
MemCtrl::requestEventScheduled
bool requestEventScheduled() const
Is there a read/write burst Event scheduled?
Definition: mem_ctrl.hh:667
MemCtrl::commandWindow
const Tick commandWindow
Length of a command window, used to check command bandwidth.
Definition: mem_ctrl.hh:509
MemCtrl::isTimingMode
bool isTimingMode
Remember if the memory system is in timing mode.
Definition: mem_ctrl.hh:273
MemCtrl::respQueue
std::deque< MemPacket * > respQueue
Response queue where read packets wait after we're done working with them, but it's not time to send ...
Definition: mem_ctrl.hh:452
Stats::Average
A stat that calculates the per tick average of a value.
Definition: statistics.hh:2549
mem_ctrl.hh
MemPacket::_qosValue
uint8_t _qosValue
QoS value of the encapsulated packet read at queuing time.
Definition: mem_ctrl.hh:147
MemCtrl::verifySingleCmd
Tick verifySingleCmd(Tick cmd_tick, Tick max_cmds_per_burst)
Check for command bus contention for single cycle command.
Definition: mem_ctrl.cc:687
MemCtrl::CtrlStats::requestorWriteRate
Stats::Formula requestorWriteRate
Definition: mem_ctrl.hh:571
MemCtrl::writeBufferSize
const uint32_t writeBufferSize
Definition: mem_ctrl.hh:478
MemCtrl::pendingDelete
std::unique_ptr< Packet > pendingDelete
Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent c...
Definition: mem_ctrl.hh:592
MemCtrl::CtrlStats::bytesReadWrQ
Stats::Scalar bytesReadWrQ
Definition: mem_ctrl.hh:555
MemCtrl::addToWriteQueue
void addToWriteQueue(PacketPtr pkt, unsigned int pkt_count, bool is_dram)
Decode the incoming pkt, create a mem_pkt and push to the back of the write queue.
Definition: mem_ctrl.cc:300
MemCtrl::accessAndRespond
void accessAndRespond(PacketPtr pkt, Tick static_latency)
When a packet reaches its "readyTime" in the response Q, use the "access()" method in AbstractMemory ...
Definition: mem_ctrl.cc:622
MemPacket::pkt
const PacketPtr pkt
This comes from the outside world.
Definition: mem_ctrl.hh:102
MemCtrl
The memory controller is a single-channel memory controller capturing the most important timing const...
Definition: mem_ctrl.hh:236
MemCtrl::verifyMultiCmd
Tick verifyMultiCmd(Tick cmd_tick, Tick max_cmds_per_burst, Tick max_multi_cmd_split=0)
Check for command bus contention for multi-cycle (2 currently) command.
Definition: mem_ctrl.cc:710
MemCtrl::minWritesPerSwitch
const uint32_t minWritesPerSwitch
Definition: mem_ctrl.hh:481
MemPacket::_requestorId
const RequestorID _requestorId
RequestorID associated with the packet.
Definition: mem_ctrl.hh:105
MemCtrl::CtrlStats::CtrlStats
CtrlStats(MemCtrl &ctrl)
Definition: mem_ctrl.cc:1174
MemPacket::qosValue
void qosValue(const uint8_t qv)
Set the packet QoS value (interface compatibility with Packet)
Definition: mem_ctrl.hh:153
qport.hh
MemCtrl::recvTimingReq
bool recvTimingReq(PacketPtr pkt)
Definition: mem_ctrl.cc:406
MemCtrl::CtrlStats::requestorWriteAvgLat
Stats::Formula requestorWriteAvgLat
Definition: mem_ctrl.hh:583
MemCtrl::port
MemoryPort port
Our incoming port, for a multi-ported controller add a crossbar in front of it.
Definition: mem_ctrl.hh:268
MemCtrl::MemCtrl
MemCtrl(const MemCtrlParams *p)
Definition: mem_ctrl.cc:54
Stats::Formula
A formula for statistics that is calculated when printed.
Definition: statistics.hh:3037
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
std::deque< MemPacket * >
MemCtrl::inReadBusState
bool inReadBusState(bool next_state) const
Check the current direction of the memory channel.
Definition: mem_ctrl.cc:774
MemCtrl::addToReadQueue
void addToReadQueue(PacketPtr pkt, unsigned int pkt_count, bool is_dram)
When a new read comes in, first check if the write q has a pending request to the same address....
Definition: mem_ctrl.cc:181
Stats::Group
Statistics container.
Definition: group.hh:83
MemCtrl::readQueue
std::vector< MemPacketQueue > readQueue
The controller's main read and write queues, with support for QoS reordering.
Definition: mem_ctrl.hh:432
MemCtrl::CtrlStats::numWrRetry
Stats::Scalar numWrRetry
Definition: mem_ctrl.hh:547
addr
ip6_addr_t addr
Definition: inet.hh:423
MemCtrl::CtrlStats::totGap
Stats::Scalar totGap
Definition: mem_ctrl.hh:562
MemPacket::addr
Addr addr
The starting address of the packet.
Definition: mem_ctrl.hh:130
MemPacket::bankId
const uint16_t bankId
Bank id is calculated considering banks in all the ranks eg: 2 ranks each with 8 banks,...
Definition: mem_ctrl.hh:122
MemCtrl::CtrlStats::requestorReadBytes
Stats::Vector requestorReadBytes
Definition: mem_ctrl.hh:566
MemCtrl::CtrlStats::wrPerTurnAround
Stats::Histogram wrPerTurnAround
Definition: mem_ctrl.hh:553
MemCtrl::burstTicks
std::unordered_multiset< Tick > burstTicks
Holds count of commands issued in burst window starting at defined Tick.
Definition: mem_ctrl.hh:459
MemCtrl::getBurstWindow
Tick getBurstWindow(Tick cmd_tick)
Calculate burst window aligned tick.
Definition: mem_ctrl.cc:679
MemCtrl::recvFunctional
void recvFunctional(PacketPtr pkt)
Definition: mem_ctrl.cc:1342
MemCtrl::CtrlStats::readBursts
Stats::Scalar readBursts
Definition: mem_ctrl.hh:537
MemCtrl::chooseNextFRFCFS
MemPacketQueue::iterator chooseNextFRFCFS(MemPacketQueue &queue, Tick extra_col_delay)
For FR-FCFS policy reorder the read/write queue depending on row buffer hits and earliest bursts avai...
Definition: mem_ctrl.cc:580
MemCtrl::MemoryPort::MemoryPort
MemoryPort(const std::string &name, MemCtrl &_ctrl)
Definition: mem_ctrl.cc:1423
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
std::list< AddrRange >
MemCtrl::backendLatency
const Tick backendLatency
Pipeline latency of the backend and PHY.
Definition: mem_ctrl.hh:503
MemCtrl::CtrlStats::requestorWriteTotalLat
Stats::Vector requestorWriteTotalLat
Definition: mem_ctrl.hh:579
MemCtrl::chooseNext
MemPacketQueue::iterator chooseNext(MemPacketQueue &queue, Tick extra_col_delay)
The memory schduler/arbiter - picks which request needs to go next, based on the specified policy suc...
Definition: mem_ctrl.cc:545
MemPacket::dram
const bool dram
Does this packet access DRAM?
Definition: mem_ctrl.hh:110
MemCtrl::recvAtomic
Tick recvAtomic(PacketPtr pkt)
Definition: mem_ctrl.cc:123
MemCtrl::CtrlStats::neitherReadNorWriteReqs
Stats::Scalar neitherReadNorWriteReqs
Definition: mem_ctrl.hh:541
MemCtrl::MemoryPort::recvAtomic
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
Definition: mem_ctrl.cc:1459
MemPacket::qosValue
uint8_t qosValue() const
Get the packet QoS value (interface compatibility with Packet)
Definition: mem_ctrl.hh:159
MemPacket::isRead
bool isRead() const
Return true if its a read packet (interface compatibility with Packet)
Definition: mem_ctrl.hh:183
BurstHelper::BurstHelper
BurstHelper(unsigned int _burstCount)
Definition: mem_ctrl.hh:82
callback.hh
MemCtrl::readQueueFull
bool readQueueFull(unsigned int pkt_count) const
Check if the read queue has room for more entries.
Definition: mem_ctrl.cc:158
MemCtrl::nextReqTime
Tick nextReqTime
The soonest you have to start thinking about the next request is the longest access time that can occ...
Definition: mem_ctrl.hh:524
BurstHelper
A burst helper helps organize and manage a packet that is larger than the memory burst size.
Definition: mem_ctrl.hh:72
curTick
Tick curTick()
The current simulated tick.
Definition: core.hh:45
eventq.hh

Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17