Docsity

Assignment 2 for Snooping Cache Coherence Simulator | CSE 420, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
CSE420/598 Computer Architecture I (FALL 2008)
ASSIGNMENT 2 (100 + 50 points)
Snooping Cache Coherence Simulator
(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/598
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:
<processor> <op> <address>
where <processor> designates the processor (from P0 to P3), <op> is the CPU operation
(read or write), and <address> denotes the memory address. Assume a byte-addressable
multi-processor system (each address corresponds to a byte in main memory). For
simplicity, we assume these events (CPU operations) are sequential. For example,
P0 read 100
P1 write 100
indicates that processor P0 reads data from address 100 of the main memory and then
processor P1 writes data to address 100 of the main memory.
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.
Run your program with two test files (input1.txt and input2.txt) from the course web
page.
Task 2 (30 points): Mandatory for CSE598/ Extra credit for CSE420
pf2

Partial preview of the text

Download Assignment 2 for Snooping Cache Coherence Simulator | CSE 420 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CSE420/598 Computer Architecture I (FALL 2008)

ASSIGNMENT 2 (100 + 50 points)

Snooping Cache Coherence Simulator

(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:

where designates the processor (from P0 to P3), is the CPU operation (read or write), and
denotes the memory address. Assume a byte-addressable multi-processor system (each address corresponds to a byte in main memory). For simplicity, we assume these events (CPU operations) are sequential. For example, P0 read 100 P1 write 100 indicates that processor P0 reads data from address 100 of the main memory and then processor P1 writes data to address 100 of the main memory. 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. Run your program with two test files (input1.txt and input2.txt) from the course web page. Task 2 (30 points): Mandatory for CSE598/ Extra credit for CSE

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:

  • A Zip file including source codes, a README file and a report. Please name your zip file as LastName_HW2.zip (e.g. Kim_HW2.zip). Send the zipped file to the TA ([email protected]) with your full name and ASU ID.