summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-01-14 18:04:47 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-01-14 18:04:47 -0800
commit9c409addca12e478cff38cb60a37a7ce03b34e61 (patch)
tree5d48b77116324484dba73af7f3737d009fd1bc1d /src
parent4748f6988eeab8c20c7f603495d36e97d0f1ffab (diff)
downloadabc-9c409addca12e478cff38cb60a37a7ce03b34e61.tar.gz
abc-9c409addca12e478cff38cb60a37a7ce03b34e61.tar.bz2
abc-9c409addca12e478cff38cb60a37a7ce03b34e61.zip
Support computation experiments with different network data-structures.
Diffstat (limited to 'src')
-rw-r--r--src/aig/aig/aigDfs.c23
-rw-r--r--src/aig/gia/giaDfs.c40
-rw-r--r--src/base/abc/abcDfs.c64
3 files changed, 127 insertions, 0 deletions
diff --git a/src/aig/aig/aigDfs.c b/src/aig/aig/aigDfs.c
index 5a11c9a5..0c2989d8 100644
--- a/src/aig/aig/aigDfs.c
+++ b/src/aig/aig/aigDfs.c
@@ -764,6 +764,29 @@ int Aig_SupportSize( Aig_Man_t * p, Aig_Obj_t * pObj )
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*************************************************************
+
+ Synopsis [Counts the support size of the node.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
void Aig_Support_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vSupp )
{
if ( Aig_ObjIsTravIdCurrent(p, pObj) )
diff --git a/src/aig/gia/giaDfs.c b/src/aig/gia/giaDfs.c
index 3b591aee..1ec18767 100644
--- a/src/aig/gia/giaDfs.c
+++ b/src/aig/gia/giaDfs.c
@@ -246,6 +246,46 @@ int Gia_ManSuppSize_rec( Gia_Man_t * p, Gia_Obj_t * 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*************************************************************
+
Synopsis [Collects support nodes.]
Description []
diff --git a/src/base/abc/abcDfs.c b/src/base/abc/abcDfs.c
index 20b361fb..cc001ab6 100644
--- a/src/base/abc/abcDfs.c
+++ b/src/base/abc/abcDfs.c
@@ -782,6 +782,70 @@ Vec_Ptr_t * Abc_NtkNodeSupport( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNod
/**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*************************************************************
+
Synopsis [Computes the sum total of supports of all outputs.]
Description []