dram_ctrl.cc (10910:32f3d1c454ec) dram_ctrl.cc (10912:b99a6662d7c2)
1/*
2 * Copyright (c) 2010-2015 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

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

2164 } else {
2165 return port;
2166 }
2167}
2168
2169unsigned int
2170DRAMCtrl::drain(DrainManager *dm)
2171{
1/*
2 * Copyright (c) 2010-2015 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

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

2164 } else {
2165 return port;
2166 }
2167}
2168
2169unsigned int
2170DRAMCtrl::drain(DrainManager *dm)
2171{
2172 unsigned int count = port.drain(dm);
2173
2174 // if there is anything in any of our internal queues, keep track
2175 // of that as well
2176 if (!(writeQueue.empty() && readQueue.empty() &&
2177 respQueue.empty())) {
2178 DPRINTF(Drain, "DRAM controller not drained, write: %d, read: %d,"
2179 " resp: %d\n", writeQueue.size(), readQueue.size(),
2180 respQueue.size());
2172 // if there is anything in any of our internal queues, keep track
2173 // of that as well
2174 if (!(writeQueue.empty() && readQueue.empty() &&
2175 respQueue.empty())) {
2176 DPRINTF(Drain, "DRAM controller not drained, write: %d, read: %d,"
2177 " resp: %d\n", writeQueue.size(), readQueue.size(),
2178 respQueue.size());
2181 ++count;
2182 drainManager = dm;
2183
2184 // the only part that is not drained automatically over time
2185 // is the write queue, thus kick things into action if needed
2186 if (!writeQueue.empty() && !nextReqEvent.scheduled()) {
2187 schedule(nextReqEvent, curTick());
2188 }
2179 drainManager = dm;
2180
2181 // the only part that is not drained automatically over time
2182 // is the write queue, thus kick things into action if needed
2183 if (!writeQueue.empty() && !nextReqEvent.scheduled()) {
2184 schedule(nextReqEvent, curTick());
2185 }
2189 }
2190
2191 if (count)
2192 setDrainState(DrainState::Draining);
2186 setDrainState(DrainState::Draining);
2193 else
2187 return 1;
2188 } else {
2194 setDrainState(DrainState::Drained);
2189 setDrainState(DrainState::Drained);
2195 return count;
2190 return 0;
2191 }
2196}
2197
2198void
2199DRAMCtrl::drainResume()
2200{
2201 if (!isTimingMode && system()->isTimingMode()) {
2202 // if we switched to timing mode, kick things into action,
2203 // and behave as if we restored from a checkpoint

--- 59 unchanged lines hidden ---
2192}
2193
2194void
2195DRAMCtrl::drainResume()
2196{
2197 if (!isTimingMode && system()->isTimingMode()) {
2198 // if we switched to timing mode, kick things into action,
2199 // and behave as if we restored from a checkpoint

--- 59 unchanged lines hidden ---