mirror of https://github.com/YosysHQ/abc.git
Support computation experiments with different network data-structures.
This commit is contained in:
parent
4748f6988e
commit
9c409addca
|
|
@ -753,6 +753,29 @@ int Aig_SupportSize( Aig_Man_t * p, Aig_Obj_t * pObj )
|
||||||
return Counter;
|
return Counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Counts the support size of the node.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Aig_SupportSizeTest( Aig_Man_t * p )
|
||||||
|
{
|
||||||
|
Aig_Obj_t * pObj;
|
||||||
|
int i, Counter = 0, clk = clock();
|
||||||
|
Aig_ManForEachObj( p, pObj, i )
|
||||||
|
if ( Aig_ObjIsNode(pObj) )
|
||||||
|
Counter += (Aig_SupportSize(p, pObj) <= 16);
|
||||||
|
printf( "Nodes with small support %d (out of %d)\n", Counter, Aig_ManNodeNum(p) );
|
||||||
|
Abc_PrintTime( 1, "Time", clock() - clk );
|
||||||
|
return Counter;
|
||||||
|
}
|
||||||
|
|
||||||
/**Function*************************************************************
|
/**Function*************************************************************
|
||||||
|
|
||||||
Synopsis [Counts the support size of the node.]
|
Synopsis [Counts the support size of the node.]
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,46 @@ int Gia_ManSuppSize_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
|
||||||
Gia_ManSuppSize_rec( p, Gia_ObjFanin1(pObj) );
|
Gia_ManSuppSize_rec( p, Gia_ObjFanin1(pObj) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Computes support size of the node.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Gia_ManSuppSizeOne( Gia_Man_t * p, Gia_Obj_t * pObj )
|
||||||
|
{
|
||||||
|
Gia_ManIncrementTravId( p );
|
||||||
|
return Gia_ManSuppSize_rec( p, pObj );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Computes support size of the node.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Gia_ManSuppSizeTest( Gia_Man_t * p )
|
||||||
|
{
|
||||||
|
Gia_Obj_t * pObj;
|
||||||
|
int i, Counter = 0, clk = clock();
|
||||||
|
Gia_ManForEachObj( p, pObj, i )
|
||||||
|
if ( Gia_ObjIsAnd(pObj) )
|
||||||
|
Counter += (Gia_ManSuppSizeOne(p, pObj) <= 16);
|
||||||
|
printf( "Nodes with small support %d (out of %d)\n", Counter, Gia_ManAndNum(p) );
|
||||||
|
Abc_PrintTime( 1, "Time", clock() - clk );
|
||||||
|
return Counter;
|
||||||
|
}
|
||||||
|
|
||||||
/**Function*************************************************************
|
/**Function*************************************************************
|
||||||
|
|
||||||
Synopsis [Collects support nodes.]
|
Synopsis [Collects support nodes.]
|
||||||
|
|
|
||||||
|
|
@ -780,6 +780,70 @@ Vec_Ptr_t * Abc_NtkNodeSupport( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNod
|
||||||
return vNodes;
|
return vNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Computes support size of the node.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Abc_ObjSuppSize_rec( Abc_Obj_t * pObj )
|
||||||
|
{
|
||||||
|
Abc_Obj_t * pFanin;
|
||||||
|
int i, Counter = 0;
|
||||||
|
if ( Abc_NodeIsTravIdCurrent(pObj) )
|
||||||
|
return 0;
|
||||||
|
Abc_NodeSetTravIdCurrent(pObj);
|
||||||
|
if ( Abc_ObjIsPi(pObj) )
|
||||||
|
return 1;
|
||||||
|
assert( Abc_ObjIsNode(pObj) || Abc_ObjIsBox(pObj) );
|
||||||
|
Abc_ObjForEachFanin( pObj, pFanin, i )
|
||||||
|
Counter += Abc_ObjSuppSize_rec( pFanin );
|
||||||
|
return Counter;
|
||||||
|
}
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Computes support size of the node.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Abc_ObjSuppSize( Abc_Obj_t * pObj )
|
||||||
|
{
|
||||||
|
Abc_NtkIncrementTravId( Abc_ObjNtk(pObj) );
|
||||||
|
return Abc_ObjSuppSize_rec( pObj );
|
||||||
|
}
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Computes support size of the node.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Abc_NtkSuppSizeTest( Abc_Ntk_t * p )
|
||||||
|
{
|
||||||
|
Abc_Obj_t * pObj;
|
||||||
|
int i, Counter = 0, clk = clock();
|
||||||
|
Abc_NtkForEachObj( p, pObj, i )
|
||||||
|
if ( Abc_ObjIsNode(pObj) )
|
||||||
|
Counter += (Abc_ObjSuppSize(pObj) <= 16);
|
||||||
|
printf( "Nodes with small support %d (out of %d)\n", Counter, Abc_NtkNodeNum(p) );
|
||||||
|
Abc_PrintTime( 1, "Time", clock() - clk );
|
||||||
|
return Counter;
|
||||||
|
}
|
||||||
|
|
||||||
/**Function*************************************************************
|
/**Function*************************************************************
|
||||||
|
|
||||||
Synopsis [Computes the sum total of supports of all outputs.]
|
Synopsis [Computes the sum total of supports of all outputs.]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue