diff -r cf9bfe6912de -r 6c564cf96834 src/mem/physical.hh --- a/src/mem/physical.hh Thu Dec 06 22:18:22 2012 -0600 +++ b/src/mem/physical.hh Thu Dec 06 22:19:49 2012 -0600 @@ -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 ranges appear as a + * single range. * * @return All configuration table memory ranges */ diff -r cf9bfe6912de -r 6c564cf96834 src/mem/physical.cc --- a/src/mem/physical.cc Thu Dec 06 22:18:22 2012 -0600 +++ b/src/mem/physical.cc Thu Dec 06 22:19:49 2012 -0600 @@ -202,13 +202,34 @@ // 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()); + vector intlv_ranges; + for (AddrRangeMap::const_iterator r = addrMap.begin(); + r != addrMap.end(); ++r) { + if (r->second->isConfReported()) { + // if the range is interleaved then save it for now + if (r->first.interleaved()) { + // if we already got interleaved ranges that are not + // part of the same range, then first do a merge + // before we add the new one + if (!intlv_ranges.empty() && + !intlv_ranges.back().mergesWith(r->first)) { + ranges.push_back(AddrRange(intlv_ranges)); + intlv_ranges.clear(); + } + intlv_ranges.push_back(r->first); + } else { + // keep the current range + ranges.push_back(r->first); + } } } + // if there is still interleaved ranges waiting to be merged, + // go ahead and do it + if (!intlv_ranges.empty()) { + ranges.push_back(AddrRange(intlv_ranges)); + } + return ranges; }