From 1eae17a89d711a37274f116707dc639c30823080 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 14 Aug 2013 11:32:11 -0700 Subject: Bug fix in &if -z. --- src/aig/gia/giaIf.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/aig') diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index 3238a3dc..bccedf2d 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -235,7 +235,7 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p ) Abc_Print( 1, "lev =%5d ", LevelMax ); Abc_Print( 1, "mem =%5.2f MB", 4.0*(Gia_ManObjNum(p) + 2*nLuts + nFanins)/(1<<20) ); Abc_Print( 1, "\n" ); -/* + { char * pFileName = "stats_map.txt"; static char FileNameOld[1000] = {0}; @@ -262,7 +262,7 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p ) } fclose( pTable ); } -*/ + } /**Function************************************************************* @@ -704,9 +704,12 @@ int Gia_ManFromIfLogicNode( Gia_Man_t * pNew, int iObj, Vec_Int_t * vLeaves, Vec // create mapping iObjLit1 = Gia_ManFromIfLogicCreateLut( pNew, pRes, vLeaves, vCover, vMapping, vMapping2 ); // write packing - Vec_IntPush( vPacking, 1 ); - Vec_IntPush( vPacking, Abc_Lit2Var(iObjLit1) ); - Vec_IntAddToEntry( vPacking, 0, 1 ); + if ( !Gia_ObjIsCi(Gia_ManObj(pNew, Abc_Lit2Var(iObjLit1))) ) + { + Vec_IntPush( vPacking, 1 ); + Vec_IntPush( vPacking, Abc_Lit2Var(iObjLit1) ); + Vec_IntAddToEntry( vPacking, 0, 1 ); + } return iObjLit1; } else @@ -754,6 +757,14 @@ int Gia_ManFromIfLogicNode( Gia_Man_t * pNew, int iObj, Vec_Int_t * vLeaves, Vec } return iObjLit1; } + // check for elementary truth table + for ( i = 0; i < nLeaves; i++ ) + { + if ( Kit_TruthIsEqual((unsigned *)pRes, (unsigned *)pTruths[i], nLeaves) ) + return Vec_IntEntry(vLeaves, i); + if ( Kit_TruthIsOpposite((unsigned *)pRes, (unsigned *)pTruths[i], nLeaves) ) + return Abc_LitNot(Vec_IntEntry(vLeaves, i)); + } // perform decomposition if ( Length == 2 ) -- cgit v1.2.3