gem5 v24.0.0.0
|
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ranges intersect, if a range contains a specific address etc. More...
#include <addr_range.hh>
Classes | |
struct | Dummy |
Public Member Functions | |
AddrRange () | |
AddrRange (Addr _start, Addr _end, const std::vector< Addr > &_masks, uint8_t _intlv_match) | |
Construct an address range. | |
AddrRange (Addr _start, Addr _end, uint8_t _intlv_high_bit, uint8_t _xor_high_bit, uint8_t _intlv_bits, uint8_t _intlv_match) | |
Legacy constructor of AddrRange. | |
AddrRange (Addr _start, Addr _end) | |
AddrRange (std::vector< AddrRange > ranges) | |
Create an address range by merging a collection of interleaved ranges. | |
AddrRange (std::list< AddrRange > ranges) | |
bool | interleaved () const |
Determine if the range is interleaved or not. | |
uint64_t | granularity () const |
Determing the interleaving granularity of the range. | |
uint32_t | stripes () const |
Determine the number of interleaved address stripes this range is part of. | |
Addr | size () const |
Get the size of the address range. | |
bool | valid () const |
Determine if the range is valid. | |
Addr | start () const |
Get the start address of the range. | |
Addr | end () const |
Get the end address of the range. | |
std::string | to_string () const |
Get a string representation of the range. | |
bool | mergesWith (const AddrRange &r) const |
Determine if another range merges with the current one, i.e. | |
bool | intersects (const AddrRange &r) const |
Determine if another range intersects this one, i.e. | |
bool | isSubset (const AddrRange &r) const |
Determine if this range is a subset of another range, i.e. | |
bool | contains (const Addr &a) const |
Determine if the range contains an address. | |
Addr | removeIntlvBits (Addr a) const |
Remove the interleaving bits from an input address. | |
Addr | addIntlvBits (Addr a) const |
This method adds the interleaving bits removed by removeIntlvBits. | |
Addr | getOffset (const Addr &a) const |
Determine the offset of an address within the range. | |
AddrRangeList | exclude (const AddrRangeList &exclude_ranges) const |
Subtract a list of intervals from the range and return the resulting collection of ranges, so that the union of the two lists cover the original range. | |
AddrRangeList | exclude (const AddrRange &excluded_range) const |
bool | operator< (const AddrRange &r) const |
Less-than operator used to turn an STL map into a binary search tree of non-overlapping address ranges. | |
bool | operator== (const AddrRange &r) const |
bool | operator!= (const AddrRange &r) const |
AddrRange | operator& (const AddrRange &r) const |
Protected Member Functions | |
template<class Iterator > | |
AddrRange (Dummy, Iterator begin_it, Iterator end_it) | |
Private Attributes | |
Addr | _start |
Private fields for the start and end of the range _start is the beginning of the range (inclusive). | |
Addr | _end |
std::vector< Addr > | masks |
Each mask determines the bits we need to xor to get one bit of sel. | |
uint8_t | intlvMatch |
The value to compare sel with. | |
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ranges intersect, if a range contains a specific address etc.
Besides a basic range, the AddrRange also support interleaved ranges, to stripe across cache banks, or memory controllers. The interleaving is implemented by allowing a number of bits of the address, at an arbitrary bit position, to be used as interleaving bits with an associated matching value. In addition, to prevent uniformly strided address patterns from a very biased interleaving, we also allow XOR-based hashing by specifying a set of bits to XOR with before matching.
The AddrRange is also able to coalesce a number of interleaved ranges to a contiguous range.
Definition at line 81 of file addr_range.hh.
|
inlineprotected |
Definition at line 108 of file addr_range.hh.
References _end, _start, gem5::X86ISA::count, fatal_if, intlvMatch, masks, mergesWith(), and to_string().
Definition at line 258 of file addr_range.hh.
Definition at line 273 of file addr_range.hh.
|
inline |
Definition at line 699 of file addr_range.hh.
References exclude().
|
private |
Definition at line 90 of file addr_range.hh.
Referenced by AddrRange(), contains(), end(), getOffset(), intersects(), isSubset(), mergesWith(), operator==(), size(), to_string(), and valid().
|
private |
Private fields for the start and end of the range _start is the beginning of the range (inclusive).
_end is not part of the range.
Definition at line 89 of file addr_range.hh.
Referenced by AddrRange(), contains(), getOffset(), intersects(), isSubset(), mergesWith(), operator<(), operator==(), size(), start(), to_string(), and valid().
|
private |
The value to compare sel with.
Definition at line 100 of file addr_range.hh.
Referenced by addIntlvBits(), AddrRange(), contains(), intersects(), operator<(), operator==(), and to_string().
|
private |
Each mask determines the bits we need to xor to get one bit of sel.
The first (0) mask is used to get the LSB and the last for the MSB of sel.
Definition at line 97 of file addr_range.hh.
Referenced by addIntlvBits(), AddrRange(), AddrRange(), AddrRange(), contains(), granularity(), interleaved(), mergesWith(), operator==(), removeIntlvBits(), size(), stripes(), and to_string().