Deleted Added
sdiff udiff text old ( 10910:32f3d1c454ec ) new ( 10913:38dbdeea7f1f )
full compact
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

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

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),
56 releaseEvent(this), dequeueEvent(this), drainManager(NULL)
57{
58}
59
60void
61SimpleMemory::init()
62{
63 AbstractMemory::init();
64

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

195
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");
205 drainManager->signalDrainDone();
206 drainManager = NULL;
207 }
208 }
209}
210
211Tick
212SimpleMemory::getLatency() const
213{
214 return latency +

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

228{
229 if (if_name != "port") {
230 return MemObject::getSlavePort(if_name, idx);
231 } else {
232 return port;
233 }
234}
235
236unsigned int
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;
245 DPRINTF(Drain, "SimpleMemory Queue has requests, waiting to drain\n");
246 }
247
248 if (count)
249 setDrainState(DrainState::Draining);
250 else
251 setDrainState(DrainState::Drained);
252 return count;
253}
254
255SimpleMemory::MemoryPort::MemoryPort(const std::string& _name,
256 SimpleMemory& _memory)
257 : SlavePort(_name, &_memory), memory(_memory)
258{ }
259
260AddrRangeList

--- 36 unchanged lines hidden ---