base, mem: Disambiguate if an addr range is contained or overlaps
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Wed, 18 Apr 2018 10:56:08 +0000 (11:56 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Tue, 19 Jun 2018 14:24:25 +0000 (14:24 +0000)
commit683f411dcab4bb2275902f79f32eeee7c2e0b00a
tree0e390a261dbab91766f881bd4330e4ee14d4ee3c
parent699ef82eba4ffe4ba49645968d2969b56599b617
base, mem: Disambiguate if an addr range is contained or overlaps

We need to determined whether an address range is fully contained or
it overlaps with an address range in the address range in the mmap. As
an example, we use address range maps to associate ports to address
ranges and we determine which port we will forward the request based
on which address range contains the addresses accessed by the
request. We also need to make sure that when we add a new port to the
address range map, its address range does not overlap with any of the
existing ports.

This patch splits the function find() into two functions contains()
and intersects() to implement this distinct functionality. It also
changes the xbar and the physical memory to use the right function.

Change-Id: If3fd3f774a16b27db2df76dc04f1d61824938008
Reviewed-on: https://gem5-review.googlesource.com/11115
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
src/base/addr_range_map.hh
src/mem/physical.cc
src/mem/xbar.cc
src/unittest/rangemaptest.cc