September 1999Compaq Computer CorporationSlide 1 of 18 Proving cache coherence for the Alpha 21264 (EV6) processor Paul Harter, Leslie Lamport, Mark Tuttle,

Slides:



Advertisements
Similar presentations
Thursday, November 1, 2001(c) 2001 Ibrahim K. El-Far. All rights reserved.1 Enjoying the Perks of Model-based Testing Ibrahim K. El-Far Florida Institute.
Advertisements

Chapter 13: Query Processing
Software Requirements
Formal Specifications
Analysis of Computer Algorithms
Chapter 6 Writing a Program
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
1 Hyades Command Routing Message flow and data translation.
and 6.855J Cycle Canceling Algorithm. 2 A minimum cost flow problem , $4 20, $1 20, $2 25, $2 25, $5 20, $6 30, $
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Year 6 mental test 10 second questions Numbers and number system Numbers and the number system, fractions, decimals, proportion & probability.
Making the System Operational
CS4026 Formal Models of Computation Running Haskell Programs – power.
£1 Million £500,000 £250,000 £125,000 £64,000 £32,000 £16,000 £8,000 £4,000 £2,000 £1,000 £500 £300 £200 £100 Welcome.
Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn 2.4 The Z Notation [Reference: M. Spivey: The Z Notation, Prentice Hall]
Reductions Complexity ©D.Moshkovitz.
Tintu David Joy. Agenda Motivation Better Verification Through Symmetry-basic idea Structural Symmetry and Multiprocessor Systems Mur ϕ verification system.
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Lecture 11: Algorithms and Time Complexity I Discrete Mathematical Structures: Theory and Applications.
Week 2 The Object-Oriented Approach to Requirements
EECE 310: Software Engineering Modular Decomposition, Abstraction and Specifications.
Designing A Payroll System A Solution Daniel POP, Ph.D.
Homework Reading Machine Projects Labs
Configuration management
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Software Engineering - Specifications 1 Specifications Specification document must be clear, complete and correct.
FIFO Queues CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
Chapter 1 Object Oriented Programming 1. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
Hash Tables.
1 Lecture 20: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
© S Haughton more than 3?
1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I.
1 Department of Computer Science, University of Sheffield eXtreme Programming - Practices Dr. Marian Gheorghe.
Formal models of design 1/28 Radford, A D and Gero J S (1988). Design by Optimization in Architecture, Building, and Construction, Van Nostrand Reinhold,
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
This, that, these, those Number your paper from 1-10.
CS101: Introduction to Computer programming
Global Analysis and Distributed Systems Software Architecture Lecture # 5-6.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 14: Simulations 1.
Node Lessons Learned James Hudson Wisconsin Department of Natural Resources.
Addition 1’s to 20.
25 seconds left…...
Slippery Slope
Test B, 100 Subtraction Facts
11 = This is the fact family. You say: 8+3=11 and 3+8=11
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
© 2006 Pearson Addison-Wesley. All rights reserved10 A-1 Chapter 10 Algorithm Efficiency and Sorting.
Week 1.
Bottoms Up Factoring. Start with the X-box 3-9 Product Sum
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 31 Slide 1 Service-centric Software Engineering 1.
Introduction to Recursion and Recursive Algorithms
1 Implementing DDIEditor in the Danish Data Archive - Demonstration and gained experience Part of session: Recent Developments in the DDI Implementation.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
Describing Syntax and Semantics
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
Verification at HP Labs Mark Tuttle (with the help of many friends at) HP Labs.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor.
September 1999Compaq Computer CorporationSlide 1 of 16 Verification of cache-coherence protocols with TLA+ Homayoon Akhiani, Damien Doligez, Paul Harter,
 Problem Analysis  Coding  Debugging  Testing.
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
Presentation transcript:

September 1999Compaq Computer CorporationSlide 1 of 18 Proving cache coherence for the Alpha (EV6) processor Paul Harter, Leslie Lamport, Mark Tuttle, Yuan Yu Compaq Computer Corporation

September 1999Compaq Computer CorporationSlide 2 of 18 Cache coherence protocols Goal: prove the cache coherence protocol is correct. processor cache memory x=2 Alpha memory model defines ordering of reads and writes to x. Cache coherence protocol enforces the Alpha memory model. cache x=2 cache x=1 processor

September 1999Compaq Computer CorporationSlide 3 of 18 Proving cache coherence in three easy steps+two-man years Model Alpha memory model. (200 lines) Model complete protocol. (2000 lines, 3 months) Prove implementation (5500 lines, 4+ months, incomplete) Model abstract protocol. (500 lines) Prove implementation (550 lines, 2 months, informal)

September 1999Compaq Computer CorporationSlide 4 of 18 Step 1: Alpha memory model We specify the Alpha memory memory model: –The official specification is an informal description of the allowed sequences of reads and writes. –We need a precise, state-based specification. We specify a simplified version of the model: –Operations read and write entire cache lines. –Operations accessing a cache line have a common point of synchronization.

September 1999Compaq Computer CorporationSlide 5 of 18 Key definition: read/write ordering Before order for an execution orders reads/writes and determines what values are returned by reads. GoodExecutionOrder defines good Before orders, namely the orders allowed by the memory model.

September 1999Compaq Computer CorporationSlide 6 of 18 State machine actions ReceiveRequest(proc, req) Receive a request ChooseNewData(proc, idx) Choose the return value for a request Respond(proc, idx) Return the value to a request ExtendBefore Expand the Before relation Actions preserve GoodExecutionOrder.

