simple_mem.cc (10466:73b7549d979e) | simple_mem.cc (10509:d5554f97c451) |
---|---|
1/* 2 * Copyright (c) 2010-2013 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 --- 30 unchanged lines hidden (view full) --- 39 * 40 * Authors: Ron Dreslinski 41 * Ali Saidi 42 * Andreas Hansson 43 */ 44 45#include "base/random.hh" 46#include "mem/simple_mem.hh" | 1/* 2 * Copyright (c) 2010-2013 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 --- 30 unchanged lines hidden (view full) --- 39 * 40 * Authors: Ron Dreslinski 41 * Ali Saidi 42 * Andreas Hansson 43 */ 44 45#include "base/random.hh" 46#include "mem/simple_mem.hh" |
47#include "debug/Drain.hh" |
|
47 48using namespace std; 49 50SimpleMemory::SimpleMemory(const SimpleMemoryParams* p) : 51 AbstractMemory(p), 52 port(name() + ".port", *this), latency(p->latency), 53 latency_var(p->latency_var), bandwidth(p->bandwidth), isBusy(false), 54 retryReq(false), retryResp(false), --- 140 unchanged lines hidden (view full) --- 195 // if the queue is not empty, schedule the next dequeue event, 196 // otherwise signal that we are drained if we were asked to do so 197 if (!packetQueue.empty()) { 198 // if there were packets that got in-between then we 199 // already have an event scheduled, so use re-schedule 200 reschedule(dequeueEvent, 201 std::max(packetQueue.front().tick, curTick()), true); 202 } else if (drainManager) { | 48 49using namespace std; 50 51SimpleMemory::SimpleMemory(const SimpleMemoryParams* p) : 52 AbstractMemory(p), 53 port(name() + ".port", *this), latency(p->latency), 54 latency_var(p->latency_var), bandwidth(p->bandwidth), isBusy(false), 55 retryReq(false), retryResp(false), --- 140 unchanged lines hidden (view full) --- 196 // if the queue is not empty, schedule the next dequeue event, 197 // otherwise signal that we are drained if we were asked to do so 198 if (!packetQueue.empty()) { 199 // if there were packets that got in-between then we 200 // already have an event scheduled, so use re-schedule 201 reschedule(dequeueEvent, 202 std::max(packetQueue.front().tick, curTick()), true); 203 } else if (drainManager) { |
204 DPRINTF(Drain, "Drainng of SimpleMemory complete\n"); |
|
203 drainManager->signalDrainDone(); 204 drainManager = NULL; 205 } 206 } 207} 208 209Tick 210SimpleMemory::getLatency() const --- 24 unchanged lines hidden (view full) --- 235SimpleMemory::drain(DrainManager *dm) 236{ 237 int count = 0; 238 239 // also track our internal queue 240 if (!packetQueue.empty()) { 241 count += 1; 242 drainManager = dm; | 205 drainManager->signalDrainDone(); 206 drainManager = NULL; 207 } 208 } 209} 210 211Tick 212SimpleMemory::getLatency() const --- 24 unchanged lines hidden (view full) --- 237SimpleMemory::drain(DrainManager *dm) 238{ 239 int count = 0; 240 241 // also track our internal queue 242 if (!packetQueue.empty()) { 243 count += 1; 244 drainManager = dm; |
243 } | 245 DPRINTF(Drain, "SimpleMemory Queue has requests, waiting to drain\n"); 246 } |
244 245 if (count) 246 setDrainState(Drainable::Draining); 247 else 248 setDrainState(Drainable::Drained); 249 return count; 250} 251 --- 42 unchanged lines hidden --- | 247 248 if (count) 249 setDrainState(Drainable::Draining); 250 else 251 setDrainState(Drainable::Drained); 252 return count; 253} 254 --- 42 unchanged lines hidden --- |