260 likes | 397 Views
Proof of Correctness of a Processor with Reorder Buffer using the Completion Functions Approach. Ravi Hosabettu (Univ. of Utah) Mandayam Srivas (SRI International) Ganesh Gopalakrishnan (Univ. of Utah). Motivation. Pipelined processor verification Increasingly complex designs
E N D
Proof of Correctness of a Processor with Reorder Buffer using the Completion Functions Approach Ravi Hosabettu (Univ. of Utah) Mandayam Srivas (SRI International) Ganesh Gopalakrishnan (Univ. of Utah)
Motivation • Pipelined processor verification • Increasingly complex designs • Need for formal verification • Theorem provers • Focus on the relevant aspects only • To verify large, complex designs: • Automation • Decomposition
Problem Definition • Need a verification methodology that • Is amenable to decomposition • Uses decision procedures • Solution: Completion Functions Approach
RF What are Completion Functions? • Desired effect of retiring an unfinished instruction in an atomic fashion C_b c a b
Abstraction Function • Need to define an abstraction function • Flushing the pipeline • Our idea: Define abstraction function as a Composition of Completion Functions Impl. Machine Step Spec. Machine Step
C_a C_b C_c c a b L_ab Abs. fn = C_ao C_bo C_c One VC is: C_a == L_abo C_b RF Main Features • Decomposition into verification conditions • Generated systematically & discharged often automatically
Main Features Continued • Incremental verification • No explicit intermediate abstraction • Methodology implemented in PVS • Three examples (CAV98) • DLX • Dual issue DLX • Out-of-order execution example
DB c a b EU RF RTT RB RF New Issues for OOO
Completion Functions Approach for OOO • Instructions in a few possible states • Parameterized completion function • Recursive abstraction function • Proof decomposition is based on “instruction-state transitions” • Liveness issues addressed
Outline of the Presentation • The implementation model • Proof of correctness • Correctness criterion • Liveness proof • Related work and conclusions
Processor Model DB EU1 EUm RF RTT RB
The Completion Function Action_issued Action_dispatched DB EU1 Action_executed RF rbi RB Action_writtenback
Correctness Criterion A_step/ Abstraction Abstraction I_step impl_st
Recursive Abstraction Function RF RB rbi head tail Abs. fn = Complete_till(head)
General Verification Condition RF q D I E D W I Same next(q) E I W E W D RF
Instruction-state Transitions Not Disp? Not Exec? Not Wback? Not Retire? I E W D Disp? Exec? Wback? Retire?
Establishing the General Verification Condition Action_dispatched q D I D E W I Same effect on RF next(q) E I E W W D Action_executed
I E W D RF N Overall Proof Decomposition ISA specification
Feedback Logic • Feedback logic correctness: A = B Read RF C_2 B C_1 i 2 1 A Feedback logic
Invariants Needed • Feedback logic invariant • Exclusiveness & exhaustiveness • Instruction-state properties
PVS Proof Statistics • Proof strategies • Induction obligations: Very similar strategy • Rewrite rules & other obligations: Automatic • Invariants: No uniform strategy • Manual effort • 1 week of planning & discussions • 12 person days of “first time” effort • 1050 seconds on 167MHz UltraSparc
Liveness Properties • Two liveness properties • Eventually the processor gets flushed • Eventually a new instruction is executed • Again based on “Instruction-state transition” diagram
Not Disp? Not Exec? Not Wback? Not Retire? I D E W Disp? Exec? Wback? Retire? Liveness Proof Scheduler
Related Work • Jones, Skakkebaek & Dill - FMCAD98 • Pnueli & Arons - FMCAD98 • Sawada & Hunt - CAV98 • McMillan - CAV98
Conclusions • Well suited for verifying a processor with reorder buffer • Proved the correctness of Tomasulo’s algorithm with no reorder buffer: CHARME99
Work in Progress • A processor with exceptions & speculative execution • Substantial progress made • Mechanizing the liveness proofs • Bring the methodology closer to practice • Bridging the model gap • More automated decision procedures • Integration into the design process