abc/src/bdd/extrab/extraBddImage.c
/**Function*************************************************************

  Synopsis    [Starts the image computation using tree-based scheduling.]

  Description [This procedure starts the image computation. It uses
  the given care set to test-run the image computation and creates the 
  quantification tree by scheduling variable quantifications. The tree can 
  be used to compute images for other care sets without rescheduling.
  In this case, Extra_bddImageCompute() should be called.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Starts the image computation using tree-based scheduling.]

Description [This procedure starts the image computation. It uses
the given care set to test-run the image computation and creates the
quantification tree by scheduling variable quantifications. The tree can
be used to compute images for other care sets without rescheduling.
In this case, Extra_bddImageCompute() should be called.]




Function Synopsis [ Starts the image computation using tree - based scheduling . ] Description [ This procedure starts the image computation . It uses the given care set to test - run the image computation and creates the quantification tree by scheduling variable quantifications . The tree can be used to compute images for other care sets without rescheduling . In this case Extra_bddImageCompute () should be called . ]
Extra_ImageTree_t * Extra_bddImageStart( 
    DdManager * dd, DdNode * bCare, 
    int nParts, DdNode ** pbParts,  
    int nVars, DdNode ** pbVars, int fVerbose )   
{
    Extra_ImageTree_t * pTree;
    Extra_ImagePart_t ** pParts;
    Extra_ImageVar_t ** pVars;
    Extra_ImageNode_t ** pNodes;
    int v;
    if ( fVerbose && dd->size <= 80 )
        Extra_bddImagePrintLatchDependency( dd, bCare, nParts, pbParts, nVars, pbVars );
    pParts = Extra_CreateParts( dd, nParts, pbParts, bCare );
    pVars  = Extra_CreateVars( dd, nParts + 1, pParts, nVars, pbVars );
    pNodes = Extra_CreateNodes( dd, nParts + 1, pParts, dd->size, pVars );
    pTree = ABC_ALLOC( Extra_ImageTree_t, 1 );
    memset( pTree, 0, sizeof(Extra_ImageTree_t) );
    pTree->pCare = pNodes[nParts];
    pTree->fVerbose = fVerbose;
    while ( Extra_BuildTreeNode( dd, nParts + 1, pNodes, dd->size, pVars ) );
    for ( v = 0; v < dd->size; v++ )
        assert( pVars[v] == NULL );
    ABC_FREE( pVars );
    while ( (pTree->pRoot = Extra_MergeTopNodes( dd, nParts + 1, pNodes )) == NULL );
    for ( v = 0; v < nParts + 1; v++ )
        assert( pNodes[v] == NULL );
    ABC_FREE( pNodes );
    pTree->bCareSupp = Cudd_Support( dd, bCare );  Cudd_Ref( pTree->bCareSupp );
    Extra_DeleteParts_rec( pTree->pRoot );
    ABC_FREE( pParts );
    return pTree;
}
Extra_ImageTree_t * Extra_bddImageStart ( DdManager * dd , DdNode * bCare , int nParts , DdNode * * pbParts , int nVars , DdNode * * pbVars , int fVerbose ) { Extra_ImageTree_t * pTree ; Extra_ImagePart_t * * pParts ; Extra_ImageVar_t * * pVars ; Extra_ImageNode_t * * pNodes ; int v ; if ( fVerbose && dd -> size <= 80 ) Extra_bddImagePrintLatchDependency ( dd , bCare , nParts , pbParts , nVars , pbVars ) ; pParts = Extra_CreateParts ( dd , nParts , pbParts , bCare ) ; pVars = Extra_CreateVars ( dd , nParts + 1 , pParts , nVars , pbVars ) ; pNodes = Extra_CreateNodes ( dd , nParts + 1 , pParts , dd -> size , pVars ) ; pTree = ABC_ALLOC ( Extra_ImageTree_t , 1 ) ; memset ( pTree , 0 , sizeof ( Extra_ImageTree_t ) ) ; pTree -> pCare = pNodes [ nParts ] ; pTree -> fVerbose = fVerbose ; while ( Extra_BuildTreeNode ( dd , nParts + 1 , pNodes , dd -> size , pVars ) ) ; for ( v = 0 ; v < dd -> size ; v ++ ) assert ( pVars [ v ] == NULL ) ; ABC_FREE ( pVars ) ; while ( ( pTree -> pRoot = Extra_MergeTopNodes ( dd , nParts + 1 , pNodes ) ) == NULL ) ; for ( v = 0 ; v < nParts + 1 ; v ++ ) assert ( pNodes [ v ] == NULL ) ; ABC_FREE ( pNodes ) ; pTree -> bCareSupp = Cudd_Support ( dd , bCare ) ; Cudd_Ref ( pTree -> bCareSupp ) ; Extra_DeleteParts_rec ( pTree -> pRoot ) ; ABC_FREE ( pParts ) ; return pTree ; }
Function
Synopsis    [Starts the image computation using tree-based scheduling.]
Function Synopsis [ Starts the image computation using tree - based scheduling . ]
// the care set // the partitions for image computation // the NS and parameter variables (not quantified!) // create variables, partitions and leaf nodes // create the tree // process the nodes // make sure the variables are gone // merge the topmost nodes // make sure the nodes are gone //    if ( fVerbose ) //        Extra_bddImagePrintTree( pTree ); // set the support of the care set // clean the partitions