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) |
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 (drainState() == DrainState::Draining) { 204 DPRINTF(Drain, "Draining of SimpleMemory complete\n"); 205 signalDrainDone(); |
206 } 207 } 208} 209 210Tick 211SimpleMemory::getLatency() const 212{ 213 return latency + --- 13 unchanged lines hidden (view full) --- 227{ 228 if (if_name != "port") { 229 return MemObject::getSlavePort(if_name, idx); 230 } else { 231 return port; 232 } 233} 234 |
235DrainState 236SimpleMemory::drain() |
237{ |
238 if (!packetQueue.empty()) { |
239 DPRINTF(Drain, "SimpleMemory Queue has requests, waiting to drain\n"); |
240 return DrainState::Draining; 241 } else { 242 return DrainState::Drained; 243 } |
244} 245 246SimpleMemory::MemoryPort::MemoryPort(const std::string& _name, 247 SimpleMemory& _memory) 248 : SlavePort(_name, &_memory), memory(_memory) 249{ } 250 251AddrRangeList --- 36 unchanged lines hidden --- |