70 int i, nNodes, nGain, fCompl, RetValue = 1;
71 abctime clk, clkStart = Abc_Clock();
73 assert( Abc_NtkIsStrash(pNtk) );
93 if ( pManRwr == NULL )
100 pManCut = Abc_NtkStartCutManForRewrite( pNtk );
108 pManRwr->
nNodesBeg = Abc_NtkNodeNum(pNtk);
109 nNodes = Abc_NtkObjNumMax(pNtk);
113 Extra_ProgressBarUpdate( pProgress, i, NULL );
118 if ( Abc_NodeIsPersistant(pNode) )
121 if ( Abc_ObjFanoutNum(pNode) > 1000 )
125 nGain =
Rwr_NodeRewrite( pManRwr, pManCut, pNode, fUpdateLevel, fUseZeros, fPlaceEnable );
126 if ( !(nGain > 0 || (nGain == 0 && fUseZeros)) )
139 if ( fCompl ) Dec_GraphComplement( pGraph );
147 if ( fCompl ) Dec_GraphComplement( pGraph );
156 pManRwr->
nNodesEnd = Abc_NtkNodeNum(pNtk);
191 printf(
"Abc_NtkRewrite: The network check has failed.\n" );
225 pParams->
nIdsMax = Abc_NtkObjNumMax( pNtk );
227 if ( pParams->
fDrop )
231 if ( Abc_ObjFanoutNum(pObj) > 0 )
280 pRoot = (
Abc_Obj_t *)Vec_PtrEntryLast(vDivs);
286 printf(
"%6d : %c\n", pNode->
Id,
'a'+i );
289 printf(
"%6d : %2d = ", pNode->
Id, i );
292 if ( Abc_ObjFanin0(pNode) == pFanin )
295 printf(
"%c",
'a' + k );
298 printf(
"%s ", Abc_ObjFaninC0(pNode)?
"\'" :
"" );
301 if ( Abc_ObjFanin1(pNode) == pFanin )
304 printf(
"%c",
'a' + k );
307 printf(
"%s ", Abc_ObjFaninC1(pNode)?
"\'" :
"" );
308 if ( pNode == pRoot )
328 if ( Abc_NodeIsTravIdCurrent(pNode) )
330 Abc_NodeSetTravIdCurrent(pNode);
333 Vec_PtrPush( vDivs, pNode );
353 vDivs = Vec_PtrAlloc( 100 );
354 Abc_NtkIncrementTravId( pNtk );
357 Abc_NodeSetTravIdCurrent( Abc_ObjRegular(pObj) );
358 Vec_PtrPush( vDivs, Abc_ObjRegular(pObj) );
362 Vec_PtrFree( vDivs );
379 if ( Vec_PtrFind(vLeaves, pNode) >= 0 || Vec_PtrFind(vLeaves, Abc_ObjNot(pNode)) >= 0 )
382 Abc_ObjRegular(pNode)->fMarkA = 1;
384 Abc_ObjRegular(pNode)->fMarkB = 1;
387 assert( Abc_ObjIsNode(pNode) );
406 int i, CountA, CountB;
412 CountA += Abc_ObjRegular(pObj)->fMarkA;
413 CountB += Abc_ObjRegular(pObj)->fMarkB;
414 Abc_ObjRegular(pObj)->fMarkA = 0;
415 Abc_ObjRegular(pObj)->fMarkB = 0;
417 printf(
"(%d,%d:%d) ", CountA, CountB, CountA+CountB-Vec_PtrSize(vLeaves) );
void Abc_NodePrintCuts(Abc_Obj_t *pNode)
void Abc_ManShowCutCone(Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves)
int Dec_GraphUpdateNetwork(Abc_Obj_t *pRoot, Dec_Graph_t *pGraph, int fUpdateLevel, int nGain)
void Abc_RwrExpWithCut_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, int fUseA)
void Abc_PlaceUpdate(Vec_Ptr_t *vAddedCells, Vec_Ptr_t *vUpdatedNets)
void Abc_RwrExpWithCut(Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves)
void Abc_ManRewritePrintDivs(Vec_Ptr_t *vDivs, int nLeaves)
void Abc_ManShowCutCone_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vDivs)
int Abc_NtkRewrite(Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
void Abc_PlaceBegin(Abc_Ntk_t *pNtk)
void Abc_PlaceEnd(Abc_Ntk_t *pNtk)
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL void Abc_AigUpdateReset(Abc_Aig_t *pMan)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
struct Abc_Aig_t_ Abc_Aig_t
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
ABC_DLL Vec_Int_t * Abc_NtkFanoutCounts(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
#define Abc_NtkForEachCi(pNtk, pCi, i)
ABC_DLL void Abc_NtkReassignIds(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
struct Cut_ParamsStruct_t_ Cut_Params_t
void Cut_NodeSetTriv(Cut_Man_t *p, int Node)
Cut_Man_t * Cut_ManStart(Cut_Params_t *pParams)
FUNCTION DEFINITIONS ///.
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
void Cut_CutPrint(Cut_Cut_t *pCut, int fSeq)
void Cut_ManSetFanoutCounts(Cut_Man_t *p, Vec_Int_t *vFanCounts)
struct Cut_CutStruct_t_ Cut_Cut_t
void Cut_ManStop(Cut_Man_t *p)
struct Dec_Graph_t_ Dec_Graph_t
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
void Rwr_ManAddTimeUpdate(Rwr_Man_t *p, abctime Time)
Rwr_Man_t * Rwr_ManStart(int fPrecompute)
DECLARATIONS ///.
void Rwr_ScoresClean(Rwr_Man_t *p)
void Rwr_ManAddTimeCuts(Rwr_Man_t *p, abctime Time)
void Rwr_ManAddTimeTotal(Rwr_Man_t *p, abctime Time)
void Rwr_ScoresReport(Rwr_Man_t *p)
int Rwr_ManReadCompl(Rwr_Man_t *p)
void Rwr_ManPrintStats(Rwr_Man_t *p)
struct Rwr_Man_t_ Rwr_Man_t
void Rwr_ManStop(Rwr_Man_t *p)
int Rwr_NodeRewrite(Rwr_Man_t *p, Cut_Man_t *pManCut, Abc_Obj_t *pNode, int fUpdateLevel, int fUseZeros, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
void * Rwr_ManReadDecs(Rwr_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.