ESE532: System-on-a-Chip Architecture

Slides:



Advertisements
Similar presentations
Copyright W. Howden1 Programming by Contract CSE 111 6/4/2014.
Advertisements

Partial Order Reduction: Main Idea
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 24: November 4, 2011 Synchronous Circuits.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 13: March 4, 2009 FSM Equivalence Checking.
Software Testing and Quality Assurance
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 22: April 23, 2008 FSM Equivalence Checking.
Presenter: PCLee Design Automation Conference, ASP-DAC '07. Asia and South Pacific.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 11, 2009 Dataflow.
Testing an individual module
CMSC 345 Fall 2000 Unit Testing. The testing process.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
CALTECH CS137 Spring DeHon CS137: Electronic Design Automation Day 9: May 6, 2002 FSM Equivalence Checking.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing III No reading Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 24: November 5, 2012 Synchronous Circuits.
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 25: April 17, 2013 Covering and Retiming.
Levels of Verification Figure 2.2 p 37 Verification is applied at all different abstraction levels Mostly bottom up, some top down.
CS137: Electronic Design Automation
Computer Hardware What is a CPU.
Overview Logistics Last lecture Today HW5 due today
Computer Science 210 Computer Organization
A Review of Software Testing - P. David Coward
Computer Organization and Architecture + Networks
Testing Tutorial 7.
Software Testing.
Types for Programs and Proofs
ARM Organization and Implementation
Input Space Partition Testing CS 4501 / 6501 Software Testing
ESE532: System-on-a-Chip Architecture
ESE532: System-on-a-Chip Architecture
Seoul National University
CS5123 Software Validation and Quality Assurance
Chapter 18 Software Testing Strategies
Computer Science 210 Computer Organization
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Computer Science 210 Computer Organization
ESE535: Electronic Design Automation
Software Testing (Lecture 11-a)
Logical architecture refinement
Lecture 09:Software Testing
Chapter 6 Methods: A Deeper Look
Day 26: November 1, 2013 Synchronous Circuits
Objective of This Course
ESE535: Electronic Design Automation
Lectures on Graph Algorithms: searching, testing and sorting
Miss Rate versus Block Size
Day 21: October 29, 2010 Registers Dynamic Logic
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
White-Box Testing Techniques I
A Discussion on Assemblers
ESE535: Electronic Design Automation
ESE535: Electronic Design Automation
Instructor: Aaron Roth
ECE 352 Digital System Fundamentals
This Lecture Substitution model
EGR 2131 Unit 12 Synchronous Sequential Circuits
Computer Science 340 Software Design & Testing
ESE 150 – Digital Audio Basics
ECE 352 Digital System Fundamentals
Instructor: Michael Greenbaum
UNIT-4 BLACKBOX AND WHITEBOX TESTING
ESE532: System-on-a-Chip Architecture
CS137: Electronic Design Automation
Presentation transcript:

ESE532: System-on-a-Chip Architecture Day 22: November 14, 2018 Verification 2 Penn ESE532 Fall 2018 -- DeHon

Today Unit and Component Tests Assertions Proving correctness FSM Equivalence Timing and Testing Penn ESE532 Fall 2018 -- DeHon

Message If you don’t test it, it doesn’t work. Testing can only prove the presence of bugs, not the absence. Full verification strategy is more than testing. Penn ESE532 Fall 2018 -- DeHon

Testing with Reference Specification Day 20 Testing with Reference Specification Validate the design by testing it: Create a set of test inputs Apply test inputs To implementation under test To reference specification Collect response outputs Check if outputs match Penn ESE532 Fall 2018 -- DeHon

Automated Testing suite must be automated Day 20 Automated Testing suite must be automated Single script or make build to run Just start the script Runs through all testing and comparison without manual interaction Including scoring and reporting a single pass/fail result Maybe a count of failing cases Penn ESE532 Fall 2018 -- DeHon

Day 20 Regression Test Regression Test -- Suite of tests to run and validate functionality Penn ESE532 Fall 2018 -- DeHon

Unit Tests Regression for individual components Good to validate independently Lower complexity Fewer tests Complete quickly Make sure component(s) working before run top-level design tests One strategy for long top-level regression Also useful Reuse component; understanding what broke Penn ESE532 Fall 2018 -- DeHon

Functional Scaffolding If functional decomposed into components like implementation Replace individual components with implementation Use reference/functional spec for rest Penn ESE532 Fall 2018 -- DeHon

Functional Scaffolding If functional decomposed into components like implementation Replace individual components with implementation Use reference/functional spec for rest Independent test of integration for that module Penn ESE532 Fall 2018 -- DeHon

Functional Scaffolding If functional decomposed into components like implementation Run reference component and implementation together and check outputs Penn ESE532 Fall 2018 -- DeHon

Decompose Specification Should specification decompose like implementation? ultimate golden reference Only if that decomposition is simplest But, worth refining Golden reference simplest Intermediate functional decomposed Validate it versus golden Still simpler than final implementation Then use with implementation Penn ESE532 Fall 2018 -- DeHon

Test Decomposition Just as decomposition useful for design complexity management, decomposition useful for verification …and debugging Penn ESE532 Fall 2018 -- DeHon

Assertions Penn ESE532 Fall 2018 -- DeHon

Assertion Predicate (Boolean expression) that must be true Invariant Expect/demand this property to always hold Never vary  never not be true Penn ESE532 Fall 2018 -- DeHon

Equivalence with Reference as Assertion Match of test and golden reference is a heavy-weight example of an assertion r=fimpl(in); assert (r==fgolden(in)); Penn ESE532 Fall 2018 -- DeHon

Assertion as Invariant May express a property that must hold without expressing how to compute it. int res[2]; res=divide(n,d); assert(res[QUOTIENT]*d+res[REMAINDER]==n); Penn ESE532 Fall 2018 -- DeHon

Lightweight Typically lighter weight (less computation) than full equivalence check Typically less complete than full check Allows continuum expression Penn ESE532 Fall 2018 -- DeHon

Preclass 1 What property needs to hold on l? s=packetsum(p); l=packetlen(p); res=divide(s,l); Penn ESE532 Fall 2018 -- DeHon

Check a Requirement s=packetsum(p); l=packetlen(p); assert(l!=0); res=divide(s,l); Penn ESE532 Fall 2018 -- DeHon

Preclass 2 What must be true of a[found] before return? Penn ESE532 Fall 2018 -- DeHon

Merge using Streams Merging two sorted list is a streaming operation Day 13 Merging two sorted list is a streaming operation int aptr; int bptr; astream.read(ain); bstream.read(bin) For (i=0;i<MCNT;i++) If ((aptr<ACNT) && (bptr<BCNT)) If (ain>bin) { ostream.write(ain); aptr++; astream.read(ain);} Else { ostream.write(bin) bptr++; bstream.read(bin);} Else // copy over remaining from astream/bstream Penn ESE532 Fall 2018 -- DeHon

Merge Requirement Require: astream, bstream sorted int aptr; int bptr; astream.read(ain); bstream.read(bin) For (i=0;i<MCNT;i++) If ((aptr<ACNT) && (bptr<BCNT)) If (ain>bin) { ostream.write(ain); aptr++; astream.read(ain);} Else { ostream.write(bin) bptr++; bstream.read(bin);} Else // copy over remaining from astream/bstream Penn ESE532 Fall 2018 -- DeHon

Merge Requirement Require: astream, bstream sorted Int ptr; int bptr; astream.read(ain); bstream.read(bin) For (i=0;i<MCNT;i++) If ((aptr<ACNT) && (bptr<BCNT)) If (ain>bin) { ostream.write(ain); aptr++; int prev_ain=ain; astream.read(ain); assert(prev_ain<=ain); } Penn ESE532 Fall 2018 -- DeHon

Merge with Order Assertion When composed Every downstream merger checks work of predecessor merge+alt merge+alt merge+alt Penn ESE532 Fall 2018 -- DeHon

Merge Requirement Require: astream, bstream sorted Requirement that input be sorted is good And not hard to check Not comprehensive Weaker than saying output is a sorted version of input What errors would it allow? Penn ESE532 Fall 2018 -- DeHon

What do with Assertions? Include logic during testing (verification) Omit once tested Compiler/library/macros omit code Keep in source code Maybe even synthesize to gate logic for FPGA testing When assertion fail Count Break program for debugging (dump core) Penn ESE532 Fall 2018 -- DeHon

Assertion Roles Specification (maybe partial) Documentation May address state that doesn’t exist in gold reference Documentation This is what I expect to be true Needs to remain true as modify in the future Defensive programming Catch violation of input requirements Catch unexpected events, inputs Early failure detection Validate that something isn’t happening Penn ESE532 Fall 2018 -- DeHon

Assertion Discipline Worthwhile discipline Good to write those down Consider, document input/usage requirements Consider and document properties that must always hold Good to write those down As precisely as possible Good to check assumptions hold Penn ESE532 Fall 2018 -- DeHon

Equivalence Proof FSM Penn ESE532 Fall 2018 -- DeHon

Prove Equivalence Testing is a subset of Verification Testing can only prove the presence of bugs, not the absence. Depends on picking an adequate set of tests Can we guarantee that all behaviors are the correct? Same as reference? Seen all possible behaviors? Penn ESE532 Fall 2018 -- DeHon

Idea Reason about all behaviors Response to all possible inputs Try to find if there is any way to reach disagreement with specification Or can prove that they always agree Still demands specification Penn ESE532 Fall 2018 -- DeHon

Testing with Reference Specification Day 20 Testing with Reference Specification Validate the design by testing it: Create a set of test inputs Apply test inputs To implementation under test To reference specification Collect response outputs Check if outputs match Penn ESE532 Fall 2018 -- DeHon

Formal Equivalence with Reference Specification Validate the design by proving equivalence between: implementation under test reference specification Penn ESE532 Fall 2018 -- DeHon

FSM Equivalence Illustrate with concrete model of FSM equivalence Is some implementation FSM Equivalent to reference FSM Penn ESE532 Fall 2018 -- DeHon

Compare Start with golden model setup Create composite FSM Run both and compare output Create composite FSM Start with both FSMs Connect common inputs together (Feed both FSMs) XOR together outputs of two FSMs Xor’s will be 1 if they disagree, 0 otherwise Penn ESE532 Fall 2018 -- DeHon

Compare Create composite FSM Start with both FSMs Connect common inputs together (Feed both FSMs) XOR together outputs of two FSMs Xor’s will be 1 if they disagree, 0 otherwise Ask if the new machine ever generate a 1 on an xor output (signal disagreement) Any 1 is a proof of non-equivalence Never produce a 1  equivalent Penn ESE532 Fall 2018 -- DeHon

Creating Composite FSM Assume know start state for each FSM Each state in composite is labeled by the pair {S1i, S2j} How many such states? Start in {S10, S20} For each input a, create a new edge: T(a,{S10, S20}) {S1i, S2j} If T1(a, S10) S1i, and T2(a, S20) S2j Repeat for each composite state reached Penn ESE532 Fall 2018 -- DeHon

Composite FSM How much work? Hint: Maximum number of composite states (state pairs) Maximum number of edges from each state pair? Work per edge? Penn ESE532 Fall 2018 -- DeHon

Composite FSM Work Can group together original edges At most |alphabet|*|State1|*|State2| edges == work Can group together original edges i.e. in each state compute intersections of outgoing edges Really at most |E1|*|E2| Penn ESE532 Fall 2018 -- DeHon

Non-Equivalence State {S1i, S2j} demonstrates non-equivalence iff {S1i, S2j} reachable On some input, State S1i and S2j produce different outputs If S1i and S2j have the same outputs for all composite states, it is impossible to distinguish the machines They are equivalent A reachable state with differing outputs Implies the machines are not identical Penn ESE532 Fall 2018 -- DeHon

Reachable Mismatch Now that we have a composite state machine, with this construction Question: does this composite state machine ever produce a 1? Is there a reachable state that has differing outputs? Penn ESE532 Fall 2018 -- DeHon

Answering Reachability Start at composite start state {S10, S20} Search for path to a differing state Use any search Breadth-First Search, Depth-First Search End when find differing state Not equivalent OR when have explored entire reachable graph without finding Are equivalent Penn ESE532 Fall 2018 -- DeHon

Reachability Search Worst: explore all edges at most once O(|E|)=O(|E1|*|E2|) Can combine composition construction and search i.e. only follow edges which fill-in as search (way described) Penn ESE532 Fall 2018 -- DeHon

Example s0 q0 q1 q3 q2 s1 s2 -/1 -/0 1/0 0/0 -/0 -/1 -/1 Penn ESE532 Fall 2018 -- DeHon

Creating Composite FSM Assume know start state for each FSM Each state in composite is labeled by the pair {S1i, S2j} Start in {S10, S20} For each symbol a, create a new edge: T(a,{S10, S20}) {S1i, S2j} If T1(a, S10) S1i, and T2(a, S20) S2j Check that both state machines produce same outputs on input symbol a Repeat for each composite state reached Penn ESE532 Fall 2018 -- DeHon

FSM  Model Checking FSM case simple – only deal with states More general, need to deal with operators (add, multiply, divide) Wide word registers in datapath Cause state exponential in register bits Tricks Treat operators symbolically Separate operator verification from control verif. Abstract out operator width Similar flavor of case-based search Conditionals need to be evaluated symbolically Penn ESE532 Fall 2018 -- DeHon

Assertion Failure Reachability Can use with assertions Is assertion failure reachable? Can identify a path (a sequence of inputs) that leads to an assertion failure? Penn ESE532 Fall 2018 -- DeHon

Formal Equivalence Checking Rich set of work on formal models for equivalence Challenges and innovations to making search tractable Common versions Model Checking (2007 Turing Award) Bounded Model Checking Penn ESE532 Fall 2018 -- DeHon

Timing Penn ESE532 Fall 2018 -- DeHon

Issues Cycle-by-cycle specification can be overspecified Golden Reference Specification not run at target speed Penn ESE532 Fall 2018 -- DeHon

Tokens Use data presence to indicate when producing a value Only compare corresponding outputs Only store present outputs from computations, since that’s all comparing Penn ESE532 Fall 2018 -- DeHon

Timing Record timestamp from implementation Allow reference specification to specify its time stamps “Model this as taking one cycle” Or requirements on its timestamps This must occur before cycle 63 This must occur between cycle 60 and 65 Compare values and times Penn ESE532 Fall 2018 -- DeHon

Challenge Cannot record at full implementation rate Inadequate bandwidth to Store off to disk Get out of chip Cannot record all the data you might want to compare at full rate Penn ESE532 Fall 2018 -- DeHon

At Speed Testing Compiled assertions might help Perform the check at full rate so don’t need to record Capture bursts to on-chip memory Higher bandwidth …but limited capacity, so cannot operate continuously Penn ESE532 Fall 2018 -- DeHon

Bursts to Memory Run in bursts Repeat Enable computation Run at full rate storing to memory buffer Stall computation Offload memory buffer at (lower) available bandwidth (possibly check against golden model) Penn ESE532 Fall 2018 -- DeHon

Generalize Generalize to input and output Feed from memories Compute full rate Write into memory Can run at high rate for number of cycles can store inputs and outputs Penn ESE532 Fall 2018 -- DeHon

Burst Testing Issue Mitigation May only see high speed for computation/interactions that occur within a burst period May miss interaction at burst boundaries Mitigation Rerun with multiple burst boundary offsets So all interactions occur within some burst Decorrelate interaction and burst boundary Penn ESE532 Fall 2018 -- DeHon

Timing Validation Doesn’t need to be all testing either Static Timing Analysis to determine viable clock frequency As Vivado is providing for you Cycle estimates as get from Vivado II, to evaluate a function Worst-Case Execution Time for software Penn ESE532 Fall 2018 -- DeHon

Decompose Verification Does it function correctly? What speed does it operate it? Does it continue to work correctly at that speed? Penn ESE532 Fall 2018 -- DeHon

Big Ideas Assertions valuable Reason about requirements and invariants Explicitly validate Formally validate equivalence when possible Extend techniques to address timing and support at-speed tests Penn ESE532 Fall 2018 -- DeHon

Admin P3 due Friday P4 out Next week: Thanksgiving Week Lecture on Monday No lecture on Wednesday Because it is a virtual ”Friday” Penn ESE532 Fall 2018 -- DeHon