-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
34 lines (25 loc) · 1003 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
README
Author: Carlos Reyes
This is a simple cache simulator implemented in Java, its purpose is to show you what happens in a cache
when a given set of instructions are fed in, for each instruction there is a corresponding output that
tells the user what the result of the instruction was.
Compile and run in terminal
javac CachesimEngine.java
java CachesimEngine filename x y z
Where x should be replaced by size of cache in MB (ex 2 => 2MB)
Where y should be replaced by the associativity (ex 4 => 4 way set associative)
Where z should be the size of each block in bytes (ex 8 => 8-byte blocks)
Notes: The replacement policy is LRU, the size of each address is 24-bits, cache is write-through
no allocate, see below for the input file format.
Input file format:
instruction hex-adress size (data)
Example file:
store 0x34ab00 2 19ab
store 0x34ab02 2 18cd
load 0x34ab00 4
store 0x3aab00 2 19dd
store 0x3aab02 2 18bb
load 0x3aab00 4
store 0x34ab00 2 19ab
store 0x34ab02 2 18cd
load 0x34ab00 8