

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(Due 11/10/2008 at the start of the class) In this assignment, you will implement a simulator for a snooping cache coherence protocol using C, C++, C# or JAVA. Task 1 (100 points): Mandatory for CSE420/ Implement the snooping cache coherence protocol of Figure 4.7 on page 215. There are three coherence states: Shared, Invalid , and Modified (or Exclusive ). Assume there are four processors. Each processor has a 1KB direct-mapped cache. The block size is 16 bytes. Assume the initial caches are empty. The program takes the input file name as an argument. The command line should be Snooping1 โ input_file โ where Snooping1 is the execution file name and โ input_file โ is the input file name. The input file includes the sequence of events of the form:
Repeat with the above exercise using four coherency states: Shared, Invalid, Modified , and Exclusive. Shared and Invalid states behave same as Task1. We distinguish the Modified (or Exclusive state) in the pervious case into two distinct states called Exclusive and Modified states. Exclusive state is when a processor solely has a clean copy of the block (i.e. it has not been modified by the owner and also no other processor has a copy of this block). Modified state is when a processor solely has a copy of the block which is dirty (i.e. is has been modified/written by the owner, but no other processor has a copy of this block). The command line should be Snooping2 โ input_file โ where Snooping2 is the execution file name and โ input_file โ is the input file name. The program should display 1) the read hit, read miss, write hit, and write miss ratio for each processor, 2) the total number of write back actions of each processor, and 3) the total number of invalidate messages on bus. Task 3 (20 points): Mandatory for CSE598/ Extra credit for CSE Extend the programs for a two-way set associative cache. The replacement policy is FIFO. You should add a parameter to specify the associativity. The command line should be Snooping1 โ input_file โ 2 and Snooping2 โ input_file โ 2 where Snooping1 and Snooping2 are the execution file name, โ input_file โ is the input file name, and 2 specifies two-way set associativity. Report: Your report should have the detailed explanation of the implementation, results for input files (input1.txt and input2.txt), discussion on your results, and things you learned. The length of report should be 2 โ 3 pages. The font size should not be greater than 12. README file: In a README file, you should include 1) the programming environment you used (e.g. MAC/Windows, the version of complier, etc), and 2) tips to compile and run your program. Deliverables: