physical.cc (8931:7a1dfb191e3f) | physical.cc (9235:5aa4896ed55a) |
---|---|
1/* 2 * Copyright (c) 2012 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 --- 50 unchanged lines hidden (view full) --- 59 if (addrMap.insert((*m)->getAddrRange(), *m) == addrMap.end()) 60 fatal("Memory address range for %s is overlapping\n", 61 (*m)->name()); 62 } 63 DPRINTF(BusAddrRanges, 64 "Skipping memory %s that is not in global address map\n", 65 (*m)->name()); 66 } | 1/* 2 * Copyright (c) 2012 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 --- 50 unchanged lines hidden (view full) --- 59 if (addrMap.insert((*m)->getAddrRange(), *m) == addrMap.end()) 60 fatal("Memory address range for %s is overlapping\n", 61 (*m)->name()); 62 } 63 DPRINTF(BusAddrRanges, 64 "Skipping memory %s that is not in global address map\n", 65 (*m)->name()); 66 } |
67 rangeCache.invalidate(); | |
68} 69 70bool 71PhysicalMemory::isMemAddr(Addr addr) const 72{ 73 // see if the address is within the last matched range 74 if (addr != rangeCache) { 75 // lookup in the interval tree | 67} 68 69bool 70PhysicalMemory::isMemAddr(Addr addr) const 71{ 72 // see if the address is within the last matched range 73 if (addr != rangeCache) { 74 // lookup in the interval tree |
76 range_map<Addr, AbstractMemory*>::const_iterator r = 77 addrMap.find(addr); | 75 AddrRangeMap<AbstractMemory*>::const_iterator r = addrMap.find(addr); |
78 if (r == addrMap.end()) { 79 // not in the cache, and not in the tree 80 return false; 81 } 82 // the range is in the tree, update the cache 83 rangeCache = r->first; 84 } 85 --- 19 unchanged lines hidden (view full) --- 105 return ranges; 106} 107 108void 109PhysicalMemory::access(PacketPtr pkt) 110{ 111 assert(pkt->isRequest()); 112 Addr addr = pkt->getAddr(); | 76 if (r == addrMap.end()) { 77 // not in the cache, and not in the tree 78 return false; 79 } 80 // the range is in the tree, update the cache 81 rangeCache = r->first; 82 } 83 --- 19 unchanged lines hidden (view full) --- 103 return ranges; 104} 105 106void 107PhysicalMemory::access(PacketPtr pkt) 108{ 109 assert(pkt->isRequest()); 110 Addr addr = pkt->getAddr(); |
113 range_map<Addr, AbstractMemory*>::const_iterator m = addrMap.find(addr); | 111 AddrRangeMap<AbstractMemory*>::const_iterator m = addrMap.find(addr); |
114 assert(m != addrMap.end()); 115 m->second->access(pkt); 116} 117 118void 119PhysicalMemory::functionalAccess(PacketPtr pkt) 120{ 121 assert(pkt->isRequest()); 122 Addr addr = pkt->getAddr(); | 112 assert(m != addrMap.end()); 113 m->second->access(pkt); 114} 115 116void 117PhysicalMemory::functionalAccess(PacketPtr pkt) 118{ 119 assert(pkt->isRequest()); 120 Addr addr = pkt->getAddr(); |
123 range_map<Addr, AbstractMemory*>::const_iterator m = addrMap.find(addr); | 121 AddrRangeMap<AbstractMemory*>::const_iterator m = addrMap.find(addr); |
124 assert(m != addrMap.end()); 125 m->second->functionalAccess(pkt); 126} | 122 assert(m != addrMap.end()); 123 m->second->functionalAccess(pkt); 124} |