summaryrefslogtreecommitdiff
path: root/src/mem/addr_mapper.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-10-15 08:07:04 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-10-15 08:07:04 -0400
commit36d199b9a96838359230f1ae8a40446e05296145 (patch)
tree8d96e6243c2693fc290b0841477b30300a1f3245 /src/mem/addr_mapper.cc
parent43ca8415e8747145cb1a410d4672d4cd2247c695 (diff)
downloadgem5-36d199b9a96838359230f1ae8a40446e05296145.tar.xz
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.
Diffstat (limited to 'src/mem/addr_mapper.cc')
-rw-r--r--src/mem/addr_mapper.cc8
1 files changed, 2 insertions, 6 deletions
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;