From 36d199b9a96838359230f1ae8a40446e05296145 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 15 Oct 2012 08:07:04 -0400 Subject: Mem: Use range operations in bus in preparation for striping This patch transitions the bus to use the AddrRange operations instead of directly accessing the start and end. The change facilitates the move to a more elaborate AddrRange class that also supports address striping in the bus by specifying interleaving bits in the ranges. Two new functions are added to the AddrRange to determine if two ranges intersect, and if one is a subset of another. The bus propagation of address ranges is also tweaked such that an update is only propagated if the bus received information from all the downstream slave modules. This avoids the iteration and need for the cycle-breaking scheme that was previously used. --- src/mem/addr_mapper.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mem/addr_mapper.cc') diff --git a/src/mem/addr_mapper.cc b/src/mem/addr_mapper.cc index 53e8277cc..28fc85245 100644 --- a/src/mem/addr_mapper.cc +++ b/src/mem/addr_mapper.cc @@ -272,14 +272,10 @@ RangeAddrMapper::getAddrRanges() const AddrRange range = *r; for (int j = 0; j < originalRanges.size(); ++j) { - if ((range.start < originalRanges[j].start && - range.end >= originalRanges[j].start) || - (range.start < originalRanges[j].end && - range.end >= originalRanges[j].end)) + if (range.intersects(originalRanges[j])) fatal("Cannot remap range that intersects the original" " ranges but are not a subset.\n"); - if (range.start >= originalRanges[j].start && - range.end <= originalRanges[j].end) { + if (range.isSubset(originalRanges[j])) { // range is a subset Addr offset = range.start - originalRanges[j].start; range.start -= offset; -- cgit v1.2.3