cse378
Class AbstractLine

java.lang.Object
  extended by cse378.AbstractLine
Direct Known Subclasses:
CacheLine, TLBLine

public abstract class AbstractLine
extends java.lang.Object

Abstract class representing a line in the cache or TLB A line has a number of Blocks, and keeps track of which is the least recently used


Field Summary
protected  TaggedBlock[] entries
           
protected  int entrySize
           
protected  java.util.LinkedList<TaggedBlock> recent
           
protected  int sets
           
protected  int tagBits
           
 
Constructor Summary
AbstractLine()
           
 
Method Summary
 TaggedBlock allocEntry()
          Pick an AbstractBlock to receive new data.
 TaggedBlock getEntry(int index)
          getEntry returns the TaggedBlock indexed by index
 TaggedBlock getLRU()
          getLRU return index of least recently used CacheEntry
protected  void indexCheck(int index)
          Verify that an index into the line is valid
 TaggedBlock probe(BitField tag)
          Test if there is a valid taggedEntry with a matching Tag
 void setMRU(TaggedBlock e)
          setMRU makes indexed CacheEntry the MRU
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sets

protected int sets

tagBits

protected int tagBits

entrySize

protected int entrySize

entries

protected TaggedBlock[] entries

recent

protected java.util.LinkedList<TaggedBlock> recent
Constructor Detail

AbstractLine

public AbstractLine()
Method Detail

indexCheck

protected void indexCheck(int index)
Verify that an index into the line is valid

Parameters:
index -

setMRU

public void setMRU(TaggedBlock e)
setMRU makes indexed CacheEntry the MRU

Parameters:
index - set of the cacheEntry

getLRU

public TaggedBlock getLRU()
getLRU return index of least recently used CacheEntry

Parameters:
index - set of the cacheEntry

getEntry

public TaggedBlock getEntry(int index)
getEntry returns the TaggedBlock indexed by index

Parameters:
index - AbstractBlock within the cacheline
Returns:
CacheEntry specified by index

allocEntry

public TaggedBlock allocEntry()
Pick an AbstractBlock to receive new data.

Returns:
allocated AbstractBlock

probe

public TaggedBlock probe(BitField tag)
Test if there is a valid taggedEntry with a matching Tag

Parameters:
tag - tag in question
Returns:
AbstractBlock if found, null otherwise