September 1999Compaq Computer CorporationSlide 7 of 18 GoodExecutionOrder GoodExecutionOrder == LET [some definitions deleted] IN /\ (*************************************************************) (* Before is a partial order. *) (*************************************************************) /\ Before \subseteq ReqId \X ReqId /\ \A r1, r2 \in ReqId : IsBefore(r1, r2) => ~IsBefore(r2, r1) /\ \A r1, r2, r3 \in ReqId : IsBefore(r1, r2) /\ IsBefore(r2, r3) => IsBefore(r1, r3) /\ (*************************************************************) (* SourceOrder implies the Before order. *) (*************************************************************) \A r1, r2 \in ReqId : SourceOrder(r1, r2) => IsBefore(r1, r2) /\ (*************************************************************) (* RequestOrder implies the Before order. *) (*************************************************************) \A r1, r2 \in ReqId : RequestOrder(r1, r2) => IsBefore(r1, r2) This is the hard part --- but look how short it is!

September 1999Compaq Computer CorporationSlide 8 of 18 /\ (*******************************************************) (* Writes and successful SCs to the same location that *) (* have issued a response are totally ordered. *) (*******************************************************) \A r1, r2 \in ReqId : /\ ReqIdQ[r1].req.type \in {"Wr", "SC"} /\ ReqIdQ[r1].req.newData # "Failed" /\ ReqIdQ[r1].req.responded /\ ReqIdQ[r2].req.type \in {"Wr", "SC"} /\ ReqIdQ[r2].req.newData # "Failed" /\ ReqIdQ[r2].req.responded /\ ReqIdQ[r1].req.adr = ReqIdQ[r2].req.adr => IsBefore(r1, r2) \/ IsBefore(r2, r1)

September 1999Compaq Computer CorporationSlide 9 of 18 /\ (*******************************************************************) (* LL/SC Axiom: For each successful SC, there is a matching LL and *) (* there is no write to the same address from a different *) (* processor between the LL and SC in the Before order. *) (*******************************************************************) \A r2 \in ReqId : /\ ReqIdQ[r2].req.type = "SC" /\ ReqIdQ[r2].newData \notin {Failed, NotChosen} => \E r1 \in ReqId : /\ LLSCPair(r1, r2) /\ \A r \in ReqId : /\ \/ ReqIdQ[r].req.type = "Wr" \/ /\ ReqIdQ[r].req.type = "SC" /\ ReqIdQ[r].newData \notin {NotChosen, Failed} /\ r[1] # r2[1] /\ ReqIdQ[r2].req.adr = ReqIdQ[r].req.adr => ~IsBefore(r1, r) \/ ~IsBefore(r, r2)

September 1999Compaq Computer CorporationSlide 10 of 18 /\ (**************************************************************) (* Value Axiom: A read reads from the preceding write in the *) (* Before order. *) (**************************************************************) \A r1, r2 \in ReqId : /\ ReqIdQ[r2].source # NoSource /\ ReqIdQ[r1].req.type = "Wr" /\ ReqIdQ[r1].req.adr = ReqIdQ[r2].req.adr => IF ReqIdQ[r2].source = FromInitMem THEN ~IsBefore(r1, r2) ELSE \/ ~IsBefore(ReqIdQ[r2].source, r1) \/ ~IsBefore(r1, r2)

September 1999Compaq Computer CorporationSlide 11 of 18 Step 2: Model abstract protocol Like most systems, the actual protocol is an –abstract protocol together with lots of –implementation details Unlike most systems, –abstract protocols correctness was far from obvious –we discovered a behavior not allowed by the model –this turned out to be an error in the memory model

September 1999Compaq Computer CorporationSlide 12 of 18 Define protocols Before ordering: fairly easy. Prove it satisfies GoodExecutionOrder: hard part was proving that the ordering is acyclic. Engineers had a behavioral intuition. Writing invariance proof was extremely hard: –35-line invariant, based on 300 lines of definitions –550-line proof, cases nested 10 levels deep The high-level proof

September 1999Compaq Computer CorporationSlide 13 of 18 Obstacle 1: find a single, complete description –English documents: 20 documents, 4-inch stack –Lisp simulator: crucial to understanding some details No description is –complete, precise, or –mathematically-tractable We wrote a relatively elegant, compact description Step 3: Model complete protocol

September 1999Compaq Computer CorporationSlide 14 of 18 Obstacle 2: algorithm complexity –60 different kinds of messages Quarks were the solution: –15 units of functionality –each message modeled as a set of quarks –resolved message overloading, simplified protocol Protocol took 9 man-months, 1900 lines of TLA+ Step 3: Model complete protocol

September 1999Compaq Computer CorporationSlide 15 of 18 Complete proof impossible due to time and labor Informal invariant was 1000 lines long We focus on the two most difficult conjuncts (each 150 lines) cache data structure point of synch. messages The low-level proof

September 1999Compaq Computer CorporationSlide 16 of 18 The low-level proof Proof took 7 man-months –one conjunct: 2000 lines, cases 13 levels deep –second conjunct: potentially twice as long, stopped at a point of diminishing returns Found one actual error: –demonstration requires use of 4 processors, 2 memory locations, and 15 messages –state space is too big for model checkers to find it –error is too obscure for testing to find it

September 1999Compaq Computer CorporationSlide 17 of 18 Lessons learned Engineers can read TLA+ after an hour, write TLA+ after several hours Engineers valued the work: the resulting confidence in the protocol was invaluable Specification should be part of design process: –removes ambiguity, uncovers corner cases –describes entire system at single level of abstraction –allows use of tools like TLC early in design stage

September 1999Compaq Computer CorporationSlide 18 of 18 Future work Engineers –see the potential of formal methods –open to including formal methods in design phase We want to facilitate adoption by engineering Most likely future project: analyze proposals made to standards committees –PCI-X, …