summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-08-14 11:32:11 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-08-14 11:32:11 -0700
commit1eae17a89d711a37274f116707dc639c30823080 (patch)
tree37b919c968bdf1c9192756b4275dd4858fddd264 /src
parent9b3dd44cd6cf0acb6e3df56ec0b20b512ef2b1eb (diff)
downloadabc-1eae17a89d711a37274f116707dc639c30823080.tar.gz
abc-1eae17a89d711a37274f116707dc639c30823080.tar.bz2
abc-1eae17a89d711a37274f116707dc639c30823080.zip
Bug fix in &if -z.
Diffstat (limited to 'src')
-rw-r--r--src/aig/gia/giaIf.c21
1 files changed, 16 insertions, 5 deletions
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 )