gem5  v21.1.0.2
Typedefs | Functions
The AddrRange API.

These methods relate to the AddrRange and AddrRangeMap interfaces. More...

Typedefs

typedef std::list< AddrRangegem5::AddrRangeList
 Convenience typedef for a collection of address ranges. More...
 

Functions

 gem5::AddrRange::AddrRange ()
 
 gem5::AddrRange::AddrRange (Addr _start, Addr _end, const std::vector< Addr > &_masks, uint8_t _intlv_match)
 Construct an address range. More...
 
 gem5::AddrRange::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. More...
 
 gem5::AddrRange::AddrRange (const std::vector< AddrRange > &ranges)
 Create an address range by merging a collection of interleaved ranges. More...
 
bool gem5::AddrRange::interleaved () const
 Determine if the range is interleaved or not. More...
 
uint64_t gem5::AddrRange::granularity () const
 Determing the interleaving granularity of the range. More...
 
uint32_t gem5::AddrRange::stripes () const
 Determine the number of interleaved address stripes this range is part of. More...
 
Addr gem5::AddrRange::size () const
 Get the size of the address range. More...
 
bool gem5::AddrRange::valid () const
 Determine if the range is valid. More...
 
Addr gem5::AddrRange::start () const
 Get the start address of the range. More...
 
Addr gem5::AddrRange::end () const
 Get the end address of the range. More...
 
std::string gem5::AddrRange::to_string () const
 Get a string representation of the range. More...
 
bool gem5::AddrRange::mergesWith (const AddrRange &r) const
 Determine if another range merges with the current one, i.e. More...
 
bool gem5::AddrRange::intersects (const AddrRange &r) const
 Determine if another range intersects this one, i.e. More...
 
bool gem5::AddrRange::isSubset (const AddrRange &r) const
 Determine if this range is a subset of another range, i.e. More...
 
bool gem5::AddrRange::contains (const Addr &a) const
 Determine if the range contains an address. More...
 
Addr gem5::AddrRange::removeIntlvBits (Addr a) const
 Remove the interleaving bits from an input address. More...
 
Addr gem5::AddrRange::addIntlvBits (Addr a) const
 This method adds the interleaving bits removed by removeIntlvBits. More...
 
Addr gem5::AddrRange::getOffset (const Addr &a) const
 Determine the offset of an address within the range. More...
 
bool gem5::AddrRange::operator< (const AddrRange &r) const
 Less-than operator used to turn an STL map into a binary search tree of non-overlapping address ranges. More...
 
bool gem5::AddrRange::operator== (const AddrRange &r) const
 
bool gem5::AddrRange::operator!= (const AddrRange &r) const
 
AddrRange gem5::RangeEx (Addr start, Addr end)
 
AddrRange gem5::RangeIn (Addr start, Addr end)
 
AddrRange gem5::RangeSize (Addr start, Addr size)
 
iterator gem5::AddrRangeMap< V, max_cache_size >::insert (const AddrRange &r, const V &d)
 
void gem5::AddrRangeMap< V, max_cache_size >::erase (iterator p)
 
void gem5::AddrRangeMap< V, max_cache_size >::erase (iterator p, iterator q)
 
void gem5::AddrRangeMap< V, max_cache_size >::clear ()
 
const_iterator gem5::AddrRangeMap< V, max_cache_size >::begin () const
 
iterator gem5::AddrRangeMap< V, max_cache_size >::begin ()
 
const_iterator gem5::AddrRangeMap< V, max_cache_size >::end () const
 
iterator gem5::AddrRangeMap< V, max_cache_size >::end ()
 
std::size_t gem5::AddrRangeMap< V, max_cache_size >::size () const
 
bool gem5::AddrRangeMap< V, max_cache_size >::empty () const
 
typedef RangeMap::iterator gem5::AddrRangeMap< V, max_cache_size >::iterator
 
typedef RangeMap::const_iterator gem5::AddrRangeMap< V, max_cache_size >::const_iterator
 
const_iterator gem5::AddrRangeMap< V, max_cache_size >::contains (const AddrRange &r) const
 Find entry that contains the given address range. More...
 
iterator gem5::AddrRangeMap< V, max_cache_size >::contains (const AddrRange &r)
 
const_iterator gem5::AddrRangeMap< V, max_cache_size >::contains (Addr r) const
 Find entry that contains the given address. More...
 
iterator gem5::AddrRangeMap< V, max_cache_size >::contains (Addr r)
 
const_iterator gem5::AddrRangeMap< V, max_cache_size >::intersects (const AddrRange &r) const
 Find entry that intersects with the given address range. More...
 
