Professional Documents
Culture Documents
Report
Report
GROUP-17
Members
Mayank Bansal
Professor: Roll-20111032
Dr. Mainak Chaudhury
Department of Computer Science
Hirak Mondal
Roll-20111022
Multi Level Cache Simulator Mayank Bansal, Hirak Mondal
INTRODUCTION
A program to simulate L1 cache misses through L2, L3 cache hierarchy for various
applications. There are 3 inclusion policies which are Inclusive, Exclusive and NINE.
We have implemented 2 parts in this assignment.
• Part 1: 8 way LRU Level 2 cache and 16 way LRU level 3 cache
• Part 2: 8 way LRU Level 2 cache and Fully Associative LRU level 3 cache
At first u need to paste all the trace files within the traces directory.
To generate the readable trace files you need to run the read.cpp code present
under the main directory which will generate all the trace files in .out format
inside the given directory named output. In Linux environment use the following
commands to run the file, but first you have to set your working directory path to
the location where the read.cpp file is.
Note that, read.cpp file is reading the traces from directory named traces, so
DO NOT MOVE or DELETE the traces directory.
PROBLEM 1
• There are 3 separate code files provided. One for INCLUSIVE named
INCLUSIVE.py, another one for EXCLUSIVE named EXCLUSIVE.py and
the last one is for NINE named NINE.py They are provided inside the directory
named output, the same location where all the .out files are generated by
1
Multi Level Cache Simulator Mayank Bansal, Hirak Mondal
read.cpp.
• In Linux environment use the following commands to run the files, but first you
have to set your working directory path to the location where these files are saved.
Note that, these 3 files MUST be present in the output directory which contains
the .out files. So Do NOT MOVE or DELETE these files from the output
directory.
PROBLEM 2 (LRU)
The code for the second question Problem2.cpp is provided inside the traces
directory, since it is directly reading from the trace files. In Linux environment use
the following commands to run the file, but first you have to set your working
directory path to the location where the Problem2.cpp file is.
Note that, Problem2.cpp file is reading the traces from the directory named
traces, so DO NOT MOVE or DELETE the Problem2.cpp from the traces
directory.
2
Multi Level Cache Simulator Mayank Bansal, Hirak Mondal
RESULTS PROBLEM 1
3
Multi Level Cache Simulator Mayank Bansal, Hirak Mondal
4
Multi Level Cache Simulator Mayank Bansal, Hirak Mondal
OBSERVATIONS IN PROBLEM 1
This is the case because the blocks present in the L2 cache in case of EXCLUSIVE
and in case of NINE are same. This is NOT the case for INCLUSIVE because of
the eviction policy. When a block is evicted from the L3 cache in INCLUSIVE
then it must also be invalidated in the L2 cache which is NOT the case for NINE
and in case of EXCLUSIVE we have completely different strategy to fill L3 cache,
only when a block is evicted from L2. So L3 eviction does not effect in NINE and
EXCLUSIVE unlike INCLUSIVE. That is why the Hits and Misses of NINE and
EXCLUSIVE is same.
This is because in INCLUSIVE policy if we evict a block from the L3 cache then
we also have to invalidate it from the L2 cache despite whether its the LRU block
or not. This leads to greater misses in inclusive policy as compared to other two
policies.
In case of Exclusive cache replacement, we do not posses 2 copies of the same block
in both the cache at a same time. So L3 cache of Exclusive cache replacement policy
has all unique blocks in it, which are not present in L2 cache. So total number of
blocks present in L2 and L3 cache combined in Exclusive is more than other two
replacement policies. Hence the miss of L3 cache in Exclusive is relatively less than
NINE and Inclusive.
5
Multi Level Cache Simulator Mayank Bansal, Hirak Mondal
COLD MISSES: The Number Of Blocks Which Are Referenced For The First
Time
Negative Conflict miss for FA L3 cache signifies that the cache misses in FA L3 cache
is much higher than cache miss in 16-way set associative L3 cache. In such cases
conflict misses are negative.