summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-09-26 11:05:48 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2021-09-26 11:05:48 -0700
commit787dbb9433e2757d087db55217194bad4773c0de (patch)
tree5b052bd3d6ef6ec486ca227eb940bacae3b8e53c /src
parentbaf2a6508dde77b466808d83f98bf7e98b7628d6 (diff)
downloadabc-787dbb9433e2757d087db55217194bad4773c0de.tar.gz
abc-787dbb9433e2757d087db55217194bad4773c0de.tar.bz2
abc-787dbb9433e2757d087db55217194bad4773c0de.zip
Two rare corner-case bugs in &if mapper.
Diffstat (limited to 'src')
-rw-r--r--src/base/abci/abcIf.c6
-rw-r--r--src/map/if/ifMap.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c
index ab88c5e2..491e2c14 100644
--- a/src/base/abci/abcIf.c
+++ b/src/base/abci/abcIf.c
@@ -230,9 +230,13 @@ If_Man_t * Abc_NtkToIf( Abc_Ntk_t * pNtk, If_Par_t * pPars )
Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)If_ManConst1( pIfMan );
Abc_NtkForEachCi( pNtk, pNode, i )
{
- pNode->pCopy = (Abc_Obj_t *)If_ManCreateCi( pIfMan );
+ If_Obj_t * pIfObj = If_ManCreateCi( pIfMan );
+ pNode->pCopy = (Abc_Obj_t *)pIfObj;
// transfer logic level information
Abc_ObjIfCopy(pNode)->Level = pNode->Level;
+ // mark the largest level
+ if ( pIfMan->nLevelMax < (int)pIfObj->Level )
+ pIfMan->nLevelMax = (int)pIfObj->Level;
}
// load the AIG into the mapper
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index 759ae9be..f234d354 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -225,7 +225,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->fPower )
pCut->Power = (Mode == 2)? If_CutPowerDerefed( p, pCut, pObj ) : If_CutPowerFlow( p, pCut, pObj );
// save the best cut from the previous iteration
- if ( !fPreprocess )
+ if ( !fPreprocess || pCut->nLeaves <= 1 )
If_CutCopy( p, pCutSet->ppCuts[pCutSet->nCuts++], pCut );
}