iterator gem5::AddrRangeMap< V, max_cache_size >::intersects (const AddrRange &r)
 

Detailed Description

These methods relate to the AddrRange and AddrRangeMap interfaces.

Typedef Documentation

◆ AddrRangeList

Convenience typedef for a collection of address ranges.

Definition at line 641 of file addr_range.hh.

◆ const_iterator

template<typename V , int max_cache_size = 0>
typedef RangeMap::const_iterator gem5::AddrRangeMap< V, max_cache_size >::const_iterator

Definition at line 73 of file addr_range_map.hh.

◆ iterator

template<typename V , int max_cache_size = 0>
typedef RangeMap::iterator gem5::AddrRangeMap< V, max_cache_size >::iterator

Definition at line 72 of file addr_range_map.hh.

Function Documentation

◆ addIntlvBits()

Addr gem5::AddrRange::addIntlvBits ( Addr  a) const
inline

This method adds the interleaving bits removed by removeIntlvBits.

Definition at line 521 of file addr_range.hh.

References gem5::ArmISA::a, gem5::bits(), gem5::ctz64(), gem5::ArmISA::i, gem5::insertBits(), gem5::AddrRange::interleaved(), gem5::AddrRange::intlvMatch, gem5::AddrRange::masks, and gem5::popCount().

Referenced by gem5::ChannelAddr::getPA().

◆ AddrRange() [1/4]

gem5::AddrRange::AddrRange ( )
inline

Definition at line 97 of file addr_range.hh.

◆ AddrRange() [2/4]

gem5::AddrRange::AddrRange ( Addr  _start,
Addr  _end,
const std::vector< Addr > &  _masks,
uint8_t  _intlv_match 
)
inline

Construct an address range.

If the user provides a non empty vector of masks then the address range is interleaved. Each mask determines a set of bits that are xored to determine one bit of the sel value, starting from the least significant bit (i.e., masks[0] determines the least significant bit of sel, ...). If sel matches the provided _intlv_match then the address a is in the range.

For example if the input mask is _masks = { 1 << 8 | 1 << 11 | 1 << 13, 1 << 15 | 1 << 17 | 1 << 19}

Then a belongs to the address range if _start <= a < _end and sel == _intlv_match where sel[0] = a[8] ^ a[11] ^ a[13] sel[1] = a[15] ^ a[17] ^ a[19]

Parameters
_startThe start address of this range
_endThe end address of this range (not included in the range)
_masksThe input vector of masks
intlv_matchThe matching value of the xor operations

Definition at line 131 of file addr_range.hh.

References fatal_if, and gem5::AddrRange::masks.

◆ AddrRange() [3/4]

gem5::AddrRange::AddrRange ( Addr  _start,
Addr  _end,
uint8_t  _intlv_high_bit,
uint8_t  _xor_high_bit,
uint8_t  _intlv_bits,
uint8_t  _intlv_match 
)
inline

Legacy constructor of AddrRange.

If the user provides a non-zero value in _intlv_high_bit the address range is interleaved.

An address a belongs to the address range if _start <= a < _end and sel == _intlv_match where sel = sel1 ^ sel2 sel1 = a[_intlv_low_bit:_intlv_high_bit] sel2 = a[_xor_low_bit:_xor_high_bit] _intlv_low_bit = _intlv_high_bit - intv_bits _xor_low_bit = _xor_high_bit - intv_bits

Parameters
_startThe start address of this range
_endThe end address of this range (not included in the range)
_intlv_high_bitThe MSB of the intlv bits (disabled if 0)
_xor_high_bitThe MSB of the xor bit (disabled if 0)
_intlv_bitsthe size, in bits, of the intlv and xor bits
intlv_matchThe matching value of the xor operations

Definition at line 168 of file addr_range.hh.

References fatal, fatal_if, gem5::ArmISA::i, gem5::mask(), and gem5::AddrRange::masks.

◆ AddrRange() [4/4]

gem5::AddrRange::AddrRange ( const std::vector< AddrRange > &  ranges)
inline

Create an address range by merging a collection of interleaved ranges.

Parameters
rangesInterleaved ranges to be merged

Definition at line 218 of file addr_range.hh.

References gem5::AddrRange::_end, gem5::AddrRange::_start, fatal, gem5::AddrRange::intlvMatch, gem5::AddrRange::masks, gem5::AddrRange::mergesWith(), gem5::MipsISA::r, and gem5::AddrRange::to_string().

◆ begin() [1/2]

