Professional Documents
Culture Documents
ACA Project Report Final
ACA Project Report Final
Dr. M S Bhat
By
Aamodh.K (15VL01F)
Dokula Ashok Kumar (15VL08F)
Vikas Bhardwaj (15VL26F)
(M.Tech VLSI Design)
As a part of
VL722: Advanced Computer Architecture
CONTENTS
CONTENTS
LIST OF FIGURES
ii
1. Problem Statement
2. Design Description
3. Design Approach
REFERENCES
Page i
LIST OF FIGURES
Figure 1: System Block Layout
Page ii
2015
1. Problem Statement
Goal: To design cache memory for uni-processor system using Verilog HDL.
Features:
The project aims at designing and testing the above mentioned memory hierarchy of cache
memory for uni-processor system and obtain the simulation results using Xilinx ISE
platform.
Page 1
2015
2. Design Description
The design consists of one level of cache memory and a cache controller that communicates
between microprocessor and cache memory to carry out memory related operations. The
size and specifications of the cache memory are stated in the problem statement above and
the design approach is described in the next section.
Note: The functionality in point 5 is not modeled in our project. In our project cache
controller gives a signal (memRead and memWrite in code) to the microprocessor that a
cache miss has occurred in cache. The action taken by microprocessor is not a part of our
project.
Page 2
2015
Page 3
2015
Page 4
2015
Cache Controller
The following diagram depicts all the signals of the cache controller that are used to carry
out all memory related operations between microprocessor and cache.
Output signals:
dataOut : The byte output from the cache.
memWrite : Asserted when main memory write is performed because of cache miss.
It is HIGH if cache write miss has occurred.
memRead : Asserted when main memory read is to be performed because of cache
miss. It is HIGH if cache read miss has occurred.
Page 5
2015
3. Design Approach
The project is designed using the Hardware Descriptive Language - Verilog. Xilinx ISE Design
Suite 13.1 was used to simulate the design.
The basic storage element in the memory is modeled using a D flip-flop. Each D flipflop stores a single bit.
An array of 8 such storage elements is created to form a byte of data.
An array of 16 such bytes is formed to create a Cache Block. This cache block contains
4 words of 4 bytes each.
Then, an array of 256 such cache blocks are created to form a Cache Way.
Finally, an array of 4 such Cache Ways are created to form the 4 way Set Associative
Cache.
The tag size in our design is 12 bits. Hence, corresponding to each set, a 12 bit register
is created to store tag using D flip-flop module.
A 12 bit comparator is created to compare the tags of a particular set and the tag field
in the processor generated address.
In case of a cache miss, Random Replacement policy is used.
In case more than one cache block in a set is allocated same tag, in order to avoid
conflict, a 4-to-2 priority encoder module is designed and used. Priority is given to the
cache block in the way with highest index.
Decoders and multiplexers of suitable size are used for the purpose of decoding the
address and selecting required data respectively.
Page 6
2015
Observations
From the plot shown in next page, the following observations can be made.
1. Until 20ns, there is no instance of cache hit. This can be observed from the fact that
at any instance either memRead is HIGH or memWrite is HIGH. Since no data is
written into cache till now, dataOut is xxxxxxxx.
2. At 20ns, the tag field of processor generated address byteAddr and the tag
corresponding to set select field of byteAddr are the same.
3. At 30ns, i.e, at the next positive clock edge, cache hit is detected. Notice both
memWrite and memRead being LOW. The one cycle latency is because certain
modules are called at one positive clock edge in cache controller module and are
executed at next positive clock edge.
4. At 180ns, dataIn changes. But since there is no cache hit, dataIn is not transferred to
data bus.
5. At 380ns, even though the tag remains same the valid bit (most significant bit of
randomTag) is made 0. Hence there is a cache miss indicated by either memRead or
memWrite being HIGH at a given instant.
6. At 760ns, rst is made HIGH. So, the data bus is cleared. Also, cache hit is not detected
even though the tags are matching.
Page 7
2015
Simulation plot
Page 8
2015
REFERENCES:
1. J.L. Hennessy and D. A. Patterson, Computer Architecture A quantitative approach,
4th edition.
2. M.S. Bhat, Course Slides for VL722: Advanced Computer Architecture, National
Institute of Technology Karnataka at Surathkal, Odd semester, 2015.
3. P.K. Biswas, Lectures 19 and 20 of NPTEL Video Lectures for Operating Systems, Indian
Institute of Technology, Kharagpur.
Page 9