103 int nVars,
DdNode ** pbVarsNs );
120 int * piNode1,
int * piNode2 );
125 int nParts,
DdNode ** pbParts,
126 int nVars,
DdNode ** pbVars );
158 int nParts,
DdNode ** pbParts,
159 int nVars,
DdNode ** pbVars,
int fVerbose )
167 if ( fVerbose && dd->
size <= 80 )
178 pTree->
pCare = pNodes[nParts];
185 for ( v = 0; v < dd->
size; v++ )
186 assert( pVars[v] == NULL );
193 for ( v = 0; v < nParts + 1; v++ )
194 assert( pNodes[v] == NULL );
234 printf(
"Original care set support: " );
236 printf(
"Current care set support: " );
240 printf(
"The care set depends on some vars that were not in the care set during scheduling.\n" );
259 return pTree->
pRoot->bImage;
294 return pTree->
pRoot->bImage;
325 for ( i = 0; i < nParts; i++ )
332 pParts[i]->
iPart = i;
336 pParts[nParts]->
bFunc = bCare;
Cudd_Ref( pParts[nParts]->bFunc );
340 pParts[nParts]->
iPart = nParts;
357 int nVars,
DdNode ** pbVars )
361 DdNode * bCubeNs, * bSupp, * bParts, * bTemp, * bSuppTemp;
366 for ( p = 0; p < nParts; p++ )
367 pbFuncs[p] = pParts[p]->bSupp;
384 for ( bSuppTemp = bSupp; bSuppTemp !=
b1; bSuppTemp =
cuddT(bSuppTemp) )
386 iVar = bSuppTemp->
index;
388 pVars[iVar]->
iNum = iVar;
392 for ( p = 0; p < nParts; p++ )
399 pVars[iVar]->
bParts = bParts;
436 for ( i = 0; i < nParts; i++ )
441 pNodes[i]->pPart = pParts[i];
444 for ( v = 0; v < nVars; v++ )
446 if ( pVars[v] == NULL )
448 assert( pVars[v]->nParts > 0 );
449 if ( pVars[v]->nParts > 1 )
452 if ( pNodes[iPart]->bCube == NULL )
454 pNodes[iPart]->bCube = dd->
vars[v];
459 pNodes[iPart]->bCube =
Cudd_bddAnd( dd, bTemp = pNodes[iPart]->bCube, dd->
vars[v] );
469 for ( i = 0; i < nParts; i++ )
487 if ( i < nParts - 1 )
528 pPart = pNode->pPart;
555 assert( pNode->pPart == NULL );
577 if ( pNode->pNode1 == NULL )
597 pNode->bImage = NULL;
602 pNode->pNode1->bImage, pNode->pNode2->bImage, pNode->bCube );
604 pNode->bImage =
Cudd_bddAnd( dd, pNode->pNode1->bImage, pNode->pNode2->bImage );
633 DdNode * bCube, * bTemp, * bSuppTemp, * bParts;
635 int iVarBest, nSupp, v;
639 if ( iVarBest == -1 )
642 pVar = pVars[iVarBest];
655 pNode1 = pNodes[iNode1];
656 pNode2 = pNodes[iNode2];
661 for ( v = 0; v < nVars; v++ )
662 if ( pVars[v] && v != iVarBest && pVars[v]->bParts == pVars[iVarBest]->bParts )
683 pNode1 = pNodes[iNode1];
684 pNode2 = pNodes[iNode2];
689 for ( v = 0; v < nVars; v++ )
690 if ( pVars[v] && pVars[v]->bParts == bParts )
699 pNodes[iNode1] = pNode;
700 pNodes[iNode2] = NULL;
703 for ( bSuppTemp = pNode2->pPart->bSupp; bSuppTemp !=
b1; bSuppTemp =
cuddT(bSuppTemp) )
705 pVar = pVars[bSuppTemp->
index];
737 int n1 = -1, n2 = -1, n;
740 for ( n = 0; n < nNodes; n++ )
810 pNode->pPart = pPart;
811 pNode->pNode1 = pNode1;
812 pNode->pNode2 = pNode2;
819 pNode->bCube = bCube;
Cudd_Ref( bCube );
842 double CostBest, CostCur;
844 CostBest = 100000000000000.0;
846 for ( v = 0; v < nVars; v++ )
850 for ( bTemp = pVars[v]->bParts; bTemp !=
b1; bTemp =
cuddT(bTemp) )
851 CostCur += pNodes[bTemp->
index]->pPart->nNodes *
852 pNodes[bTemp->
index]->pPart->nNodes;
853 if ( CostBest > CostCur )
875 int * piNode1,
int * piNode2 )
879 int CostMin1, CostMin2, Cost;
882 iPart1 = iPart2 = -1;
883 CostMin1 = CostMin2 = 1000000;
884 for ( bTemp = bParts; bTemp !=
b1; bTemp =
cuddT(bTemp) )
886 Cost = pNodes[bTemp->
index]->pPart->nNodes;
887 if ( CostMin1 > Cost )
889 CostMin2 = CostMin1; iPart2 = iPart1;
890 CostMin1 = Cost; iPart1 = bTemp->
index;
892 else if ( CostMin2 > Cost )
894 CostMin2 = Cost; iPart2 = bTemp->
index;
915 int nParts,
DdNode ** pbParts,
916 int nVars,
DdNode ** pbVars )
919 DdNode * bVarsCs, * bVarsNs;
924 printf(
"The latch dependency matrix:\n" );
925 printf(
"Partitions = %d Variables: total = %d non-quantifiable = %d\n",
926 nParts, dd->
size, nVars );
928 for ( i = 0; i < dd->
size; i++ )
929 printf(
"%d", i % 10 );
932 for ( i = 0; i < nParts; i++ )
959 printf(
" %3d : ", iPart );
960 for ( v = 0; v < dd->
size; v++ )
992 printf(
"The quantification scheduling tree:\n" );
1012 Cube = pNode->bCube;
1014 if ( pNode->pNode1 == NULL )
1016 printf(
"<%d> ", pNode->pPart->iPart );
1034 for ( i = 0; i < Offset; i++ )
1038 for ( i = 0; i < Offset; i++ )
1068 int nParts,
DdNode ** pbParts,
1069 int nVars,
DdNode ** pbVars,
int fVerbose )
1072 DdNode * bCubeAll, * bCubeNot, * bTemp;
1087 for ( i = 0; i < nParts; i++ )
DdNode * Cudd_bddComputeCube(DdManager *dd, DdNode **vars, int *phase, int n)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_END
DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube)
#define ABC_NAMESPACE_IMPL_START
int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Cudd_VectorSupport(DdManager *dd, DdNode **F, int n)
int Cudd_DagSize(DdNode *node)