template<typename V , int max_cache_size = 0>
iterator gem5::AddrRangeMap< V, max_cache_size >::begin ( )
inline

Definition at line 208 of file addr_range_map.hh.

◆ begin() [2/2]

template<typename V , int max_cache_size = 0>
const_iterator gem5::AddrRangeMap< V, max_cache_size >::begin ( ) const
inline

Definition at line 199 of file addr_range_map.hh.

Referenced by gem5::AddrRangeMap< gem5::MemBackdoor, 1 >::find().

◆ clear()

template<typename V , int max_cache_size = 0>
void gem5::AddrRangeMap< V, max_cache_size >::clear ( )
inline

Definition at line 189 of file addr_range_map.hh.

◆ contains() [1/5]

template<typename V , int max_cache_size = 0>
iterator gem5::AddrRangeMap< V, max_cache_size >::contains ( Addr  r)
inline

Definition at line 120 of file addr_range_map.hh.

◆ contains() [2/5]

template<typename V , int max_cache_size = 0>
const_iterator gem5::AddrRangeMap< V, max_cache_size >::contains ( Addr  r) const
inline

Find entry that contains the given address.

Searches through the ranges in the address map and returns an iterator to the entry which range is a superset of the input address. Returns end() if none found.

Parameters
rAn input address
Returns
An iterator that contains the input address

Definition at line 115 of file addr_range_map.hh.

◆ contains() [3/5]

bool gem5::AddrRange::contains ( const Addr a) const
inline

◆ contains() [4/5]

template<typename V , int max_cache_size = 0>
iterator gem5::AddrRangeMap< V, max_cache_size >::contains ( const AddrRange r)
inline

Definition at line 95 of file addr_range_map.hh.

◆ contains() [5/5]

template<typename V , int max_cache_size = 0>
const_iterator gem5::AddrRangeMap< V, max_cache_size >::contains ( const AddrRange r) const
inline

Find entry that contains the given address range.

Searches through the ranges in the address map and returns an iterator to the entry which range is a superset of the input address range. Returns end() if none found.

Parameters
rAn input address range
Returns
An iterator that contains the input address range

Definition at line 90 of file addr_range_map.hh.

Referenced by gem5::AddrRangeMap< gem5::MemBackdoor, 1 >::contains(), and gem5::ruby::AbstractController::mapAddressToDownstreamMachine().

◆ empty()

template<typename V , int max_cache_size = 0>
bool gem5::AddrRangeMap< V, max_cache_size >::empty ( ) const
inline

Definition at line 244 of file addr_range_map.hh.

◆ end() [1/3]

template<typename V , int max_cache_size = 0>
iterator gem5::AddrRangeMap< V, max_cache_size >::end ( )
inline

Definition at line 226 of file addr_range_map.hh.

◆ end() [2/3]

template<typename V , int max_cache_size = 0>
const_iterator gem5::AddrRangeMap< V, max_cache_size >::end ( ) const
inline

◆ end() [3/3]

Addr gem5::AddrRange::end ( ) const
inline

◆ erase() [1/2]

template<typename V , int max_cache_size = 0>
void gem5::AddrRangeMap< V, max_cache_size >::erase ( iterator  p)
inline

Definition at line 167 of file addr_range_map.hh.

◆ erase() [2/2]

template<typename V , int max_cache_size = 0>
void gem5::AddrRangeMap< V, max_cache_size >::erase ( iterator  p,
iterator  q 
)
inline

Definition at line 177 of file addr_range_map.hh.

◆ getOffset()

Addr gem5::AddrRange::getOffset ( const Addr a) const
inline

Determine the offset of an address within the range.

This function returns the offset of the given address from the starting address discarding any bits that are used for interleaving. This way we can convert the input address to a new unique address in a continuous range that starts from 0.

Parameters
theinput address
Returns
the flat offset in the address range

Definition at line 575 of file addr_range.hh.

References gem5::AddrRange::_end, gem5::AddrRange::_start, gem5::ArmISA::a, gem5::AddrRange::interleaved(), gem5::MaxAddr, and gem5::AddrRange::removeIntlvBits().

Referenced by gem5::memory::MemInterface::getCtrlAddr().

◆ granularity()

uint64_t gem5::AddrRange::granularity ( ) const
inline

Determing the interleaving granularity of the range.

Returns
The size of the regions created by the interleaving bits

Definition at line 269 of file addr_range.hh.

References gem5::ctz64(), gem5::AddrRange::interleaved(), gem5::mask(), gem5::AddrRange::masks, and gem5::AddrRange::size().

