31static void Abc_NtkPrintCuts(
void *
p,
Abc_Ntk_t * pNtk,
int fSeq );
32static void Abc_NtkPrintCuts_(
void *
p,
Abc_Ntk_t * pNtk,
int fSeq );
56 Abc_Obj_t * pObj, * pFan0, * pFan1, * pFanC;
63 pFanC = Abc_ObjRegular(pFanC);
64 pFan0 = Abc_ObjRegular(pFan0);
75 printf(
"Subtracted %d fanouts\n", Counter );
91 Abc_Obj_t * pObj, * pFan0, * pFan1, * pFanC;
98 pFanC = Abc_ObjRegular(pFanC);
99 pFan0 = Abc_ObjRegular(pFan0);
108 printf(
"Added %d fanouts\n", Counter );
141 assert( Abc_NtkIsStrash(pNtk) );
143 pParams->
nIdsMax = Abc_NtkObjNumMax( pNtk );
152 if ( pParams->
fDrop )
156 if ( Abc_ObjFanoutNum(pObj) > 0 )
160 vChoices = Vec_IntAlloc( 100 );
165 if ( Abc_ObjIsCo(pObj) )
167 if ( pParams->
fDrop )
174 Extra_ProgressBarUpdate( pProgress, i, NULL );
181 for ( pCut = pList; pCut; pCut = pCut->
pNext )
186 if ( pParams->
fDrop )
192 if ( Abc_AigNodeIsChoice(pObj) )
194 Vec_IntClear( vChoices );
196 Vec_IntPush( vChoices, pNode->
Id );
201 Vec_PtrFree( vNodes );
202 Vec_IntFree( vChoices );
204ABC_PRT(
"TOTAL", Abc_Clock() - clk );
235 assert( Abc_NtkIsStrash(pNtk) );
243 if ( Abc_ObjFanoutNum(pObj) > 0 )
251 if ( Abc_ObjIsCo(pObj) )
262 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
270 Vec_PtrFree( vNodes );
436 int fDagNode, fTriv, TreeCode = 0;
438 assert( Abc_ObjFaninNum(pObj) == 2 );
445 fTriv = fDagNode || !fDag;
449 pFanin = Abc_ObjFanin0(pObj);
451 pFanin = Abc_ObjFanin1(pObj);
461 fDagNode = Vec_IntEntry( vNodeAttrs, pObj->
Id );
464 fTriv = !Vec_IntEntry( vNodeAttrs, pObj->
Id );
466 pFanin = Abc_ObjFanin0(pObj);
467 TreeCode |= Vec_IntEntry( vNodeAttrs, pFanin->
Id );
468 pFanin = Abc_ObjFanin1(pObj);
469 TreeCode |= (Vec_IntEntry( vNodeAttrs, pFanin->
Id ) << 1);
473 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj), fTriv, TreeCode );
543void Abc_NtkPrintCuts(
void *
p,
Abc_Ntk_t * pNtk,
int fSeq )
548 printf(
"Cuts of the network:\n" );
568void Abc_NtkPrintCuts_(
void *
p,
Abc_Ntk_t * pNtk,
int fSeq )
572 pObj = Abc_NtkObj( pNtk, 2 * Abc_NtkObjNum(pNtk) / 3 );
595 int nNodesTotal = 0, nMffcsTotal = 0;
598 vAttrs = Vec_IntStart( Abc_NtkObjNumMax(pNtk) + 1 );
604 if ( Abc_ObjIsNode(pObj) )
606 if ( Abc_ObjIsCo(pObj) && Abc_ObjIsNode(Abc_ObjFanin0(pObj)) )
616 if ( nMffc > 2 || Abc_ObjFanoutNum(pObj) > 8 )
617 Vec_IntWriteEntry( vAttrs, pObj->
Id, 1 );
633 printf(
"Total nodes = %d. Total MFFC nodes = %d.\n", nNodesTotal, nMffcsTotal );
650 if ( Abc_NodeIsTravIdCurrent(pObj) )
652 Abc_NodeSetTravIdCurrent(pObj);
653 if ( Vec_IntEntry( vAttrs, pObj->
Id ) )
655 if ( Abc_ObjIsCi(pObj) )
657 assert( Abc_ObjFaninNum(pObj) == 2 );
679 vAttrs = Vec_IntStart( Abc_NtkObjNumMax(pNtk) + 1 );
686 Abc_NtkIncrementTravId( pNtk );
689 Vec_IntWriteEntry( vAttrs, pObj->
Id, 1 );
void Abc_NtkBalanceAttach(Abc_Ntk_t *pNtk)
void Abc_NtkBalanceDetach(Abc_Ntk_t *pNtk)
void Npn_ManSaveOne(unsigned *puTruth, int nVars)
Vec_Ptr_t * Abc_NodeMffcInsideCollect(Abc_Obj_t *pNode)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
ABC_DLL Vec_Ptr_t * Abc_AigDfs(Abc_Ntk_t *pNtk, int fCollectAll, int fCollectCos)
ABC_DLL int Abc_NtkIsDfsOrdered(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NodeMffcSize(Abc_Obj_t *pNode)
FUNCTION DEFINITIONS ///.
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL Vec_Int_t * Abc_NtkFanoutCounts(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NodeIsMuxControlType(Abc_Obj_t *pNode)
#define Abc_NtkForEachCi(pNtk, pCi, i)
ABC_DLL int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux(Abc_Obj_t *pNode, Abc_Obj_t **ppNodeT, Abc_Obj_t **ppNodeE)
ABC_DLL int Abc_NodeIsExorType(Abc_Obj_t *pNode)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Vec_Int_t * Abc_NtkGetNodeAttributes2(Abc_Ntk_t *pNtk)
void Abc_NtkCutsAddFanunt(Abc_Ntk_t *pNtk)
void Abc_NtkCutsSubtractFanunt(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
void * Abc_NodeGetCutsRecursive(void *p, Abc_Obj_t *pObj, int fDag, int fTree)
int nTotal
DECLARATIONS ///.
void * Abc_NodeReadCuts(void *p, Abc_Obj_t *pObj)
Cut_Man_t * Abc_NtkCuts(Abc_Ntk_t *pNtk, Cut_Params_t *pParams)
int Abc_NtkSubDagSize_rec(Abc_Obj_t *pObj, Vec_Int_t *vAttrs)
void Abc_NodeGetCutsSeq(void *p, Abc_Obj_t *pObj, int fTriv)
void Abc_NodeFreeCuts(void *p, Abc_Obj_t *pObj)
void * Abc_NodeGetCuts(void *p, Abc_Obj_t *pObj, int fDag, int fTree)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
void Cut_OracleTryDroppingCuts(Cut_Oracle_t *p, int Node)
void Cut_CutPrintList(Cut_Cut_t *pList, int fSeq)
void Cut_ManIncrementDagNodes(Cut_Man_t *p)
void Cut_NodeTryDroppingCuts(Cut_Man_t *p, int Node)
Cut_Cut_t * Cut_NodeComputeCuts(Cut_Man_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1, int fTriv, int TreeCode)
Cut_Cut_t * Cut_OracleComputeCuts(Cut_Oracle_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1)
struct Cut_ParamsStruct_t_ Cut_Params_t
void Cut_NodeSetTriv(Cut_Man_t *p, int Node)
Cut_Cut_t * Cut_NodeUnionCuts(Cut_Man_t *p, Vec_Int_t *vNodes)
void Cut_ManPrintStats(Cut_Man_t *p)
void Cut_ManSetNodeAttrs(Cut_Man_t *p, Vec_Int_t *vFanCounts)
int Cut_OracleReadDrop(Cut_Oracle_t *p)
Cut_Man_t * Cut_ManStart(Cut_Params_t *pParams)
FUNCTION DEFINITIONS ///.
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
Cut_Cut_t * Cut_NodeReadCutsNew(Cut_Man_t *p, int Node)
MACRO DEFINITIONS ///.
void Cut_OracleSetFanoutCounts(Cut_Oracle_t *p, Vec_Int_t *vFanCounts)
Vec_Int_t * Cut_ManReadNodeAttrs(Cut_Man_t *p)
void Cut_OracleNodeSetTriv(Cut_Oracle_t *p, int Node)
struct Cut_OracleStruct_t_ Cut_Oracle_t
void Cut_NodeFreeCuts(Cut_Man_t *p, int Node)
void Cut_ManSetFanoutCounts(Cut_Man_t *p, Vec_Int_t *vFanCounts)
struct Cut_CutStruct_t_ Cut_Cut_t
Cut_Params_t * Cut_ManReadParams(Cut_Man_t *p)
int Cut_ManMappingArea_rec(Cut_Man_t *p, int Node)
void Abc_NtkCutsOracle(Abc_Ntk_t *pNtk, Cut_Oracle_t *p)
Cut_Man_t * Abc_NtkSeqCuts(Abc_Ntk_t *pNtk, Cut_Params_t *pParams)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.