abc/src/bdd/reo/reoTest.c
/**Function*************************************************************

  Synopsis    []

  Description [Transfers the ADD into another manager minimizes it and 
  returns the min number of nodes; disposes of the BDD in the new manager.
  Useful for debugging or comparing the performance of other reordering
  procedures.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    []

Description [Transfers the ADD into another manager minimizes it and
returns the min number of nodes; disposes of the BDD in the new manager.
Useful for debugging or comparing the performance of other reordering
procedures.]




Function Synopsis [] Description [ Transfers the ADD into another manager minimizes it and returns the min number of nodes ; disposes of the BDD in the new manager . Useful for debugging or comparing the performance of other reordering procedures . ]
int Extra_addReorderTest( DdManager * dd, DdNode * aF )
{
    static DdManager * s_ddmin;
    DdNode * bF;
    DdNode * bFmin;
    DdNode * aFmin;
    int  nNodesBeg;
    int  nNodesEnd;
    abctime clk1;
    if ( s_ddmin == NULL )
        s_ddmin = Cudd_Init( dd->size, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0);
    clk1 = Abc_Clock();
    bF    = Cudd_addBddPattern( dd, aF );         Cudd_Ref( bF );
    bFmin = Cudd_bddTransfer( dd, s_ddmin, bF );  Cudd_Ref( bFmin );
    Cudd_RecursiveDeref( dd, bF );
    aFmin = Cudd_BddToAdd( s_ddmin, bFmin );      Cudd_Ref( aFmin );
    Cudd_RecursiveDeref( s_ddmin, bFmin );
    nNodesBeg = Cudd_DagSize( aFmin );
    Cudd_ReduceHeap(s_ddmin,CUDD_REORDER_SIFT,1);
    nNodesEnd = Cudd_DagSize( aFmin );
    Cudd_RecursiveDeref( s_ddmin, aFmin );
    printf( "Classical reordering of ADDs: Before = %d. After = %d.\n", nNodesBeg, nNodesEnd );
    printf( "Classical variable reordering time = %.2f sec\n", (float)(Abc_Clock() - clk1)/(float)(CLOCKS_PER_SEC) );
    return nNodesEnd;
}
int Extra_addReorderTest ( DdManager * dd , DdNode * aF ) { static DdManager * s_ddmin ; DdNode * bF ; DdNode * bFmin ; DdNode * aFmin ; int nNodesBeg ; int nNodesEnd ; abctime clk1 ; if ( s_ddmin == NULL ) s_ddmin = Cudd_Init ( dd -> size , 0 , CUDD_UNIQUE_SLOTS , CUDD_CACHE_SLOTS , 0 ) ; clk1 = Abc_Clock ( ) ; bF = Cudd_addBddPattern ( dd , aF ) ; Cudd_Ref ( bF ) ; bFmin = Cudd_bddTransfer ( dd , s_ddmin , bF ) ; Cudd_Ref ( bFmin ) ; Cudd_RecursiveDeref ( dd , bF ) ; aFmin = Cudd_BddToAdd ( s_ddmin , bFmin ) ; Cudd_Ref ( aFmin ) ; Cudd_RecursiveDeref ( s_ddmin , bFmin ) ; nNodesBeg = Cudd_DagSize ( aFmin ) ; Cudd_ReduceHeap ( s_ddmin , CUDD_REORDER_SIFT , 1 ) ; nNodesEnd = Cudd_DagSize ( aFmin ) ; Cudd_RecursiveDeref ( s_ddmin , aFmin ) ; printf ( " \n " , nNodesBeg , nNodesEnd ) ; printf ( " \n " , ( float ) ( Abc_Clock ( ) - clk1 ) / ( float ) ( CLOCKS_PER_SEC ) ) ; return nNodesEnd ; }
Function
Synopsis    []
Function Synopsis []
//    Cudd_ShuffleHeap( s_ddmin, dd->invperm ); //    Cudd_ReduceHeap(s_ddmin,CUDD_REORDER_SYMM_SIFT,1);