base,python: Expand AddrRange exclude and add subtraction operators.

Expand exclude to work with an AddrRange or AddrRangeList, define
versions to exclude both from an AddrRangeList, and make all available
through subtraction operators. Add -= operators for AddrRangeList with
another AddrRangeList or AddrRange.

Change-Id: Ic48f0c45a4809dbc51e1d3133e8319134aabe29e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50347
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
Gabe Black
2021-09-14 01:03:46 -07:00
parent 416939c5c2
commit e9b7f08abb
3 changed files with 199 additions and 1 deletions

View File

@@ -154,7 +154,8 @@ init_range(py::module_ &m_native)
.def("mergesWith", &AddrRange::mergesWith)
.def("intersects", &AddrRange::intersects)
.def("isSubset", &AddrRange::isSubset)
.def("exclude", &AddrRange::exclude)
.def("exclude", static_cast<AddrRangeList (AddrRange::*)(
const AddrRangeList &) const>(&AddrRange::exclude))
;
m.def("RangeEx", &RangeEx);