Comparison of Cache Replacement Policies using GEM 5














- Slides: 14
Comparison of Cache Replacement Policies using GEM 5 Simulator Teammates – Bhagyashree Nivin Sri Divya
Research Ideas 1. Increase the cache levels 2. Cache Replacement Favors a specific locality 3. Mixing of Cache Replacement algorithm in different levels 4. Cache associativity
Gem 5 Simulator Install : hg clone http: //repo. gem 5. org/gem 5 -stable Build: build gem 5 with “scons” e. g scons build/X 86/gem 5. opt We are using matrix multiplication program for performance Evaluation.
Cache Replacement Favors a specific locality 9220000 for ( int i=0; i<n; i++) for(int j=0; j<n; j++) data += a[j][i]; 9200000 9180000 9160000 9140000 9120000 9100000 9080000 9060000 1 2 FIFO 3 LRU 4 RANDOM 5
Level 2 Cache Hierarchy
Set Associativity 1, 2 1 0, 8 2 way 0, 6 4 way 0, 4 248 8 way 842 0, 2 0 L 1 L 2 L 3 (random) L 1 (lru) L 2 (lru) L 3 (lru)
Inclusive & Exclusive Caches
Three Level Cache System Architecture
Configuration – Different Cache Policy on Different Levels • Configuration – 1 Ghz clock machine – Coherent crossbar
Different Cache Policy Matrix Size 32 1 0, 9 0, 8 0, 7 0, 6 L 1_D 0, 5 L 1_I 0, 4 0, 3 L 2 0, 2 L 3 0, 1 nd ra ru _l nd ifo ra ra nd _f d an _r ifo lru _f lru ru ru _l fif o 0 fifo_lru lru_fifo lru_rand_fifo rand_lru fifo_lru fifo_rand lru_elr lru_fifo lru_rand_fifo rand_lru 32 32 32 64 64 64 0. 017048 0. 017067 0. 017072 0. 016284 0. 016296 0. 016278 0. 017586 0. 017633 0. 01762 0. 00639 0. 006389 0. 00639 0. 005923 0. 005922 0. 00595 0. 00594 0. 006615 0. 006635 0. 006628 0. 001168 0. 001087 0. 001173 0. 001171 0. 000479 0. 000446 0. 000479 0. 000483 0. 723251 0. 70857 0. 738064 0. 743995 0. 757223 0. 771287 0. 719603 0. 701898 0. 68781 0. 686542 0. 673001 0. 699861 0. 853641 0. 853461 0. 733174 0. 7451 0. 681471 0. 662083 0. 64979 0. 913687 0. 925618 0. 886211 0. 928317 0. 911181 0. 899801 0. 888849 0. 912015 0. 932473 0. 913393 0. 922829 0. 884465 0. 999789 1 0. 912532 0. 902349 0. 885869 0. 911556 0. 930711
Matrix Size 128 1, 2 1 0, 8 L 1_D 0, 6 L 1_I L 2 0, 4 L 3 0, 2 fifo 128 0. 01909 0. 000086 0. 07945 0. 693392 fifo_lru 128 0. 019127 0. 000086 0. 075329 0. 755658 fifo_rand 128 0. 019102 0. 000086 0. 081351 0. 675566 lru 128 0. 018813 0. 00008 0. 076337 0. 731806 lru_el 128 0. 018695 0. 00008 0. 085995 0. 755884 lru_elr 128 0. 018689 0. 00008 0. 065093 0. 998414 lru_fifo 128 0. 018768 0. 00008 0. 08044 0. 722336 lru_rand 128 0. 018784 0. 00008 0. 082309 0. 680509 rand 128 0. 017315 0. 000087 0. 090181 0. 707026 rand_fifo 128 0. 017325 0. 000086 0. 087353 0. 69527 rand_lru 128 0. 017355 0. 000086 0. 082081 0. 737382 lru 256 0. 018309 0. 000011 0. 99013 0. 050849 lru_el 256 0. 018376 0. 000011 0. 996695 0. 520432 lru_elr 256 0. 018314 0. 000011 0. 989714 0. 524697 l lru _e lru ra nd ru nd _l ifo ra _f nd ra lru _r a nd o _f if lru nd ra fif o_ _l ru fif o 0 Matrix Size 64 1, 2 1 0, 8 L 1_D 0, 6 L 1_I 0, 4 L 2 L 3 0, 2 _e l lru lr lru _e d ra n lru d_ ra nd _f ifo d an lru _r _f ifo lru o_ l fif ru o_ ra nd fif o 0
Changing the memory hierarchy / Cache exclusive Matrix Size -64 70 60 50 40 lru 30 lru_elr 20 10 Matrix Size - 128 0 matrix_size L 1_D L 1_I L 2 L 3 140 120 100 80 lru_el 60 lru_elr 40 20 0 matrix_size L 1_D L 1_I L 2 L 3
Matrix Size - 256 300 250 200 lru 150 lru_elr 100 50 0 matrix_size L 1_D L 1_I L 2 L 3
Reference • Virtual Image https: //drive. google. com/open? id=0 B 8 K 6 cnetx. NFmc. XZ 2 R 2 lz. MUpt. QWs • http: //www. ece. uah. edu/~milenka/docs/milenkovic_acmse 04 r. pdf • http: //www. cs. ucf. edu/~neslisah/final. pdf • http: //www. cse. scu. edu/~mwang 2/projects/Cache_replacemen t_10 s. pdf • https: //ece 752. ece. wisc. edu/lect 11 -cache-replacement. pdf • https: //en. wikipedia. org/wiki/Cache_replacement_policies • http: //people. csail. mit. edu/emer/papers/2010. 06. isca. rrip. pdf • http: //www. cs. utexas. edu/users/mckinley/papers/evict-me-pac t-2002. pdf • http: //snir. cs. illinois. edu/PDF/Temporal%20 and%20 Spatial%20 L ocality. pdf • https: //math. mit. edu/~stevenj/18. 335/ideal-cache. pdf • https: //pdfs. semanticscholar. org/6 ebe/c 8701893 a 6770 eb 0 e 19 a 0 d 4 a 732852 c 86256. pdf • https: //f. D 3 hh. Nnf. L 6 kwww. youtube. com/watch? v= • http: //pages. cs. wisc. edu/~david/courses/cs 752/Spring 2015/ge m 5 -tutorial/index. html • http: //blog. stuffedcow. net/2013/01/ivb-cache-replacement/ • https: //github. com/dependablecomputinglab/csi 3102 -gem 5 -ne w-cache-policy