Commit 787dbb94 by Alan Mishchenko

Two rare corner-case bugs in &if mapper.

parent baf2a650
......@@ -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
......
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment