summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2018-04-11 18:33:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2018-04-11 18:33:00 -0700
commita8f913f75a6e5d80b5a137c8fbda0676d49e72b4 (patch)
tree3b79c45e3abe465c89d3d739ff15426af41084ca /src/aig/gia
parenta41a910864cb82e1374fc8920a087c35c506ed6d (diff)
downloadabc-a8f913f75a6e5d80b5a137c8fbda0676d49e72b4.tar.gz
abc-a8f913f75a6e5d80b5a137c8fbda0676d49e72b4.tar.bz2
abc-a8f913f75a6e5d80b5a137c8fbda0676d49e72b4.zip
Making sure duplicated inverters are not created.
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/giaMini.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/aig/gia/giaMini.c b/src/aig/gia/giaMini.c
index e14a9a9e..41c6a702 100644
--- a/src/aig/gia/giaMini.c
+++ b/src/aig/gia/giaMini.c
@@ -305,6 +305,7 @@ Mini_Lut_t * Gia_ManToMiniLut( Gia_Man_t * pGia )
Vec_Bit_t * vMarks;
Gia_Obj_t * pObj, * pFanin;
Vec_Int_t * vLeaves = Vec_IntAlloc( 16 );
+ Vec_Int_t * vInvMap = Vec_IntStart( Gia_ManObjNum(pGia) );
int i, k, iFanin, LutSize, nWords, Count = 0, pVars[16];
word * pTruth;
assert( Gia_ManHasMapping(pGia) );
@@ -361,12 +362,17 @@ Mini_Lut_t * Gia_ManToMiniLut( Gia_Man_t * pGia )
pObj->Value = Mini_LutCreatePo( p, Gia_ObjFanin0(pObj)->Value );
else // add inverter LUT
{
- int Fanin = Gia_ObjFanin0(pObj)->Value;
- int LutInv = Mini_LutCreateNode( p, 1, &Fanin, (unsigned *)pTruth );
+ int LutInv, Fanin = Gia_ObjFanin0(pObj)->Value;
+ if ( (LutInv = Vec_IntEntry(vInvMap, Fanin)) == 0 )
+ {
+ LutInv = Mini_LutCreateNode( p, 1, &Fanin, (unsigned *)pTruth );
+ Vec_IntWriteEntry( vInvMap, Fanin, LutInv );
+ Count++;
+ }
pObj->Value = Mini_LutCreatePo( p, LutInv );
- Count++;
}
}
+ Vec_IntFree( vInvMap );
Vec_BitFree( vMarks );
Gia_ObjComputeTruthTableStop( pGia );
// set registers