Deleted Added
sdiff udiff text old ( 10618:bb665366cc00 ) new ( 10619:6dd27a0e0d23 )
full compact
1/*
2 * Copyright (c) 2010-2014 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

--- 43 unchanged lines hidden (view full) ---

52#include "mem/dram_ctrl.hh"
53#include "sim/system.hh"
54
55using namespace std;
56using namespace Data;
57
58DRAMCtrl::DRAMCtrl(const DRAMCtrlParams* p) :
59 AbstractMemory(p),
60 port(name() + ".port", *this),
61 retryRdReq(false), retryWrReq(false),
62 busState(READ),
63 nextReqEvent(this), respondEvent(this),
64 drainManager(NULL),
65 deviceSize(p->device_size),
66 deviceBusWidth(p->device_bus_width), burstLength(p->burst_length),
67 deviceRowBufferSize(p->device_rowbuffer_size),
68 devicesPerRank(p->devices_per_rank),

--- 165 unchanged lines hidden (view full) ---

234 } else {
235 port.sendRangeChange();
236 }
237}
238
239void
240DRAMCtrl::startup()
241{
242 // timestamp offset should be in clock cycles for DRAMPower
243 timeStampOffset = divCeil(curTick(), tCK);
244
245 // update the start tick for the precharge accounting to the
246 // current tick
247 for (auto r : ranks) {
248 r->startup(curTick() + tREFI - tRP);
249 }
250
251 // shift the bus busy time sufficiently far ahead that we never
252 // have to worry about negative values when computing the time for
253 // the next request, this will add an insignificant bubble at the
254 // start of simulation
255 busBusyUntil = curTick() + tRP + tRCD + tCL;
256}
257
258Tick
259DRAMCtrl::recvAtomic(PacketPtr pkt)
260{
261 DPRINTF(DRAM, "recvAtomic: %s 0x%x\n", pkt->cmdString(), pkt->getAddr());
262
263 // do the actual memory access and turn the packet into a response

--- 1286 unchanged lines hidden (view full) ---

1550 pwrStateTick = curTick();
1551
1552 // kick off the refresh, and give ourselves enough time to
1553 // precharge
1554 schedule(refreshEvent, ref_tick);
1555}
1556
1557void
1558DRAMCtrl::Rank::checkDrainDone()
1559{
1560 // if this rank was waiting to drain it is now able to proceed to
1561 // precharge
1562 if (refreshState == REF_DRAIN) {
1563 DPRINTF(DRAM, "Refresh drain done, now precharging\n");
1564
1565 refreshState = REF_PRE;

--- 626 unchanged lines hidden (view full) ---

2192
2193 if (count)
2194 setDrainState(Drainable::Draining);
2195 else
2196 setDrainState(Drainable::Drained);
2197 return count;
2198}
2199
2200DRAMCtrl::MemoryPort::MemoryPort(const std::string& name, DRAMCtrl& _memory)
2201 : QueuedSlavePort(name, &_memory, queue), queue(_memory, *this),
2202 memory(_memory)
2203{ }
2204
2205AddrRangeList
2206DRAMCtrl::MemoryPort::getAddrRanges() const
2207{

--- 38 unchanged lines hidden ---