



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Mishra; Class: COMPU ARCHITECT PRIN; Subject: COMPUTER DESIGN/ARCHITECTURE; University: University of Florida; Term: Fall 2008;
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




You are not allowed to take or give help in completing this assignment. Submit the PDF version of the submission in e-Learning website before the deadline. Please include the sentence in bold on top of your submission: โ I have neither given nor received any unauthorized aid on this assignment โ.
Problem 1 Consider two processors P1 and P2. Suppose the program reference stream is as follows: Repeat N times { P1 writes variable X; P2 reads variable X; P2 writes variable X; P1 reads variable X; }
Assume that the caches are initially empty in both processors and a write-allocate policy is used.
Problem 2 As discussed in class, the atomic exchange instruction, EXCH R2, 0(R1), exchanges the content of R2 with the content in memory location M[0(R1)] as an atomic operation. This EXCH instruction involves both a read and a write memory operation and is often used to implement a spin lock as follows: ADDUI R2, R0, #1 ; R2=
Lock: EXCH R2, 0(R1)
BNEZ R2, Lock
Unlock: SD R0, 0(R1) ; update M[0(R1)] = 0
The implementation of the EXCH is usually integrated with the hardware cache coherence mechanism. In this problem a write-invalidate, ESI (Snoopy with Exclusive, Shared, Invalid) coherence protocol is used. Therefore, the write operation in EXCH requires the Exclusive state of the block and causes invalidations to other copies of the block located in other caches. A more efficient spin lock is to spin on regular load (LD) instruction instead of spinning on EXCH.
An alternative approach to implement an atomic EXCH is to use a pair of special Load Linked (LL) and Store Conditional (SC) instructions. These two instructions are always used in order with LL followed by SC. If the content of the memory location specified by LL is changed between the LL and SC, then the SC fails without updating the memory. After executing the SC, R3=1 if the exchange is successful, or R3=0 if M[0(R1)] has been modified between the pair of LL and SC.
List all the memory requests and cache coherence transactions starting when P0 releases the lock to the steady state when P1 is in critical section and both P2 and P3 are spinning on lock variable located in their local caches. You need to list the memory requests and coherence transactions using EXCH instruction in table like the following on your answer sheet. Note that each coherence transaction can take multiple cycles. Also, your answer does not need to fill all the rows in the table.
Few likely options are listed below. Fill in the table by selecting these options that achieve the goal and explain the reasons. (Note, in Exclusive L1/L2, no data block can exist in both L1 and L2.)
L1 organization: Private L1 (the only option) L2 organization: Private L2; Shared L Inclusion property: Inclusive L1/L2; Exclusive L1/L Cache coherence: Snooping-bus mechanism; Directory-based mechanism
Goal Options needed Reason
Maximum memory hierarchy capacity
Minimum L2 access time
Implement On-Chip directory-based coherence scheme
Problem 4 Assume that we have a Snoppy invalidation-based cache coherence protocol in which there are the following three states: Modified: You have modified the data block, holding the most recent, correct copy of the data and no other processor has a copy. Shared: You have a copy of data that another processor also has. Invalid: Your copy of the data is not up to date.
In alternative cache coherence protocol designs, we have other states including:
Exclusive: You are the sole owner of the data and are free to modify it without a bus invalidate message. Owner: Your data is shared, but you have the master copy in your cache, which means you are the one who made the latest update of that data.