200 likes | 307 Views
Improving State Coverage Using Bloom Filters. Jennifer Atkins Jin Hu EECS 578 Fall 2006 The University of Michigan. Outline. Our problem Previous approaches Bloom filters in a nutshell Proposed Method Experiments and Results Wrap-Up. The Problem – State Coverage. Design Space.
E N D
Improving State Coverage Using Bloom Filters Jennifer Atkins Jin Hu EECS 578 Fall 2006 The University of Michigan
Outline • Our problem • Previous approaches • Bloom filters in a nutshell • Proposed Method • Experiments and Results • Wrap-Up
The Problem – State Coverage . . . . . . . . . Design Space
Previous Approaches . . . . . . . . . Design Space Formal Verification
Previous Approaches . . . . . . . . . Design Space Simulation
0 1 2 3 4 14 15 5 6 7 8 9 13 10 11 12 . . . Problem Motivation • n-bit Counter • void increment(); • void decrement(); • Example: n = 4 • Example++: n = 32 139 steps many more steps
Proposed Method • Guided randomized search Repeat Backtrack
Proposed Method • Keep track of visited states • Need data structure such that: • Won’t blow up, memory-wise • Allows fast accessibility • Searching • Inserting
0 0 0 0 0 0 0 m bits . . . Introducing…Bloom Filters! • “Glorified Hash Table” • k hash functions • Functionality • void insert(state s); • Adds element • bool contains(state s); • return 1 if in filter • return 0 if not in filter • void flush(); • Clears filter v[0] v[1] v[2] v[3] v[4] v[5] v[m-1]
1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 v[0] v[1] v[2] v[3] 8 bits v[4] v[5] v[6] v[7] Bloom Filters: void insert(s) Given States: k=4Hash Functions H1(s)=1 H2(s)=7 H3(s)=2 H4(s)=3
1 1 1 1 0 0 0 1 1 1 0 1 v[0] v[1] v[2] v[3] 8 bits v[4] v[5] v[6] v[7] Bloom Filters: bool contains(s) return (1& 1 & 1 & 1) return (1 & 1 &1 & 1) return (1 & 1& 1 & 1) return (1 & 1 &1 &1) k=4Hash Functions H1(s)=1 H2(s)=7 H3(s)=2 H4(s)=3
Bloom Filters: Caveats • False Positives • Must periodically flush bloom filter
Hit Tolerance? Next State Initial State Full? Visited? Reset state Randomize input Insert Flush Backtrack (Detailed) Proposed Method no yes no yes yes no for (i < LOOP_COUNT) our contribution
Experimental Setup • Bloom filter written in C • Simulator used: Vera • Simple design • 4-bit shift register w/added functionality • Less Simple design • Alarm Clock
Results Tolerance = 04 151 @ 25842 Tolerance = 10 149 @ 10352 Tolerance = 05 149 @ 10872 Tolerance = 03 148 @ 8022 Random 148 @ 24602
Tolerance = 02 1254 Tolerance = 03 1260 Tolerance = 05 1222 Tolerance = 10 1181 Random 226 Results
Lessons Learned • C++ and Vera do not mix well • “vera_user.o: read-only file system” • Ilya Wagner (CSE 2765) is a great help for Vera!
Future Improvements & Work • Bloom filters with counters • Each element is a r-bit counter • insert(state s); counter++; • delete(state s); counter--; • Bloom Filter memory optimization • Abstraction heuristics to select and/or cluster state bits
Conclusions • Guided randomization improves coverage • Well-suited for single-stage designs • More refinement needed for multi-stage designs
Thanks For Listening! Questions? Comments?