41#ifndef __BASE_ADDR_RANGE_MAP_HH__
42#define __BASE_ADDR_RANGE_MAP_HH__
61template <
typename V,
int max_cache_size=0>
160 return tree.insert(std::make_pair(
r,
d)).first;
179 for (
auto it =
p; it !=
q; it++) {
258 if (max_cache_size != 0) {
260 if (
cache.size() >= max_cache_size) {
264 auto last =
cache.end();
267 if (max_cache_size > 1)
270 cache.push_front(it);
292 if (
cond(it->first)) {
301 if (next !=
end() &&
cond(next->first)) {
312 if (
cond(
i->first)) {
317 }
while (next !=
begin() &&
318 (--next)->first.mergesWith(
i->first));
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
The AddrRangeMap uses an STL map to implement an interval tree for address decoding.
const_iterator find(const AddrRange &r, std::function< bool(const AddrRange)> cond) const
void addNewEntryToCache(iterator it) const
Add an address range map entry to the cache.
std::list< iterator > cache
A list of iterator that correspond to the max_cache_size most recently used entries in the address ra...
std::map< AddrRange, V > RangeMap
iterator find(const AddrRange &r, std::function< bool(const AddrRange)> cond)
Find entry that satisfies a condition on an address range.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
const_iterator contains(Addr r) const
Find entry that contains the given address.
const_iterator begin() const
AddrRange RangeSize(Addr start, Addr size)
const_iterator intersects(const AddrRange &r) const
Find entry that intersects with the given address range.
iterator insert(const AddrRange &r, const V &d)
iterator contains(const AddrRange &r)
RangeMap::iterator iterator
iterator intersects(const AddrRange &r)
const_iterator contains(const AddrRange &r) const
Find entry that contains the given address range.
const_iterator end() const
RangeMap::const_iterator const_iterator
void erase(iterator p, iterator q)
iterator contains(Addr r)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.