diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-29 17:11:03 -0400 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-29 17:11:03 -0400 |
commit | 71bdfae94122fff6f245c47721d284f78c286164 (patch) | |
tree | c63b5c3eb3fc06d565f32a31d2f82ba273bdafaf /src/bdd/dsd | |
parent | 5cf9d6ddd7fb5a22731f4d61cc984abc48e3f930 (diff) | |
download | abc-71bdfae94122fff6f245c47721d284f78c286164.tar.gz abc-71bdfae94122fff6f245c47721d284f78c286164.tar.bz2 abc-71bdfae94122fff6f245c47721d284f78c286164.zip |
Replacing 'st_table' by 'st__table' to resolve linker problems.
Diffstat (limited to 'src/bdd/dsd')
-rw-r--r-- | src/bdd/dsd/dsdCheck.c | 12 | ||||
-rw-r--r-- | src/bdd/dsd/dsdInt.h | 4 | ||||
-rw-r--r-- | src/bdd/dsd/dsdLocal.c | 20 | ||||
-rw-r--r-- | src/bdd/dsd/dsdMan.c | 12 | ||||
-rw-r--r-- | src/bdd/dsd/dsdProc.c | 42 | ||||
-rw-r--r-- | src/bdd/dsd/dsdTree.c | 6 |
6 files changed, 48 insertions, 48 deletions
diff --git a/src/bdd/dsd/dsdCheck.c b/src/bdd/dsd/dsdCheck.c index 4de75a92..c36fbef4 100644 --- a/src/bdd/dsd/dsdCheck.c +++ b/src/bdd/dsd/dsdCheck.c @@ -80,7 +80,7 @@ void Dsd_CheckCacheAllocate( int nEntries ) } // otherwise, there is no need to allocate, just clean Dsd_CheckCacheClear(); -// printf( "\nThe number of allocated cache entries = %d.\n\n", pCache->nTableSize ); +// printf( "\nThe number of allocated cache entries = %d.\n\n", pCache->nTableSize ); } /**Function******************************************************************** @@ -133,10 +133,10 @@ void Dsd_CheckCacheClear() int Dsd_CheckRootFunctionIdentity( DdManager * dd, DdNode * bF1, DdNode * bF2, DdNode * bC1, DdNode * bC2 ) { int RetValue; -// pCache->nSuccess = 0; -// pCache->nFailure = 0; +// pCache->nSuccess = 0; +// pCache->nFailure = 0; RetValue = Dsd_CheckRootFunctionIdentity_rec(dd, bF1, bF2, bC1, bC2); -// printf( "Cache success = %d. Cache failure = %d.\n", pCache->nSuccess, pCache->nFailure ); +// printf( "Cache success = %d. Cache failure = %d.\n", pCache->nSuccess, pCache->nFailure ); return RetValue; } @@ -156,7 +156,7 @@ int Dsd_CheckRootFunctionIdentity_rec( DdManager * dd, DdNode * bF1, DdNode * bF unsigned HKey; // if either bC1 or bC2 is zero, the test is true -// if ( bC1 == b0 || bC2 == b0 ) return 1; +// if ( bC1 == b0 || bC2 == b0 ) return 1; assert( bC1 != b0 ); assert( bC2 != b0 ); @@ -178,7 +178,7 @@ int Dsd_CheckRootFunctionIdentity_rec( DdManager * dd, DdNode * bF1, DdNode * bF // otherwise, keep expanding // check cache -// HKey = _Hash( ((unsigned)bF1), ((unsigned)bF2), ((unsigned)bC1), ((unsigned)bC2) ); +// HKey = _Hash( ((unsigned)bF1), ((unsigned)bF2), ((unsigned)bC1), ((unsigned)bC2) ); HKey = hashKey4( bF1, bF2, bC1, bC2, pCache->nTableSize ); if ( pCache->pTable[HKey].bX[0] == bF1 && pCache->pTable[HKey].bX[1] == bF2 && diff --git a/src/bdd/dsd/dsdInt.h b/src/bdd/dsd/dsdInt.h index 787f1747..16a0594a 100644 --- a/src/bdd/dsd/dsdInt.h +++ b/src/bdd/dsd/dsdInt.h @@ -40,7 +40,7 @@ typedef unsigned char byte; struct Dsd_Manager_t_ { DdManager * dd; // the BDD manager - st_table * Table; // the mapping of BDDs into their DEs + st__table * Table; // the mapping of BDDs into their DEs int nInputs; // the number of primary inputs int nRoots; // the number of primary outputs int nRootsAlloc;// the number of primary outputs @@ -54,7 +54,7 @@ struct Dsd_Manager_t_ struct Dsd_Node_t_ { Dsd_Type_t Type; // decomposition type - DdNode * G; // function of the node + DdNode * G; // function of the node DdNode * S; // support of this function Dsd_Node_t ** pDecs; // pointer to structures for formal inputs int Mark; // the mark used by CASE 4 of disjoint decomposition diff --git a/src/bdd/dsd/dsdLocal.c b/src/bdd/dsd/dsdLocal.c index a61b656c..552b53e9 100644 --- a/src/bdd/dsd/dsdLocal.c +++ b/src/bdd/dsd/dsdLocal.c @@ -29,7 +29,7 @@ ABC_NAMESPACE_IMPL_START /// STATIC VARIABLES /// //////////////////////////////////////////////////////////////////////// -static DdNode * Extra_dsdRemap( DdManager * dd, DdNode * bFunc, st_table * pCache, +static DdNode * Extra_dsdRemap( DdManager * dd, DdNode * bFunc, st__table * pCache, int * pVar2Form, int * pForm2Var, DdNode * pbCube0[], DdNode * pbCube1[] ); static DdNode * Extra_bddNodePointedByCube( DdManager * dd, DdNode * bF, DdNode * bC ); @@ -58,7 +58,7 @@ DdNode * Dsd_TreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode ) int i, iVar, iLev, * pPermute; DdNode ** pbCube0, ** pbCube1; DdNode * bFunc, * bRes, * bTemp; - st_table * pCache; + st__table * pCache; pPermute = ABC_ALLOC( int, dd->size ); pVar2Form = ABC_ALLOC( int, dd->size ); @@ -100,9 +100,9 @@ DdNode * Dsd_TreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode ) } // remap the function - pCache = st_init_table(st_ptrcmp, st_ptrhash);; + pCache = st__init_table( st__ptrcmp, st__ptrhash);; bRes = Extra_dsdRemap( dd, bFunc, pCache, pVar2Form, pForm2Var, pbCube0, pbCube1 ); Cudd_Ref( bRes ); - st_free_table( pCache ); + st__free_table( pCache ); Cudd_RecursiveDeref( dd, bFunc ); for ( i = 0; i < pNode->nDecs; i++ ) @@ -143,7 +143,7 @@ DdNode * Dsd_TreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode ) SeeAlso [] ***********************************************************************/ -DdNode * Extra_dsdRemap( DdManager * dd, DdNode * bF, st_table * pCache, +DdNode * Extra_dsdRemap( DdManager * dd, DdNode * bF, st__table * pCache, int * pVar2Form, int * pForm2Var, DdNode * pbCube0[], DdNode * pbCube1[] ) { DdNode * bFR, * bF0, * bF1; @@ -157,7 +157,7 @@ DdNode * Extra_dsdRemap( DdManager * dd, DdNode * bF, st_table * pCache, // check the hash-table if ( bFR->ref != 1 ) { - if ( st_lookup( pCache, (char *)bF, (char **)&bRes ) ) + if ( st__lookup( pCache, (char *)bF, (char **)&bRes ) ) return bRes; } @@ -179,7 +179,7 @@ DdNode * Extra_dsdRemap( DdManager * dd, DdNode * bF, st_table * pCache, // add to the hash table if ( bFR->ref != 1 ) - st_insert( pCache, (char *)bF, (char *)bRes ); + st__insert( pCache, (char *)bF, (char *)bRes ); Cudd_Deref( bRes ); return bRes; } @@ -208,7 +208,7 @@ DdNode * Extra_bddNodePointedByCube( DdManager * dd, DdNode * bF, DdNode * bC ) // bRes = cuddCacheLookup2( dd, Extra_bddNodePointedByCube, bF, bC ); // if ( bRes ) -// return bRes; +// return bRes; // there is no need for caching because this operation is very fast // there will no gain reusing the results of this operations // instead, it will flush CUDD cache of other useful entries @@ -310,7 +310,7 @@ DdNode * dsdTreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode, int fRemap Cudd_RecursiveDeref( dd, bNewFunc ); // use the variable in the i-th level of the manager -// bNewFunc = Cudd_bddIte( dd, dd->vars[dd->invperm[i]],bCof1,bCof0 ); Cudd_Ref( bNewFunc ); +// bNewFunc = Cudd_bddIte( dd, dd->vars[dd->invperm[i]],bCof1,bCof0 ); Cudd_Ref( bNewFunc ); // use the first variale in the support of the component bNewFunc = Cudd_bddIte( dd, dd->vars[pNode->pDecs[i]->S->index],bCof1,bCof0 ); Cudd_Ref( bNewFunc ); Cudd_RecursiveDeref( dd, bCof0 ); @@ -322,7 +322,7 @@ DdNode * dsdTreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode, int fRemap // remap the function to the top of the manager // remap the function to the first variables of the manager for ( i = 0; i < pNode->nDecs; i++ ) - // Permute[ pNode->pDecs[i]->S->index ] = dd->invperm[i]; + // Permute[ pNode->pDecs[i]->S->index ] = dd->invperm[i]; Permute[ pNode->pDecs[i]->S->index ] = i; bNewFunc = Cudd_bddPermute( dd, bTemp = bNewFunc, Permute ); Cudd_Ref( bNewFunc ); diff --git a/src/bdd/dsd/dsdMan.c b/src/bdd/dsd/dsdMan.c index 8d108317..1490fcf3 100644 --- a/src/bdd/dsd/dsdMan.c +++ b/src/bdd/dsd/dsdMan.c @@ -63,19 +63,19 @@ Dsd_Manager_t * Dsd_ManagerStart( DdManager * dd, int nSuppMax, int fVerbose ) dMan->pInputs = (Dsd_Node_t **) ABC_ALLOC( char, dMan->nInputs * sizeof(Dsd_Node_t *) ); // create the primary inputs and insert them into the table - dMan->Table = st_init_table(st_ptrcmp, st_ptrhash); + dMan->Table = st__init_table( st__ptrcmp, st__ptrhash); for ( i = 0; i < dMan->nInputs; i++ ) { pNode = Dsd_TreeNodeCreate( DSD_NODE_BUF, 1, 0 ); pNode->G = dd->vars[i]; Cudd_Ref( pNode->G ); pNode->S = dd->vars[i]; Cudd_Ref( pNode->S ); - st_insert( dMan->Table, (char*)dd->vars[i], (char*)pNode ); + st__insert( dMan->Table, (char*)dd->vars[i], (char*)pNode ); dMan->pInputs[i] = pNode; } pNode = Dsd_TreeNodeCreate( DSD_NODE_CONST1, 0, 0 ); pNode->G = b1; Cudd_Ref( pNode->G ); pNode->S = b1; Cudd_Ref( pNode->S ); - st_insert( dMan->Table, (char*)b1, (char*)pNode ); + st__insert( dMan->Table, (char*)b1, (char*)pNode ); dMan->pConst1 = pNode; Dsd_CheckCacheAllocate( 5000 ); @@ -99,13 +99,13 @@ Dsd_Manager_t * Dsd_ManagerStart( DdManager * dd, int nSuppMax, int fVerbose ) ***********************************************************************/ void Dsd_ManagerStop( Dsd_Manager_t * dMan ) { - st_generator * gen; + st__generator * gen; Dsd_Node_t * pNode; DdNode * bFunc; // delete the nodes - st_foreach_item( dMan->Table, gen, (const char**)&bFunc, (char**)&pNode ) + st__foreach_item( dMan->Table, gen, (const char**)&bFunc, (char**)&pNode ) Dsd_TreeNodeDelete( dMan->dd, Dsd_Regular(pNode) ); - st_free_table(dMan->Table); + st__free_table(dMan->Table); ABC_FREE( dMan->pInputs ); ABC_FREE( dMan->pRoots ); ABC_FREE( dMan ); diff --git a/src/bdd/dsd/dsdProc.c b/src/bdd/dsd/dsdProc.c index 291648b3..996fd3dc 100644 --- a/src/bdd/dsd/dsdProc.c +++ b/src/bdd/dsd/dsdProc.c @@ -202,7 +202,7 @@ s_Loops2Useless = 0; printf( " Completely decomposable outputs = %5d\n", nCBFOutputs ); printf( " The sum of max gate sizes = %5d\n", SumMaxGateSize ); printf( " Shared BDD size = %5d\n", Cudd_SharingSize( pbFuncs, nFuncs ) ); - printf( " Decomposition entries = %5d\n", st_count( pDsdMan->Table ) ); + printf( " Decomposition entries = %5d\n", st__count( pDsdMan->Table ) ); printf( " Pure decomposition time = %.2f sec\n", (float)(clock() - clk)/(float)(CLOCKS_PER_SEC) ); } /* @@ -275,7 +275,7 @@ Dsd_Node_t * dsdKernelDecompose_rec( Dsd_Manager_t * pDsdMan, DdNode * bFunc0 ) int fCompF = (int)(bF != bFunc0); // check cache - if ( st_lookup( pDsdMan->Table, (char*)bF, (char**)&pTableEntry ) ) + if ( st__lookup( pDsdMan->Table, (char*)bF, (char**)&pTableEntry ) ) { // the entry is present HashSuccess++; return Dsd_NotCond( pTableEntry, fCompF ); @@ -338,19 +338,19 @@ Dsd_Node_t * dsdKernelDecompose_rec( Dsd_Manager_t * pDsdMan, DdNode * bFunc0 ) ///////////////////////////////////////////////////////////////// if ( pHR->Type == DSD_NODE_OR && pH != pHR ) // DSD_NODE_OR and complement { // add to the components - pThis = Dsd_TreeNodeCreate( DSD_NODE_OR, pHR->nDecs+1, s_nDecBlocks++ ); + pThis = Dsd_TreeNodeCreate( DSD_NODE_OR, pHR->nDecs+1, s_nDecBlocks++ ); dsdKernelCopyListPlusOne( pThis, Dsd_Not(pVarCurDE), pHR->pDecs, pHR->nDecs ); pThis = Dsd_Not(pThis); } else // all other cases { // create a new 2-input NOR gate - pThis = Dsd_TreeNodeCreate( DSD_NODE_OR, 2, s_nDecBlocks++ ); + pThis = Dsd_TreeNodeCreate( DSD_NODE_OR, 2, s_nDecBlocks++ ); pH = Dsd_Not(pH); dsdKernelCopyListPlusOne( pThis, Dsd_Not(pVarCurDE), &pH, 1 ); pThis = Dsd_Not(pThis); } else // if ( bLow == b1 ) - ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// // Low == 1, High != 1, F = x'&1 + x&High = x' + High --- DSD_NODE_OR(x',High) ///////////////////////////////////////////////////////////////// if ( pHR->Type == DSD_NODE_OR && pH == pHR ) // OR and no complement @@ -412,8 +412,8 @@ Dsd_Node_t * dsdKernelDecompose_rec( Dsd_Manager_t * pDsdMan, DdNode * bFunc0 ) /* if ( Depth == 1 ) { -// PRK(bLow,pDecTreeTotal->nInputs); -// PRK(bHigh,pDecTreeTotal->nInputs); +// PRK(bLow,pDecTreeTotal->nInputs); +// PRK(bHigh,pDecTreeTotal->nInputs); if ( s_Show ) { PRD( pL ); @@ -503,7 +503,7 @@ if ( s_Show ) } for ( g = 0; g < pLargeR->nDecs; g++ ) -// if ( g != c ) +// if ( g != c ) { pDETemp = pLargeR->pDecs[g]; // cannot be complemented if ( Dsd_CheckRootFunctionIdentity( dd, bLarge, bSmall, pDETemp->G, b1 ) ) @@ -584,7 +584,7 @@ if ( s_Show ) if ( pComp ) // the decomposition is possible! { -// Dsd_Node_t * pComp = pLargeR->pDecs[iCompLarge]; +// Dsd_Node_t * pComp = pLargeR->pDecs[iCompLarge]; Dsd_Node_t * pCompR = Dsd_Regular( pComp ); int fComp1 = (int)( pLarge != pLargeR ); int fComp2 = (int)( pComp != pCompR ); @@ -753,7 +753,7 @@ if ( s_Show ) dsdKernelComputeSumOfComponents( pDsdMan, pCommon, nCommon, &bCommF, &bCommS, 0 ); Cudd_Ref( bCommF ); Cudd_Ref( bCommS ); - bFTemp = ( pL != pLR )? Cudd_Not(bF): bF; + bFTemp = ( pL != pLR )? Cudd_Not(bF): bF; bFuncNew = Cudd_bddAndAbstract( dd, bFTemp, Cudd_Not(bCommF), bCommS ); Cudd_Ref( bFuncNew ); Cudd_RecursiveDeref( dd, bCommF ); @@ -768,7 +768,7 @@ if ( s_Show ) // call the decomposition recursively pDENew = dsdKernelDecompose_rec( pDsdMan, bFuncNew ); -// assert( !Dsd_IsComplement(pDENew) ); // follows from the consideration of cases +// assert( !Dsd_IsComplement(pDENew) ); // follows from the consideration of cases Cudd_RecursiveDeref( dd, bFuncNew ); // add the first component @@ -824,12 +824,12 @@ if ( s_Show ) Dsd_Node_t * pDENew; DdNode * bFuncNew; - int fCompComp = 0; // this flag can be {0,1,2} + int fCompComp = 0; // this flag can be {0,1,2} // if it is 0 there is no identity // if it is 1/2, the cofactored functions are equal in the direct/complemented polarity if ( nCommon == pLR->nDecs ) - { // all the components are the same + { // all the components are the same // find the formal input, in which pLow and pHigh differ (if such input exists) int m; Dsd_Node_t * pTempL, * pTempH; @@ -1039,11 +1039,11 @@ if ( s_Show ) // find the first component in pHigher // whose support does not overlap with supp(Lower) // and remember the previous component - int fPolarity; + int fPolarity; Dsd_Node_t * pPrev = NULL; // the pointer to the component proceeding pCur Dsd_Node_t * pCur = pHigher; // the first component not contained in supp(Lower) while ( Extra_bddSuppOverlapping( dd, pCur->S, bSuppLower ) ) - { // get the next component + { // get the next component pPrev = pCur; pCur = dsdKernelFindContainingComponent( pDsdMan, pCur, bVarTop, &fPolarity ); }; @@ -1176,7 +1176,7 @@ if ( s_Show ) if ( nCommon == 0 || nCommon == 1 ) { // one one component was found, which is the original one - // assert( Dsd_Regular(pCommon[0]) == pCurL); + // assert( Dsd_Regular(pCommon[0]) == pCurL); // add the new decomposition entry pThis->pDecs[ nEntries++ ] = pCurL; // assign the support to be subtracted from both components @@ -1242,7 +1242,7 @@ EXIT: assert( bSuppNew ); pThisR->S = bSuppNew; // takes the reference from the new support - if ( st_insert( pDsdMan->Table, (char*)bF, (char*)pThis ) ) + if ( st__insert( pDsdMan->Table, (char*)bF, (char*)pThis ) ) { assert( 0 ); } @@ -1303,8 +1303,8 @@ Dsd_Node_t * dsdKernelFindContainingComponent( Dsd_Manager_t * pDsdMan, Dsd_Node Dsd_Node_t * pTemp; int i; -// assert( !Dsd_IsComplement( pWhere ) ); -// assert( Extra_bddSuppContainVar( pDsdMan->dd, pWhere->S, Var ) ); +// assert( !Dsd_IsComplement( pWhere ) ); +// assert( Extra_bddSuppContainVar( pDsdMan->dd, pWhere->S, Var ) ); if ( pWhere->nDecs == 1 ) return NULL; @@ -1408,7 +1408,7 @@ int dsdKernelFindCommonComponents( Dsd_Manager_t * pDsdMan, Dsd_Node_t * pL, Dsd // return the pointer to the array *pCommon = Common; // return the number of common components - return nCommon; + return nCommon; } /**Function************************************************************* @@ -1587,7 +1587,7 @@ int dsdKernelVerifyDecomposition( Dsd_Manager_t * pDsdMan, Dsd_Node_t * pDE ) bGVars[dd->invperm[i]] = pR->pDecs[i]->G; // perform the composition - bRes = Cudd_bddVectorCompose( dd, bNewFunc, bGVars ); Cudd_Ref( bRes ); + bRes = Cudd_bddVectorCompose( dd, bNewFunc, bGVars ); Cudd_Ref( bRes ); Cudd_RecursiveDeref( dd, bNewFunc ); ///////////////////////////////////////////////////////// diff --git a/src/bdd/dsd/dsdTree.c b/src/bdd/dsd/dsdTree.c index 9d1269a1..e534e00a 100644 --- a/src/bdd/dsd/dsdTree.c +++ b/src/bdd/dsd/dsdTree.c @@ -688,7 +688,7 @@ void Dsd_TreePrint_rec( FILE * pFile, Dsd_Node_t * pNode, int fComp, char * pInp pInputNums = ABC_ALLOC( int, pNode->nDecs ); if ( pNode->Type == DSD_NODE_CONST1 ) { - fprintf( pFile, " Constant 1.\n" ); + fprintf( pFile, " Constant 1.\n" ); } else if ( pNode->Type == DSD_NODE_BUF ) { @@ -1036,7 +1036,7 @@ DdNode * Dsd_TreeGetPrimeFunctionOld( DdManager * dd, Dsd_Node_t * pNode, int fR Cudd_RecursiveDeref( dd, bNewFunc ); // use the variable in the i-th level of the manager -// bNewFunc = Cudd_bddIte( dd, dd->vars[dd->invperm[i]],bCof1,bCof0 ); Cudd_Ref( bNewFunc ); +// bNewFunc = Cudd_bddIte( dd, dd->vars[dd->invperm[i]],bCof1,bCof0 ); Cudd_Ref( bNewFunc ); // use the first variale in the support of the component bNewFunc = Cudd_bddIte( dd, dd->vars[pNode->pDecs[i]->S->index],bCof1,bCof0 ); Cudd_Ref( bNewFunc ); Cudd_RecursiveDeref( dd, bCof0 ); @@ -1048,7 +1048,7 @@ DdNode * Dsd_TreeGetPrimeFunctionOld( DdManager * dd, Dsd_Node_t * pNode, int fR // remap the function to the top of the manager // remap the function to the first variables of the manager for ( i = 0; i < pNode->nDecs; i++ ) - // Permute[ pNode->pDecs[i]->S->index ] = dd->invperm[i]; + // Permute[ pNode->pDecs[i]->S->index ] = dd->invperm[i]; Permute[ pNode->pDecs[i]->S->index ] = i; bNewFunc = Cudd_bddPermute( dd, bTemp = bNewFunc, Permute ); Cudd_Ref( bNewFunc ); |