gem5  v20.1.0.0
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DecodeCache::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...
 
Value & lookup (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 DecodeCache::AddrMap< Value, CacheChunkShift >

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

Definition at line 46 of file decode_cache.hh.

Member Typedef Documentation

◆ ChunkIt

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

Definition at line 70 of file decode_cache.hh.

◆ ChunkMap

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

Definition at line 69 of file decode_cache.hh.

Constructor & Destructor Documentation

◆ AddrMap()

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

Constructor.

Definition at line 121 of file decode_cache.hh.

Member Function Documentation

◆ chunkOffset()

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

Definition at line 52 of file decode_cache.hh.

Referenced by DecodeCache::AddrMap< RefCountingPtr >::lookup().

◆ chunkStart()

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

Definition at line 58 of file decode_cache.hh.

Referenced by DecodeCache::AddrMap< RefCountingPtr >::getChunk().

◆ getChunk()

template<class Value , Addr CacheChunkShift = 12>
CacheChunk* DecodeCache::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 89 of file decode_cache.hh.

Referenced by DecodeCache::AddrMap< RefCountingPtr >::lookup().

◆ lookup()

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

Definition at line 127 of file decode_cache.hh.

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

◆ update()

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

Update the mini cache of recent lookups.

Parameters
recentestThe most recent result;

Definition at line 78 of file decode_cache.hh.

Referenced by DecodeCache::AddrMap< RefCountingPtr >::getChunk().

Member Data Documentation

◆ CacheChunkBytes

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

◆ chunkMap

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

◆ recent

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

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

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