diff -r bd07589f5907 -r 4049206efae6 src/mem/physical.hh --- a/src/mem/physical.hh Thu Nov 01 16:10:57 2012 +0000 +++ b/src/mem/physical.hh Thu Nov 01 17:41:16 2012 +0000 @@ -135,7 +135,9 @@ /** * Get the memory ranges for all memories that are to be reported - * to the configuration table. + * to the configuration table. The ranges are merged before they + * are returned such that any interleaved or consecutive ranges + * appear as a single range. * * @return All configuration table memory ranges */ diff -r bd07589f5907 -r 4049206efae6 src/mem/physical.cc --- a/src/mem/physical.cc Thu Nov 01 16:10:57 2012 +0000 +++ b/src/mem/physical.cc Thu Nov 01 17:41:16 2012 +0000 @@ -221,10 +221,16 @@ // this could be done once in the constructor, but since it is unlikely to // be called more than once the iteration should not be a problem AddrRangeList ranges; - for (vector::const_iterator m = memories.begin(); - m != memories.end(); ++m) { - if ((*m)->isConfReported()) { - ranges.push_back((*m)->getAddrRange()); + for (AddrRangeMap::const_iterator r = addrMap.begin(); + r != addrMap.end(); ++r) { + if (r->second->isConfReported()) { + // if we have no range in our list, or if we cannot merge + // the current one with the last one, then add it, as the + // addr map is an interval tree sorted on the address this + // is a safe way of doing the merging + if (ranges.empty() || !ranges.back().merge(r->first)) { + ranges.push_back(r->first); + } } }