Referenced by gem5::memory::DRAMInterface::init(), and gem5::init_range().

◆ insert()

template<typename V , int max_cache_size = 0>
iterator gem5::AddrRangeMap< V, max_cache_size >::insert ( const AddrRange r,
const V &  d 
)
inline

Definition at line 155 of file addr_range_map.hh.

Referenced by gem5::ruby::AbstractController::init().

◆ interleaved()

bool gem5::AddrRange::interleaved ( ) const
inline

◆ intersects() [1/3]

template<typename V , int max_cache_size = 0>
iterator gem5::AddrRangeMap< V, max_cache_size >::intersects ( const AddrRange r)
inline

Definition at line 145 of file addr_range_map.hh.

◆ intersects() [2/3]

template<typename V , int max_cache_size = 0>
const_iterator gem5::AddrRangeMap< V, max_cache_size >::intersects ( const AddrRange r) const
inline

Find entry that intersects with the given address range.

Searches through the ranges in the address map and returns an iterator to the first entry which range intersects with the input address.

Parameters
rAn input address
Returns
An iterator that intersects with the input address range

Definition at line 140 of file addr_range_map.hh.

Referenced by gem5::ruby::AbstractController::init(), and gem5::AddrRangeMap< gem5::MemBackdoor, 1 >::insert().

◆ intersects() [3/3]

bool gem5::AddrRange::intersects ( const AddrRange r) const
inline

Determine if another range intersects this one, i.e.

if there is an address that is both in this range and the other range. No check is made to ensure either range is valid.

Parameters
rRange to intersect with
Returns
true if the intersection of the two ranges is not empty

Definition at line 379 of file addr_range.hh.

References gem5::AddrRange::_end, gem5::AddrRange::_start, gem5::AddrRange::contains(), gem5::AddrRange::interleaved(), gem5::AddrRange::intlvMatch, gem5::AddrRange::mergesWith(), panic, gem5::MipsISA::r, and gem5::AddrRange::to_string().

Referenced by gem5::init_range(), gem5::VMA::intersects(), and TEST().

◆ isSubset()

bool gem5::AddrRange::isSubset ( const AddrRange r) const
inline

Determine if this range is a subset of another range, i.e.

if every address in this range is also in the other range. No check is made to ensure either range is valid.

Parameters
rRange to compare with
Returns
true if the this range is a subset of the other one

Definition at line 413 of file addr_range.hh.

References gem5::AddrRange::_end, gem5::AddrRange::_start, gem5::AddrRange::interleaved(), panic, gem5::MipsISA::r, gem5::AddrRange::size(), and gem5::AddrRange::to_string().

Referenced by gem5::memory::AbstractMemory::access(), gem5::BaseXBar::findPort(), gem5::memory::AbstractMemory::functionalAccess(), gem5::System::getDeviceMemory(), gem5::init_range(), gem5::memory::AbstractMemory::initState(), gem5::VMA::isSubset(), gem5::PMAChecker::isUncacheable(), gem5::BaseXBar::recvRangeChange(), and TEST().

◆ mergesWith()

bool gem5::AddrRange::mergesWith ( const AddrRange r) const
inline

Determine if another range merges with the current one, i.e.

if they are part of the same contigous range and have the same interleaving bits.

Parameters
rRange to evaluate merging with
Returns
true if the two ranges would merge

Definition at line 363 of file addr_range.hh.

References gem5::AddrRange::_end, gem5::AddrRange::_start, gem5::AddrRange::masks, and gem5::MipsISA::r.

Referenced by gem5::AddrRange::AddrRange(), gem5::init_range(), gem5::AddrRange::intersects(), gem5::VMA::mergesWith(), and TEST().

◆ operator!=()

bool gem5::AddrRange::operator!= ( const AddrRange r) const
inline

Definition at line 630 of file addr_range.hh.

References gem5::MipsISA::r.

◆ operator<()

bool gem5::AddrRange::operator< ( const AddrRange r) const
inline

Less-than operator used to turn an STL map into a binary search tree of non-overlapping address ranges.

Parameters
rRange to compare with
Returns
true if the start address is less than that of the other range

Definition at line 597 of file addr_range.hh.

References gem5::AddrRange::_start, gem5::AddrRange::interleaved(), gem5::AddrRange::intlvMatch, and gem5::MipsISA::r.

◆ operator==()

bool gem5::AddrRange::operator== ( const AddrRange r) const
inline

◆ RangeEx()

AddrRange gem5::RangeEx ( Addr  start,
Addr  end 
)
inline

◆ RangeIn()

