dram_ctrl.cc (10466:73b7549d979e) dram_ctrl.cc (10489:99d59caa4c8f)
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

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

57DRAMCtrl::DRAMCtrl(const DRAMCtrlParams* p) :
58 AbstractMemory(p),
59 port(name() + ".port", *this),
60 retryRdReq(false), retryWrReq(false),
61 busState(READ),
62 nextReqEvent(this), respondEvent(this), activateEvent(this),
63 prechargeEvent(this), refreshEvent(this), powerEvent(this),
64 drainManager(NULL),
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

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

57DRAMCtrl::DRAMCtrl(const DRAMCtrlParams* p) :
58 AbstractMemory(p),
59 port(name() + ".port", *this),
60 retryRdReq(false), retryWrReq(false),
61 busState(READ),
62 nextReqEvent(this), respondEvent(this), activateEvent(this),
63 prechargeEvent(this), refreshEvent(this), powerEvent(this),
64 drainManager(NULL),
65 deviceSize(p->device_size),
65 deviceBusWidth(p->device_bus_width), burstLength(p->burst_length),
66 deviceRowBufferSize(p->device_rowbuffer_size),
67 devicesPerRank(p->devices_per_rank),
68 burstSize((devicesPerRank * burstLength * deviceBusWidth) / 8),
69 rowBufferSize(devicesPerRank * deviceRowBufferSize),
70 columnsPerRowBuffer(rowBufferSize / burstSize),
71 columnsPerStripe(range.granularity() / burstSize),
72 ranksPerChannel(p->ranks_per_channel),

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

134 if (p->write_low_thresh_perc >= p->write_high_thresh_perc)
135 fatal("Write buffer low threshold %d must be smaller than the "
136 "high threshold %d\n", p->write_low_thresh_perc,
137 p->write_high_thresh_perc);
138
139 // determine the rows per bank by looking at the total capacity
140 uint64_t capacity = ULL(1) << ceilLog2(AbstractMemory::size());
141
66 deviceBusWidth(p->device_bus_width), burstLength(p->burst_length),
67 deviceRowBufferSize(p->device_rowbuffer_size),
68 devicesPerRank(p->devices_per_rank),
69 burstSize((devicesPerRank * burstLength * deviceBusWidth) / 8),
70 rowBufferSize(devicesPerRank * deviceRowBufferSize),
71 columnsPerRowBuffer(rowBufferSize / burstSize),
72 columnsPerStripe(range.granularity() / burstSize),
73 ranksPerChannel(p->ranks_per_channel),

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

135 if (p->write_low_thresh_perc >= p->write_high_thresh_perc)
136 fatal("Write buffer low threshold %d must be smaller than the "
137 "high threshold %d\n", p->write_low_thresh_perc,
138 p->write_high_thresh_perc);
139
140 // determine the rows per bank by looking at the total capacity
141 uint64_t capacity = ULL(1) << ceilLog2(AbstractMemory::size());
142
143 // determine the dram actual capacity from the DRAM config in Mbytes
144 uint64_t deviceCapacity = deviceSize / (1024 * 1024) * devicesPerRank *
145 ranksPerChannel;
146
147 // if actual DRAM size does not match memory capacity in system warn!
148 if (deviceCapacity != capacity / (1024 * 1024))
149 warn("DRAM device capacity (%d Mbytes) does not match the "
150 "address range assigned (%d Mbytes)\n", deviceCapacity,
151 capacity / (1024 * 1024));
152
142 DPRINTF(DRAM, "Memory capacity %lld (%lld) bytes\n", capacity,
143 AbstractMemory::size());
144
145 DPRINTF(DRAM, "Row buffer size %d bytes with %d columns per row buffer\n",
146 rowBufferSize, columnsPerRowBuffer);
147
148 rowsPerBank = capacity / (rowBufferSize * banksPerRank * ranksPerChannel);
149

--- 1979 unchanged lines hidden ---
153 DPRINTF(DRAM, "Memory capacity %lld (%lld) bytes\n", capacity,
154 AbstractMemory::size());
155
156 DPRINTF(DRAM, "Row buffer size %d bytes with %d columns per row buffer\n",
157 rowBufferSize, columnsPerRowBuffer);
158
159 rowsPerBank = capacity / (rowBufferSize * banksPerRank * ranksPerChannel);
160

--- 1979 unchanged lines hidden ---