-t input_trace_file
-s size
-a associativity
-b block_size
The cache size (-s) and block size (-b) are in bytes. The associativity is in the power of 2. The input trace file is here go_ld_trace (ZIP file). The file containd the trace of load instructions executed for some program. Each line represents a Byte address referenced by an executed load instruction. To help compress the traces, instead of storing the absolute memory byte address, we store the difference from the last address in the trace. An example of reading in the traces can be found in read_ld_trace.c. You need to use it or code up its equivalent to restore the trace file to the absolute memory addresses (instead of the difference). You should have the start of the trace you see as follows, and then use that trace for your cache simulator.
Here is the start of the trace file "go_ld_trace trace" you will be working with; once restored (make sure you see the
same load addresses) is:
536869800
536869816
1073839984
1073867968
1074199644
1074170256
536869696
1073839832
1074229644
1074196644
>cache-sim -t go_ld_trace -s 1024 -b 32 -a 2
program_name: go_ld_trace
cache_size: 1024
block_size: 32
associativity: 2
total_lds: 1500000
cache_hits: 1005939
cache_misses: 494061
cache_miss_rate:0.33
The maximum values your simulator needs to suport for each of the parameters (s,b,a) is 64K bytes for the cache size, 256 bytes for the block size, and the full associativity.
Three graphs, say by Excel, are required together with the data analysis and evaluation in your project report file:
For the first one, a line will be drawn;
the Y-axis for the graph will be the miss rate, and the
X-axis for the graphs will be the size of the cache (given the fixed block size 32; fixed associativity 4).
For results, you will need to run your cache simulator for "go" for cache sizes of 1KB,
2KB, 4KB, 8KB, 16 KB, 32KB, and 64KB of data.
For the second one, a line will be drawn;
the Y-axis for the graph will be the miss rate, and the
X-axis for the graphs will be the size of the block (given the fixed cache size 8192; fixed associativity 4).
For results, you will need to run your cache simulator for "go" for block sizes of 1,
2, 4, 8, 16, 32, and 64.
For the third one, a line will be drawn; the Y-axis for the graph will be the miss rate, and the X-axis for the graphs will be the associativity (given the fixed cache size 8192; fixed block size 32). For results, you will need to run your cache simulator for "go" for associativity of 1, 2, 4, 8, 16, 32, and the fully associative.
Your simulator will be examined by using different parameters. The correct funcationality is the first and the primary metric. But the coding convention and execution speed are metrics too.
cache-sim -t go_ld_trace -s 1024 -b 32 -a 4
program_name: go_ld_trace
cache_size: 1024
block_size: 32
associativity: 4
total_lds:
1500000
cache_hits: 1036092
cache_misses: 463908
cache_miss_rate:
0.31
cache-sim -t go_ld_trace -s 2048 -b 32 -a 4
program_name: go_ld_trace
cache_size: 2048
block_size: 32
associativity: 4
total_lds:
1500000
cache_hits: 1212014
cache_misses: 287986
cache_miss_rate:
0.192
cache-sim -t go_ld_trace -s 2048 -b 32 -a 64
program_name: go_ld_trace
cache_size: 2048
block_size: 32
associativity: 64
total_lds:
1500000
cache_hits: 1232218
cache_misses: 267782
cache_miss_rate:
0.18
cache-sim -t go_ld_trace -s 8192 -b 32 -a 256
program_name: go_ld_trace
cache_size: 8192
block_size: 32
associativity: 256 (fully associative)
total_lds:
1500000
cache_hits: 1476159
cache_misses: 23841
cache_miss_rate:
0.0159
cache-sim -t go_ld_trace -s 4096 -b 32 -a 1
program_name: go_ld_trace
cache_size: 4096
block_size: 32
associativity: 1 (Direct Mapped Cache)
total_lds:
1500000
cache_hits: 1252626
cache_misses: 247374
cache_miss_rate:
0.1649