gem5  v22.0.0.1
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
gem5::decode_cache::AddrMap< Value, CacheChunkShift > Class Template Reference

A sparse map from an Addr to a Value, stored in page chunks. More...

#include <decode_cache.hh>

Classes

struct  CacheChunk
 

Public Member Functions

 AddrMap ()
 Constructor. More...
 
Valuelookup (Addr addr)
 

Protected Types

typedef std::unordered_map< Addr, CacheChunk * > ChunkMap
 
typedef ChunkMap::iterator ChunkIt
 

Protected Member Functions

void update (ChunkIt recentest)
 Update the mini cache of recent lookups. More...
 
CacheChunkgetChunk (Addr addr)
 Attempt to find the CacheChunk which goes with a particular address. More...
 

Static Protected Member Functions

static constexpr Addr chunkOffset (Addr addr)
 
static constexpr Addr chunkStart (Addr addr)
 

Protected Attributes

ChunkIt recent [2]
 
ChunkMap chunkMap
 

Static Protected Attributes

static constexpr Addr CacheChunkBytes = 1ULL << CacheChunkShift
 

Detailed Description

template<class Value, Addr CacheChunkShift = 12>
class gem5::decode_cache::AddrMap< Value, CacheChunkShift >

A sparse map from an Addr to a Value, stored in page chunks.

Definition at line 51 of file decode_cache.hh.

Member Typedef Documentation

◆ ChunkIt

template<class Value , Addr CacheChunkShift = 12>
typedef ChunkMap::iterator gem5::decode_cache::AddrMap< Value, CacheChunkShift >::ChunkIt
protected

Definition at line 75 of file decode_cache.hh.

◆ ChunkMap

template<class Value , Addr CacheChunkShift = 12>
typedef std::unordered_map<Addr, CacheChunk *> gem5::decode_cache::AddrMap< Value, CacheChunkShift >::ChunkMap
protected

Definition at line 74 of file decode_cache.hh.

Constructor & Destructor Documentation

◆ AddrMap()

template<class Value , Addr CacheChunkShift = 12>
gem5::decode_cache::AddrMap< Value, CacheChunkShift >::AddrMap ( )
inline

Constructor.

Definition at line 126 of file decode_cache.hh.

Member Function Documentation

◆ chunkOffset()

template<class Value , Addr CacheChunkShift = 12>
static constexpr Addr gem5::decode_cache::AddrMap< Value, CacheChunkShift >::chunkOffset ( Addr  addr)
inlinestaticconstexprprotected

◆ chunkStart()

template<class Value , Addr CacheChunkShift = 12>
static constexpr Addr gem5::decode_cache::AddrMap< Value, CacheChunkShift >::chunkStart ( Addr  addr)
inlinestaticconstexprprotected

◆ getChunk()

template<class Value , Addr CacheChunkShift = 12>
CacheChunk* gem5::decode_cache::AddrMap< Value, CacheChunkShift >::getChunk ( Addr  addr)
inlineprotected

Attempt to find the CacheChunk which goes with a particular address.

First check the small cache of recent results, then actually look in the hash map.

Parameters
addrThe address to look up.

Definition at line 94 of file decode_cache.hh.

Referenced by gem5::decode_cache::AddrMap< gem5::GenericISA::BasicDecodeCache::AddrMapEntry >::lookup().

◆ lookup()

template<class Value , Addr CacheChunkShift = 12>
Value& gem5::decode_cache::AddrMap< Value, CacheChunkShift >::lookup ( Addr  addr)
inline

Definition at line 132 of file decode_cache.hh.

Referenced by gem5::X86ISA::Decoder::doResetState().

◆ update()

template<class Value , Addr CacheChunkShift = 12>
void gem5::decode_cache::AddrMap< Value, CacheChunkShift >::update ( ChunkIt  recentest)
inlineprotected

Update the mini cache of recent lookups.

Parameters
recentestThe most recent result;

Definition at line 83 of file decode_cache.hh.

Referenced by gem5::decode_cache::AddrMap< gem5::GenericISA::BasicDecodeCache::AddrMapEntry >::getChunk().

Member Data Documentation

◆ CacheChunkBytes

template<class Value , Addr CacheChunkShift = 12>
constexpr Addr gem5::decode_cache::AddrMap< Value, CacheChunkShift >::CacheChunkBytes = 1ULL << CacheChunkShift
staticconstexprprotected

◆ chunkMap

template<class Value , Addr CacheChunkShift = 12>
ChunkMap gem5::decode_cache::AddrMap< Value, CacheChunkShift >::chunkMap
protected

◆ recent

template<class Value , Addr CacheChunkShift = 12>
ChunkIt gem5::decode_cache::AddrMap< Value, CacheChunkShift >::recent[2]
protected

The documentation for this class was generated from the following file:

Generated on Sat Jun 18 2022 08:13:42 for gem5 by doxygen 1.8.17