A Semi-Canonical Form for Sequential AIGs Alan Mishchenko, Niklas Een, Robert Brayton UC Berkeley Michael Case, Pankaj Chauhan, Nikhil Sharma Calypto Design Systems
Motivation Logic networks often contain duplicate sub-circuits Leads to redundant work Synthesis and verification tools re-analyze the same sub-circuit Verification tools waste time on duplicate proof obligations
Motivation Key idea: identify duplicate logic regions Ideal solution: isomorphism Our approximate solution: semi-canonical mapping Use the circuit structure to classify each sub-circuit
Example Fanout count {b}, {m} are unique Complemented outputs {c} is unique Fanin level {F}, {G} are unique
Example Sometimes nodes cannot be distinguished After semi-canonicization: {F, F’}, {G, G’} Isomorphisms: F ≈ F’ , G ≈ G’ F’ G’
Implementation Implemented within ABC as an internal routine Puts the netlist in semi-canonical form Node order reflects both topological order & signatures Application 1: “write_aiger –u” Writes the netlist in semi-canonical form Application 2: “&iso” Discard isomorphic POs
Algorithm Overview Compute signatures for each node Signatures indicate which class a node is in Singleton nodes: nodes that have unique signatures Goal: assign unique signatures for as many nodes as possible Initially all signatures are 0
Algorithm Overview Edge value: reflects the structure around an edge edge_value := hash(driver_signature, edge_is_complemented) 4 1 3 5 6 8 7 2
Algorithm Overview Function: PropagateSignaturesForward() Assign the same random signature to all inputs For each node, signature := hash(old_signature, fanin edge_values) 71 42 1 2 15 3 19 8 4 5 6 7 12
Algorithm Overview Function: PropagateSignaturesBackward() Recompute edge values Assign the same random signature to all outputs For each node, signature := hash(old_signature, fanout edge_values) 71 42 15 19 12 12 12 12
Algorithm Overview Sometimes we cannot distinguish nodes tie breaking Choose the equiv class with the largest level Assign unique signatures to the class nodes Propagate signatures to other nodes until convergence If there some equiv classes are left, go to Step 1 71 42 15
Implementation Implemented within ABC as an internal routine Puts the netlist in semi-canonical form Node order reflects both topological order & signatures Application 1: “write_aiger –u” Writes the netlist in semi-canonical form Application 2: “&iso” Discard isomorphic POs
Implementation Application 1: “write_aiger –u” Writes the netlist in semi-canonical form Useful for quickly comparing AIGER netlists Netlist N write_aiger -u N.aig diff Netlist N’ write_aiger -u Nprime.aig
Implementation Application 2: “&iso” Convert each PO to semi-canonical form (separately) Discard POs that have duplicate semi-canonical forms i.e. “drop isomorphic proof obligations” F’ G’ a' b’ c’ d’ Counterexamples/invariants on F/G can be re-mapped to F’/G’
Experimental Results With industrial verification benchmarks Remove isomorphic POs Apply synthesis, remove proved POs Remove isomorphic POs (again) Example FFs ANDs POs POs after iso iso (sec) POs after synthesis SDCU 2442 14418 834 727 3.2 361 353 .09 TPC_P 1619 1270 948 795 16.00 394 393 .28 TCP_Oh 3838 36890 598 553 4.78 545 541 .55 PC_T 2565 20101 274 258 129 .01 SDXIA 7822 78858 600 490 32.04 245 .63 DU 10864 84397 946 518 198.14 458 432 .80 Initial AIG Size
Conclusion Previous work: computing functional symmetries and automorphisms simplifying reachability and SAT instances with symmetries First work on semi-canonical labeling of nodes in a sequential AIG Allows for caching intermediate AIGs in EDA tools Future work may include: Speeding up propagation of node signatures Generalizing the algorithm to work for logic networks other than the traditional AIGs
THANK YOU Public implementation is available in ABC https://bitbucket.org/alanmi/abc