<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:12pt"><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; ">Hi <span style="font-family: Arial; font-size: 13px; ">Abdul Arfan</span></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; ">I trace this code and the problem is </div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre"> </span>cache->map[set].lru[0] </div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; ">that has not value in the fifo, lifo and random replacement policies. These policies are not implemented correctly. </div><div><font size="3">The value of "line" variable after this statement is 0 and then the "</font>if (line)" condition does not satisfied. This happens because the lru[0] list does't
filled correctly. You can trace these methhods:</div><div style="background-color: transparent; "><span class="Apple-tab-span" style="white-space:pre"> </span>cache_add_to_lrulist<br></div><div style="background-color: transparent; "><span class="Apple-tab-span" style="white-space:pre"> </span>cache_remove_from_lrulist<br></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; "></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; ">that modify lru linked lists.</div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; ">Navid Farhadi<br></div> <div style="font-size: 12pt; font-family: tahoma, 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span
style="font-weight:bold;">From:</span></b> Abdul Arfan <abdul.arfan@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> disksim-users@ece.cmu.edu <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, December 13, 2012 8:36 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [Disksim-users] problem cache replacement algorithm<br> </font> </div> <br>
Dear disksim users,<br><br>Im using disksim 4 and, try to test several cache replacement algorithm,<br>I set the cache size to 16 and only use a very small trace file:<br><br>100 0 1 1 1<br>200 0 2 1 1<br>300 0 3 1 1<br>400 0 4 1 1<br>500 0 5 1 1<br>600 0 6 1 1<br>700 0 7 1 1<br>800 0 8 1 1<br>900 0 9 1 1<br>1000 0 10 1 1<br>1100 0 11 1 1<br>1200 0 12 1 1<br>1300 0 13 1 1<br>1400 0 14 1 1<br>1500 0 15 1 1<br>1600 0 16 1 1<br>1700 0 17 1 1<br>1800 0 18 1 1<br>1900 0 19 1 1<br>2000 0 20 1 1<br><br>to know what happed I add a print statement to
the cache_replace function<br>in file disksim_cachemem.c.<br><br>However I found that only CACHE_REPLACE_SLRU works correctly<br>(it runs cache_replace 4 times),<br>other cache algorithm CACHE_REPLACE_FIFO stop after processing the line 17<br>(it only runs cache_replace function 1 time).<br><br>Is there anybody experiencing the same problem?<br><br>-- <br>Abdul Arfan (+82 10 4449 6652)<br>http://arfan86.blogspot.com<br>_______________________________________________<br>Disksim-users mailing list<br><a ymailto="mailto:Disksim-users@ece.cmu.edu" href="mailto:Disksim-users@ece.cmu.edu">Disksim-users@ece.cmu.edu</a><br><a href="https://sos.ece.cmu.edu/mailman/listinfo/disksim-users" target="_blank">https://sos.ece.cmu.edu/mailman/listinfo/disksim-users</a><br><br><br> </div> </div> </div></body></html>