diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-11 20:18:02 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-11 20:18:02 -0800 |
commit | a4aaf110adca0fd9175b90c163d21455fa2d0210 (patch) | |
tree | b006a18c4b052481c9dda35f6a478dbf71e1301f /src/base/abc | |
parent | 759c6596a51eda2b02d2b79c1ee428cbe4a44061 (diff) | |
download | abc-a4aaf110adca0fd9175b90c163d21455fa2d0210.tar.gz abc-a4aaf110adca0fd9175b90c163d21455fa2d0210.tar.bz2 abc-a4aaf110adca0fd9175b90c163d21455fa2d0210.zip |
Exploration of Sasao's decomposition and minor improvements.
Diffstat (limited to 'src/base/abc')
-rw-r--r-- | src/base/abc/abcFunc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/base/abc/abcFunc.c b/src/base/abc/abcFunc.c index 1c88635a..81990bac 100644 --- a/src/base/abc/abcFunc.c +++ b/src/base/abc/abcFunc.c @@ -52,7 +52,7 @@ extern int Abc_CountZddCubes( DdManager * dd, DdNode * zCover ); SeeAlso [] ***********************************************************************/ -DdNode * Abc_ConvertSopToBdd( DdManager * dd, char * pSop ) +DdNode * Abc_ConvertSopToBdd( DdManager * dd, char * pSop, DdNode ** pbVars ) { DdNode * bSum, * bCube, * bTemp, * bVar; char * pCube; @@ -65,7 +65,7 @@ DdNode * Abc_ConvertSopToBdd( DdManager * dd, char * pSop ) { for ( v = 0; v < nVars; v++ ) { - bSum = Cudd_bddXor( dd, bTemp = bSum, Cudd_bddIthVar(dd, v) ); Cudd_Ref( bSum ); + bSum = Cudd_bddXor( dd, bTemp = bSum, pbVars? pbVars[v] : Cudd_bddIthVar(dd, v) ); Cudd_Ref( bSum ); Cudd_RecursiveDeref( dd, bTemp ); } } @@ -78,9 +78,9 @@ DdNode * Abc_ConvertSopToBdd( DdManager * dd, char * pSop ) Abc_CubeForEachVar( pCube, Value, v ) { if ( Value == '0' ) - bVar = Cudd_Not( Cudd_bddIthVar( dd, v ) ); + bVar = Cudd_Not( pbVars? pbVars[v] : Cudd_bddIthVar( dd, v ) ); else if ( Value == '1' ) - bVar = Cudd_bddIthVar( dd, v ); + bVar = pbVars? pbVars[v] : Cudd_bddIthVar( dd, v ); else continue; bCube = Cudd_bddAnd( dd, bTemp = bCube, bVar ); Cudd_Ref( bCube ); @@ -128,7 +128,7 @@ int Abc_NtkSopToBdd( Abc_Ntk_t * pNtk ) Abc_NtkForEachNode( pNtk, pNode, i ) { assert( pNode->pData ); - pNode->pData = Abc_ConvertSopToBdd( dd, (char *)pNode->pData ); + pNode->pData = Abc_ConvertSopToBdd( dd, (char *)pNode->pData, NULL ); if ( pNode->pData == NULL ) { printf( "Abc_NtkSopToBdd: Error while converting SOP into BDD.\n" ); @@ -282,7 +282,7 @@ char * Abc_ConvertBddToSop( Mem_Flex_t * pMan, DdManager * dd, DdNode * bFuncOn, // verify if ( fVerify ) { - bFuncNew = Abc_ConvertSopToBdd( dd, pSop ); Cudd_Ref( bFuncNew ); + bFuncNew = Abc_ConvertSopToBdd( dd, pSop, NULL ); Cudd_Ref( bFuncNew ); if ( bFuncOn == bFuncOnDc ) { if ( bFuncNew != bFuncOn ) @@ -483,7 +483,7 @@ void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk ) Abc_NtkForEachNode( pNtk, pNode, i ) if ( Abc_SopIsComplement((char *)pNode->pData) ) { - bFunc = Abc_ConvertSopToBdd( dd, (char *)pNode->pData ); Cudd_Ref( bFunc ); + bFunc = Abc_ConvertSopToBdd( dd, (char *)pNode->pData, NULL ); Cudd_Ref( bFunc ); pNode->pData = Abc_ConvertBddToSop( (Mem_Flex_t *)pNtk->pManFunc, dd, bFunc, bFunc, Abc_ObjFaninNum(pNode), 0, vCube, 1 ); Cudd_RecursiveDeref( dd, bFunc ); assert( !Abc_SopIsComplement((char *)pNode->pData) ); |