|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sim.Cache
Implements a very simple cache simulation.
Nested Class Summary | |
(package private) class |
Cache.Line
|
(package private) class |
Cache.Set
|
Field Summary | |
(package private) int |
assoc
|
(package private) int |
lineSize
|
(package private) java.lang.String |
name
|
(package private) static java.util.Random |
rand
|
(package private) int |
readHits
|
(package private) int |
readMisses
|
(package private) Cache.Set[] |
sets
|
(package private) int |
writeHits
|
(package private) int |
writeMisses
|
Constructor Summary | |
Cache(java.lang.String name,
int numSets,
int assoc,
int lineSize)
Make a new cache with the given number of lines, associativity, and the given linesize. |
Method Summary | |
void |
dumpStats()
Dump the stats that have been collected thus far. |
void |
initialize()
|
boolean |
isHit(int addr)
Is the given address mapped in the cache? |
void |
read(int addr)
Do a read access of the cache. |
void |
write(int addr)
Implements a write-around policy on misses. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.lang.String name
Cache.Set[] sets
int readHits
int readMisses
int writeHits
int writeMisses
int lineSize
int assoc
static final java.util.Random rand
Constructor Detail |
public Cache(java.lang.String name, int numSets, int assoc, int lineSize)
Method Detail |
public boolean isHit(int addr)
public void read(int addr)
public void write(int addr)
public void initialize()
public void dumpStats()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |