33
A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris University of Toronto

A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

A Complete Approach to Unreachable State

Diagnosability via Property Directed Reachability

Ryan Berryhill

Andreas Veneris

University of Toronto

Page 2: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 3: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 4: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Motivation

• Functional verification can take up to 70% of the design effort, 60% of which is debugging

• Many errors manifest themselves with an error trace

• Traditional SAT-based debugging can be applied to accelerate the debugging process

University of Toronto

Page 5: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Motivation

• Safety properties• The design can never reach a bad state

• On failure, an error trace is returned

• Liveness properties• The design is capable of reaching a state

• On failure, no error trace can possibly exist

• Without an error trace, traditional automated debugging cannot be applied

University of Toronto

Page 6: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Motivation

• Techniques for debugging this type of liveness property exist• Approximation-based and incomplete

• We propose a PDR-based debugging technique for this type of liveness property• Complete and exact: returns every solution

• Possible to efficiently answer the question:

University of Toronto

How do I make the design reach this state?How do I make the design reach this state?

Page 7: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 8: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Background

• SAT-based debugging [Smith et. al TCAD ‘05]• Using an error-trace, finds all locations that

can be changed to correct the circuit’s behavior

• Unroll the circuit as an ILA, insert MUXes at the output of each gate

University of Toronto

D Q

x1x2

yd

• E.g. for the following circuit and two-cycle counter-example

000

10

y1 y2

1

Cycle 2Cycle 1

Page 9: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Background

• SAT-based debugging [Smith et. al TCAD ‘05]• Using an error-trace, finds all locations that

can be changed to correct the circuit’s behavior

• Unroll the circuit as an ILA, insert MUXes at the output of each gate

University of Toronto

D Q

x1x2

yd

• E.g. for the following circuit and two-cycle counter-example

s20

1s1

0

1 s1

0

1

w1,1w2,1

w1,2

000

10

y1d1 y2

1

Setting s1 = 1 makes the instance SAT

Cycle 2Cycle 1

0

1

w2,2

s2

Page 10: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Background

• Property-Directed Reachability [Bradley, VMCAII’11]• Determines if a state is reachable or not

• Compute an over-approximation of the set of reachable states in each clock cycle

• Terminate when the over-approximation converges to an inductive invariant

• Inductive invariant: a set of states closed under the circuit’s transition relation

• We propose a technique leveraging PDR to debug unreachability without an error trace

University of Toronto

Page 11: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Background

• Approximation-based approach [Berryhill and Veneris, DATE’15]• User sets a parameter K

• Use PDR to over-approximate the set of states reachable in K or fewer cycles

• Debug a state transition from the over-approximation to the target state

University of Toronto

Page 12: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Background

• Solution set is not necessarily complete

• Finds all solutions that reach the target state:• within (K+1) cycles; and

• one cycle after an already-reachable state

• We propose a technique based on PDR that is complete by nature• No parameters to set

• Higher runtime (roughly 4-5x)

University of Toronto

Page 13: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 14: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Unreachability Debugging

• Key idea: create a new transition relation in which the target is reachable if solutions exist• Use a novel error model construction to

perform the role of the debugging MUX

• Use PDR to determine the if the target is reachable

• The counter-example returned by PDR indicates a solution

• Result: All solutions are found, but runtime is typically higher than the approximation-based approach

University of Toronto

Page 15: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Unreachability Debugging

• Construct the enhanced transition relation• Insert the error model at each suspect location

• If ei = 0 the circuit’s behavior is unaffected

• If ei = 1 the location is replaced by free variable wi

• The register output feeds back to its input• The register assumes a value as part of the initial

state assignment and maintains it forever

University of Toronto

D Q

FF

0

1

ei

li

wizi

Page 16: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Unreachability Debugging

• Construct initial state constraints• Valid initial state of the circuit

• Exactly N active error-select registers• Find solutions where N locations are simultaneously

changed to correct the error

• N is the error cardinality

• For simplicity, we only consider N = 1

University of Toronto

D Q

FF

x1

x2

s1

l1

l2D Q

FF

x1

x2

s1

e10

1w1

e20

1w2

Page 17: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Unreachability Debugging

• Execute PDR, using the target state as the unsafe state set

• If reachable, the active error-select register in the counter-example is a solution• Update the initial state constraint to block the

solution, run PDR again

• If unreachable, no solutions exist• Terminate

University of Toronto

Page 18: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Unreachability Debugging

• From the initial state (s1 = 0) it is impossible to reach the target state (s1 = 1)

University of Toronto

D Q

FF

x1

x2

s1

e10

1w1

e20

1w2

D Q

FF

x1

x2

s1

l1

l2

Page 19: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

D Q

FF

x1

x2

s1

e10

1w1

e20

1w2

