cache memory - upload.wikimedia.org · memory 5 young won lim 5/23/16 cache : storing a partial...
TRANSCRIPT
![Page 1: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/1.jpg)
Young Won Lim5/23/16
Cache Memory
![Page 2: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/2.jpg)
Young Won Lim5/23/16
Copyright (c) 2010-2016 Young W. Lim.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
Please send corrections (or suggestions) to [email protected].
This document was produced by using OpenOffice.
![Page 3: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/3.jpg)
Memory 3 Young Won Lim5/23/16
Address is used as an index to a data array
Memory Unit2k words
n-bit per word
Input n-bit Data
Output n-bit Data
0000000100100011010001010110011110001001101010111100110111101111
k-bit Address n-bit data
24 words
k-bit Address
Read
Write
index
![Page 4: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/4.jpg)
Memory 4 Young Won Lim5/23/16
MM Address Decoder
k-bit Address
n-bit data
en.wikipedia.org
AddressDecoder
![Page 5: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/5.jpg)
Memory 5 Young Won Lim5/23/16
Cache : Storing a partial copy of MM
0000000100100011010001010110011110001001101010111100110111101111
(MM Address, Data) pair
dataMM Address
010001011000100110101011
Cache Memory
Main Memory
![Page 6: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/6.jpg)
Memory 6 Young Won Lim5/23/16
Cache Memory : two components
Cache Memory
Tag Cache Directory
DataMM Address
Data
Cache Array
![Page 7: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/7.jpg)
Memory 7 Young Won Lim5/23/16
Accessing Cache Memory : Address Matching
CacheMemory
Tag MemoryCache Directory
DataMM Address
DataCache Array
Address
Match
Hit
from CPU
to / from CPU
![Page 8: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/8.jpg)
Cache Memory 8 Young Won Lim5/23/16
CAM (Content Addressable Memory) Interface
DIN[M:0]WR_ADDR[logN:0]DATA_MASK[M:0]CMP_DIN[M:0]CMP_DATA_MASK[M:0]
CLKENWE
MATCH_ADDR[J:0]MULTIPLE_MATCH
SINGLE_MATCH
BUSYREAD_WARNING
xapp1151_Param_CAM.pdf
Xilinx CAM
![Page 9: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/9.jpg)
Cache Memory 9 Young Won Lim5/23/16
CAM Read Operation – Search a key
DIN[M:0]
CLKENWE
MATCH_ADDR[J:0]MULTIPLE_MATCH
SINGLE_MATCH
xapp1151_Param_CAM.pdf
CAM Address
0
Search Data
CA
M A
ddre
ss
Search DataSearch Data
match?
0
![Page 10: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/10.jpg)
Cache Memory 10 Young Won Lim5/23/16
Write Operation
DIN[M:0]WR_ADDR[logN:0]
CLKENWE
xapp1151_Param_CAM.pdf
CAM AddressWrite Data
CA
M A
ddre
ss
Search Data
write
10
![Page 11: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/11.jpg)
Cache Memory 11 Young Won Lim5/23/16
Simultaneous Read / Write
DIN[M:0]WR_ADDR[logN:0]DATA_MASK[M:0]CMP_DIN[M:0]CMP_DATA_MASK[M:0]
CLKENWE
BUSYREAD_WARNING
xapp1151_Param_CAM.pdf
1
EN=1 simultaneous write/read
Simultaneous Read/Write Simultaneous write and search operationsWith an output to warn the user of possible collisionRead warning flag:
The data applied to the CAM for a readMatches the data that is currently being written into the CAMBy unfinished write operation
Search Data
Write DataCAM Address
MATCH_ADDR[J:0]MULTIPLE_MATCH
SINGLE_MATCH
CAM Address
![Page 12: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/12.jpg)
Cache Memory 12 Young Won Lim5/23/16
CAM (Content Addressable Memory)
DIN[M:0]WR_ADDR[logN:0]DATA_MASK[M:0]CMP_DIN[M:0]CMP_DATA_MASK[M:0]
CLKENWE
MATCH_ADDR[J:0]MULTIPLE_MATCH
SINGLE_MATCH
BUSYREAD_WARNING
xapp1151_Param_CAM.pdf
1
Cache Address
EN=1 simultaneous write/read
DIN[M:0] Data in Bus The data to be written into The data read from the CAM
Simultaneous read/write modeCMP_DIN for the read operation
Standard Ternary modeDIN DATA_MASK0 0 01 0 10 1 X1 1 X
CMP_DIN[M:0] Compare Data In BusSimultaneous read/write
The data read from the CAMTernary mode
One of the two input busesTo determine the bit value During read operation
![Page 13: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/13.jpg)
Cache Memory 13 Young Won Lim5/23/16
SRAM Cell
CMOS VLSI Design 4th ed, Weste
bit bit_b
word
![Page 14: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/14.jpg)
Cache Memory 14
R
Sinput
select
output
Read / Write
Read / Write = 1→ READ op
Read / Write = 0→ WRITE op
BC
select
Read / Write
input output
SRAM Bit Cell RTL Model
Q
![Page 15: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/15.jpg)
Cache Memory 15
R
Sinput
select
output
Read / Write = 1→ READ op
SRAM Bit Cell Read & Write Operations
Q
R
SInput x
select
output
Read / Write = 0→ WRITE op
Q0
0
0
x
xb
1
10
S=1
R=0
SET
S=0
R=1
RESET
S=0
R=0
HOLD Q=old Q
Q=old Q
Q=1
Q=0
Q=0
Q=1
Input x=1
Input x=0
![Page 16: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/16.jpg)
Cache Memory 16 Young Won Lim5/23/16
10T CAM Cell
bit bit_b
match
word
CMOS VLSI Design 4th ed, Weste
![Page 17: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/17.jpg)
Cache Memory 17
BC
select
Read / Write
input output
SRAM Bit Cell RTL Model
match_out
match_in
out
![Page 18: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/18.jpg)
Cache Memory 18
R
Sinput
select
output
Read / Write
Read / Write = 1→ READ op
Read / Write = 0→ WRITE op
BC'
select
read / write
input output
CAM Bit Cell RTL Model
Q
match_out
match_out
match_in
match_in
![Page 19: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/19.jpg)
Cache Memory 19
CAM Bit Cell RTL Model – Read / Write Operations
R
Sinput
select
output
Q
R
Sinput
select
output
Q
S=1
R=0
SET
S=0
R=1
RESET
S=0
R=0
HOLD Q=old Q
Q=old Q
Q=1
Q=0
Q=0
Q=1
Input x=1
Input x=0
Read / Write = 1→ READ op
Read / Write = 0→ WRITE op
match_out
0
0
0 1
x
xb
0
0
match_out
0
match_in match_in
![Page 20: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/20.jpg)
Cache Memory 20
BC
select
Read / Write
input output
2x2 CAM Bit Cell RTL Model
match_out
match_inout
BC
select
Read / Write
Ain1
output
match_out
match_inout
BC
select
Read / Write
input output
match_out
match_inout
BC
select
Read / Write
input output
match_out
match_inout
select
select
r/w
Ain0
Aout1 Aout0
![Page 21: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/21.jpg)
Cache Memory 21
Diagram for a 4x4 Memory
BCinput outpu
tBC
select
2-bit addr 4-bit word
A1
A0
I3 I2 I1 I0
O3 O2 O1 O0R/W
2 x 4decoder
BCinput outpu
tBC
select
BCinput outpu
tBC
select
BCinput outpu
tBC
select
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
BCBC
R/W R/W R/W R/W
BC
select
Read / Write
input output
match_out
match_inout
BC
select
Read / Write
Ain1
output
match_out
match_inout
BC
select
Read / Write
input output
match_out
match_inout
BC
select
Read / Write
input output
match_out
match_inout
select
select
r/w
Ain0
Aout1 Aout0
Tag Cache Directory
DataMM Address
Data
Cache Array
![Page 22: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/22.jpg)
Cache Memory 22 Young Won Lim5/23/16
Cache Organization
8 sets 1-way 1 line / set
4 sets 2-way 2 lines / set
2 sets 4-way 4 lines / set
1 set 8-way 8 lines / set
![Page 23: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/23.jpg)
Cache Memory 23 Young Won Lim5/23/16
Direct Mapping
8 sets 1-way 1 line / set
CacheMemory
MainMemory
![Page 24: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/24.jpg)
Cache Memory 24 Young Won Lim5/23/16
2-Way Set Associative Mapping
4 sets 2-way 2 lines / set
CacheMemory
MainMemory
![Page 25: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/25.jpg)
Cache Memory 25 Young Won Lim5/23/16
4-way Set Associative Mapping
2 sets 4-way 4 line / set
CacheMemory
MainMemory
![Page 26: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/26.jpg)
Cache Memory 26 Young Won Lim5/23/16
Fully Associative Mapping
1 sets 8-way 8 line / set
CacheMemory
MainMemory
![Page 27: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/27.jpg)
Cache Memory 27 Young Won Lim5/23/16
Tag Field
8 sets 1-way 1 line / set
4 sets 2-way 2 lines / set
2 sets 4-way 4 lines / set
1 set 8-way 8 lines / set
tag set block
![Page 28: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/28.jpg)
Cache Memory 28 Young Won Lim5/23/16
Cache Mapping Method (set-view)
8 sets 1-way 1 line / set
4 sets 2-way 2 lines / set
2 sets 4-way 4 lines / set
1 set 8-way 8 lines / set
![Page 29: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/29.jpg)
Cache Memory 29 Young Won Lim5/23/16
Cache Mapping Method (set-view)
8 sets 1-way 1 line / set
4 sets 2-way 2 lines / set
2 sets 4-way 4 lines / set
1 set 8-way 8 lines / set
![Page 30: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/30.jpg)
Cache Memory 30 Young Won Lim5/23/16
Cache Mapping Method (way-view)
8 sets 1-way 1 line / set
4 sets 2-way 2 lines / set
2 sets 4-way 4 lines / set
1 set 8-way 8 lines / set
![Page 31: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/31.jpg)
Cache Memory 31 Young Won Lim5/23/16
CAM (Content Addressable Memory)
![Page 32: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/32.jpg)
Cache Memory 32 Young Won Lim5/23/16
CAM (Content Addressable Memory)
![Page 33: Cache Memory - upload.wikimedia.org · Memory 5 Young Won Lim 5/23/16 Cache : Storing a partial copy of MM 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110](https://reader034.vdocument.in/reader034/viewer/2022042304/5ed0014701eb6c0e463244ff/html5/thumbnails/33.jpg)
Young Won Lim5/23/16
References
[1] http://en.wikipedia.org/[2] https://en.wikiversity.org/wiki/The_necessities_in_SOC_Design[3] https://en.wikiversity.org/wiki/The_necessities_in_Digital_Design[4] https://en.wikiversity.org/wiki/The_necessities_in_Computer_Design[5] https://en.wikiversity.org/wiki/The_necessities_in_Computer_Architecture[6] https://en.wikiversity.org/wiki/The_necessities_in_Computer_Organization[7] https://en.wikiversity.org/wiki/Understanding_Embedded_Software[8] Digital Systems, Hill, Peterson, 1987