300 likes | 445 Views
Using Structural Relations for Checking Combinationality of C yclic C ircuits. Wan-Chen Weng Date: 2014/06/19. Outline. Motivation Problem formulation Combinationality Methodology Outer and Inner Side Input Loop backtracking Self-conflict Side Input Pre-clause Program flow
E N D
Using Structural Relations for Checking Combinationality of Cyclic Circuits Wan-Chen Weng Date: 2014/06/19
Outline • Motivation • Problem formulation • Combinationality • Methodology • Outer and Inner Side Input • Loop backtracking • Self-conflictSide Input • Pre-clause • Program flow • Experimental results • Conclusion
Motivation(1/4) • S. Malik (1994) • For the analysis of cyclic circuits. • Ternary symbolic simulation. • Let denote the unknown value.
Motivation(2/4) • Marc D. Riedel (2008) • SAT-based dual-rail model checking for the combinationality of cyclic circuits. • Add dummy variables and equivalent checkers to the corresponding module.
Motivation(3/4) • Marc D. Riedel (2008) • The original circuit will be combinational when SAT = 0.
Motivation(4/4) f = ab a b 3 variables 3 clauses f a1 a0 b1 b0 f1= a1b1+ a0b1b0’ f0 = a0b0+ a1b1’b0 10 variables 20clauses f1 f0 • Dual-rail model
Problem formulation(1/1) • Given: • a cyclic circuit C. • Determine: • if C is combinational. • By using: • And-inverter graph (AIG). • SAT-based approaches describing non-combinational relations between nodes in strongly connected components (SCCs). • If: • SAT, then at least one true loop exists. non-combinational • UNSAT, then all loops are false. combinational
Combinationality(1/8) CV False loop SCC • Stephen A. Edwards (2003) • An SCC is combinational at least one input to a gate is controlling value (CV). • SCC is combinational = every loop in the SCC is false • SCC is combinational every loop in the SCC is false. • every loop in the SCC is false SCC is combinational.
Combinationality(2/8) Loop with unknown signals SCC • An SCC is combinational • By definition of combinational behavior, every gate outputs a definite value. • Initially, outputs of gates from an SCC are simulated as unknown.
Combinationality(3/8) CV Loop with unknown signals false loop SCC SCC • An SCC is combinational • Base case 1: • If # of loops = 1 and only 1 controlling external input
Combinationality(4/8) CV CV CV L1 L2 L1 L1 L2 L2 SCC SCC SCC • An SCC is combinational • Base case 2: • If # of loops = 2 and 1 controlling external input
Combinationality(5/8) CV CV CV L1 ~ Lk Lk+1 L1 ~ Lk Lk+1 L1 ~ Lk Lk+1 SCC SCC SCC • An SCC is combinational • Assume # of loops = k holds, then # of loops = k+1:
Combinationality(6/8) • An SCC is combinational • By induction, every loop is false. • SCC is combinational every loop in the SCC is false.
Combinationality(7/8) • Every loop in the SCC is false • Initially, internal signals of every loop are unknown. At least one side input of every loop is CV. Every gate in any loop outputs a definite value. Every gate in the SCC outputs a definite value. SCC is combinational. • Every loop in the SCC is false SCC is combinational.
Combinationality(8/8) • Every loop in the SCC is false SCC is combinational. • SCC is non-combinational at least one loop is true. • SCC is combinational every loop in the SCC is false. • Exists a true loop in the SCC SCC is non-combinational.
Outer and Inner Side Input (1/4) A L1 B S1 n3 n1 n1 A L2 n1 n4 n4 n4 n2 n2 n2 B B n3 n3 C C
Outer and Inner Side Input (2/4) • Distinguish between external inputs and internal signals: • Outer side inputs (OSIs): • side inputs entirely from somewhere outside the SCC. • A, B, C. • Inner side inputs (ISIs): • side inputs from somewhere inside the SCC. • n1, n3. 17
Outer and Inner Side Input (3/4) • (OSIx_1∧ … ∧OSIx_n∧ ISIx_1∧ … ∧ISIx_n) • = (NCV ∧ … ∧NCV ∧NCV ∧ … ∧NCV) • (loopy_1∨ …∨loopy_x∨ … ∨ loopy_n) = SAT • Non-combinational relations: • For a loop Lx: • For an SCCy:
Outer and Inner Side Input (4/4) • Problems remain: • How to check if ISIs are definite? • What relation can judge oscillations between logical 0 and 1?
Loop backtracking (1/6) Clause of the loop (OSIs/ISIs): (A ∧ B) Clause of n1, n2: n1 = A‧n2 (A∨n2∨n1)∧ (A∨n1) ∧ (n2∨n1) n2 = B‧n1 (B∨n1∨n2)∧ (B∨n2) ∧ (n1∨n2) Results: [SAT] (n1, n2) = (0, 0) or (1, 1) n2 A B n1
Loop backtracking (2/6) if (A, B) = (NCV, NCV) then (n1, n2) = (1/0, 0/1) or (n1, n2) = (0/1, 1/0). Clause of n1, n2: n1 = A‧n2 (A∨n2∨n1)∧ (A∨n1) ∧ (n2∨n1) n2 = B‧n1 (B∨n1∨n2)∧ (B∨n2) ∧ (n1∨n2) Results: [UNSAT] n2 A B n1
Loop backtracking (3/6) • The weakness of SAT solvers • No timing concept. • Cannot detect happened across time frames. • Can only distinguish the uncertainty but oscillations. • Notation • Time differential : T.
Loop backtracking (4/6) nT-1 nT To represent the value of a node in T and T-1, we derive an equation with its fanins and trace back the fanin cone until the node be reached again as well as all variables in the equation are not in time T.
Loop backtracking (5/6) SCC SCC path 1 Condition: n should be 1 Time tag: T-1 nT nT Fin_cone Condition: n should be 0 Time tag: T
Loop backtracking (6/6) SCC SCC SCC path 1 path 1 Condition: n should be 1 Time tag: T-1 path 2 path 2 SCC path 1 nT nT nT nT Fin_cone Condition: n should be 0 Time tag: T-2
Self-conflictSide Input (1/1) nx n3 n2 n4 n1 Side input nx always breaks the loop.
Pre-clause (1/1) nx ny A Original clauses: (A…∧ … ∧ …) ∨ (B…∧ … ∧ …) Pre-clause: (A∨ B) ∧ … ∧ … Cycle 1 Cycle 2 B • Cycles may converge and share same nodes. • Side inputs may appear in different cycles repetitively. • Extract non-shared side inputs to lower the SAT-solving cost.
Program flow (1/1) Cyclic circuit C NO Find an SCC S All SCCs are checked? Find all loop L in S YES Side input searching for each loop of L Self-conflict detection for L SAT solving All loops are self-conflict? YES termination NO Pre-clause Loop-backtracking NO YES Exists un-tracing SCC?
Conclusion (1/1) We proposed a SAT-based approach that deals with structural relations instead of duplicating signals, and it is scalable for circuits up to tens of thousands of gated. We filtered out certain cycles before SAT solving, raising the validation speed.