D Q

FF

x1

x2

s1

l1

l2

Unreachability Debugging

• From the initial state (s1 = 0) it is impossible to reach the target state (s1 = 1)

• Setting e2 = 1 makes it reachable• The AND gate is a solution

• Changing the AND to an OR indeed makes the target state reachable

University of Toronto

Page 20: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Unreachability Debugging

• From the initial state (s1 = 0) it is impossible to reach the target state (s1 = 1)

• Setting e1 = 1 does not make the target state reachable• The OR gate is not a solution

University of Toronto

D Q

FF

x1

x2

s1

e10

1w1

e20

1w2

Page 21: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 22: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Incremental Application of PDR

• PDR is called once for each solution found

• Each time, PDR is solving a very similar problem• Same transition relation, same property

• One error-select register forced to 0

• Strictly fewer states are reachable• Those in which ei = 1 are all unreachable

• All others are unaffected

University of Toronto

ReachableOver-

Approximation

Page 23: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Incremental Application of PDR

• The reachable set after blocking is a subset of the reachable set before blocking• The over-approximations remain valid

• Re-use the over-approximations of PDR from the previous run• Gives an average 5.1x speedup

University of Toronto

ReachableOver-

Approximation

Page 24: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 25: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Experimental Results

University of Toronto

Approximate Approach (K = 50)

Initial Approach Incremental Approach

Design #sol %sol Time #sol Time #sol Time Speedup

mrisc_core 10 100 15.9 10 430 10 111 3.9x

deisgn1 4 29 16 14 128 14 21.7 5.9x

divider 1 1.9 1.5 53 2.2 53 1.2 1.8x

spi 40 100 19.0 40 598 40 76.6 7.8x

wb 247 95 38.7 261 9983 261 211 47.3x

usb_core 4 100 17.5 4 1065 4 492 2.2x

ac97_ctrl 10 56 1.4 18 44.8 18 16.8 2.7x

rsdecoder 40 100 371 - - 40 951 -

GEOMEAN 43 5.1x

Incremental and initial approaches find the

same (complete) set of solutions in every case

Approximate approach finds 43% of the

complete solution set

Approximate approach struggles to find many

solutions on highly-pipelined designs

Approximate approach often is able to find all of

the solutions

Page 26: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Experimental Results

University of Toronto

0

50

100

150

200

250

300

mrisc_core design1 divider spi wb usb_core ac97_ctrl rsdecoder

Solu

tio

ns

Solutions Found for Both Approaches

Approximate Approach Proposed Approach

• On pipelined designs, the approximate approach may find a small subset of the solutions• Finds solutions in the stage closest to error’s

observation point

Page 27: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Experimental Results

University of Toronto

0

2

4

6

8

10

0 20 40 60 80 100

Solu

tio

ns

Fou

nd

Time(s)

Solutions Found vs. Time for Both Approaches (mrisc_core)

Unoptimized Optimized

• Both take the same amount of time to find one solution

• The optimized approach finds subsequent solutions much more quickly

Page 28: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 29: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Future Work

• Efficient Suspect Selection [ISAIM’16]

• Key Idea: A location being a non-solution may imply other locations are also non-solutions• Not a register defining the target state (e.g. locations

other than s1); and

• Has only one fanout (e.g. l3, l2, l1); and

• Single fanout is a non-solution

• e.g. If l2 is not a solution, l1 is not either

University of Toronto

D Q

FFx1x2

s1

l2

l3

x3 l1

Page 30: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Future Work

• Apply unreachability debugging iteratively

• Start with a suspect set including• Registers that define the target state (s1)

• Locations with multiple fanout

• Debug, “push back” through solutions• Add fanins of solutions to the suspect set

University of Toronto

D Q

FFx1x2

s1

l2

l3

x3 l1

Page 31: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Construct New Suspect Set

Solutions Found?

Debug

Future Work

University of Toronto

Construct Initial Suspect Set

Yes

Terminate

D Q

FFx1x2

s1

l2

l3

x3 l1

No

SuspectSuspect

SolutionSolution

SuspectNon-SolutionNon-Solution

Page 32: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Outline

• Motivation

• Background

• Unreachability Debugging

• Incremental Application of PDR

• Experimental Results

• Future Work

• Conclusion

University of Toronto

Page 33: A Complete Approach to Unreachable State Diagnosability ... · A Complete Approach to Unreachable State Diagnosability via Property Directed Reachability Ryan Berryhill Andreas Veneris

Conclusion

• Debugging unreachable states without an error trace• Construct an enhanced model of the circuit

• Target state reachable if and only if solutions exist

• Use PDR to find traces that reach the target state thereby indicating solutions

• Complete and exact by nature• Returns every solution in the design

• Future Work: Efficient suspect selection

University of Toronto