gem5  v20.1.0.0
Functions
utils.hh File Reference
#include "base/types.hh"

Go to the source code of this file.

Functions

Addr addrBlockOffset (Addr addr, Addr block_size)
 Calculates the offset of a given address wrt aligned fixed-size blocks. More...
 
Addr addrBlockAlign (Addr addr, Addr block_size)
 Returns the address of the closest aligned fixed-size block to the given address. More...
 
bool transferNeedsBurst (Addr addr, unsigned int size, unsigned int block_size)
 Returns true if the given memory access (address, size) needs to be fragmented across aligned fixed-size blocks. More...
 
bool isAnyActiveElement (const std::vector< bool >::const_iterator &it_start, const std::vector< bool >::const_iterator &it_end)
 Test if there is any active element in an enablement range. More...
 

Function Documentation

◆ addrBlockAlign()

Addr addrBlockAlign ( Addr  addr,
Addr  block_size 
)
inline

Returns the address of the closest aligned fixed-size block to the given address.

Parameters
addrInput address.
block_sizeBlock size in bytes.
Returns
Address of the closest aligned block.

Definition at line 63 of file utils.hh.

References addr.

Referenced by LSQ< Impl >::SplitDataRequest::initiateTranslation().

◆ addrBlockOffset()

Addr addrBlockOffset ( Addr  addr,
Addr  block_size 
)
inline

Calculates the offset of a given address wrt aligned fixed-size blocks.

Parameters
addrInput address.
block_sizeBlock size in bytes.
Returns
Offset of the given address in bytes.

Definition at line 50 of file utils.hh.

References addr.

Referenced by AtomicSimpleCPU::genMemFragmentRequest(), CheckerCPU::genMemFragmentRequest(), Minor::LSQ::SplitDataRequest::makeFragmentRequests(), and transferNeedsBurst().

◆ isAnyActiveElement()

bool isAnyActiveElement ( const std::vector< bool >::const_iterator &  it_start,
const std::vector< bool >::const_iterator &  it_end 
)
inline

◆ transferNeedsBurst()

bool transferNeedsBurst ( Addr  addr,
unsigned int  size,
unsigned int  block_size 
)
inline

Returns true if the given memory access (address, size) needs to be fragmented across aligned fixed-size blocks.

Parameters
addrAddress of the memory access.
sizeSize of the memory access.
block_sizeBlock size in bytes.
Returns
True if the memory access needs to be fragmented.

Definition at line 77 of file utils.hh.

References addr, and addrBlockOffset().

Referenced by Minor::LSQ::pushRequest(), and LSQ< Impl >::pushRequest().


Generated on Wed Sep 30 2020 14:02:18 for gem5 by doxygen 1.8.17