AddrRange gem5::RangeIn ( Addr  start,
Addr  end 
)
inline

Definition at line 654 of file addr_range.hh.

Referenced by gem5::init_range(), and TEST().

◆ RangeSize()

AddrRange gem5::RangeSize ( Addr  start,
Addr  size 
)
inline

◆ removeIntlvBits()

Addr gem5::AddrRange::removeIntlvBits ( Addr  a) const
inline

Remove the interleaving bits from an input address.

This function returns a new address in a continous range [ start, start + size / intlv_bits). We can achieve this by discarding the LSB in each mask.

e.g., if the input address is of the form:

| a_high | x1 | a_mid | x0 | a_low |

where x0 is the LSB set in masks[0] and x1 is the LSB set in masks[1]

this function will return:

| 0 | a_high | a_mid | a_low |

Parameters
athe input address
Returns
the new address, or the input address if not interleaved

Definition at line 483 of file addr_range.hh.

References gem5::ArmISA::a, gem5::ctz64(), gem5::ArmISA::i, gem5::insertBits(), gem5::AddrRange::interleaved(), and gem5::AddrRange::masks.

Referenced by gem5::AddrRange::getOffset().

◆ size() [1/2]

template<typename V , int max_cache_size = 0>
std::size_t gem5::AddrRangeMap< V, max_cache_size >::size ( ) const
inline

Definition at line 235 of file addr_range_map.hh.

◆ size() [2/2]

Addr gem5::AddrRange::size ( ) const
inline

◆ start()

Addr gem5::AddrRange::start ( ) const
inline

Get the start address of the range.

Definition at line 317 of file addr_range.hh.

References gem5::AddrRange::_start.

Referenced by gem5::MemPool::allocate(), gem5::GPUComputeDriver::allocateGpuVma(), gem5::KvmVM::coalesceMMIO(), gem5::MuxingKvmGic::copyGicState(), gem5::KvmVM::delayedStartup(), gem5::VMA::fillMemPages(), gem5::X86ISA::TLB::finalizePhysical(), gem5::ArmISA::TLB::finalizePhysical(), sc_gem5::TlmToGem5Bridge< BITWIDTH >::get_direct_mem_ptr(), gem5::Gicv3::getRedistributorByAddr(), gem5::init_range(), gem5::memory::AbstractMemory::initState(), sc_gem5::TlmToGem5Bridge< BITWIDTH >::invalidateDmi(), gem5::VMA::isStrictSuperset(), gem5::Gicv3::read(), gem5::Gicv3Its::read(), gem5::Gicv3Redistributor::read(), gem5::Gicv3Distributor::read(), gem5::GenericTimerFrame::read(), gem5::GenericTimerMem::read(), gem5::GenericWatchdog::readControl(), gem5::SMMUv3::readControl(), gem5::GicV2::readCpu(), gem5::GicV2::readDistributor(), gem5::scmi::AgentChannel::readLength(), gem5::scmi::AgentChannel::readMessage(), gem5::GenericWatchdog::readRefresh(), gem5::scmi::AgentChannel::readStatus(), gem5::VMA::remap(), gem5::VMA::sanityCheck(), gem5::GPUComputeDriver::setMtype(), gem5::VMA::sliceRegionLeft(), gem5::VMA::sliceRegionRight(), gem5::VMA::start(), gem5::memory::AbstractMemory::start(), gem5::memory::AbstractMemory::toHostAddr(), gem5::GenericTimerMem::validateFrameRange(), gem5::Gicv3::write(), gem5::Gicv3Its::write(), gem5::Gicv3Redistributor::write(), gem5::Gicv3Distributor::write(), gem5::GenericTimerFrame::write(), gem5::GenericTimerMem::write(), gem5::scmi::PlatformChannel::writeBackMessage(), gem5::GenericWatchdog::writeControl(), gem5::SMMUv3::writeControl(), gem5::GicV2::writeCpu(), gem5::GicV2::writeDistributor(), and gem5::GenericWatchdog::writeRefresh().

◆ stripes()

uint32_t gem5::AddrRange::stripes ( ) const
inline

Determine the number of interleaved address stripes this range is part of.

Returns
The number of stripes spanned by the interleaving bits

Definition at line 291 of file addr_range.hh.

References gem5::AddrRange::masks.

Referenced by gem5::init_range().

◆ to_string()

std::string gem5::AddrRange::to_string ( ) const
inline

◆ valid()

bool gem5::AddrRange::valid ( ) const
inline

Generated on Tue Sep 21 2021 12:27:00 for gem5 by doxygen 1.8.17