summaryrefslogtreecommitdiffstats
path: root/src/aig/hop
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-01-21 04:30:10 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-01-21 04:30:10 -0800
commit8014f25f6db719fa62336f997963532a14c568f6 (patch)
treec691ee91a3a2d452a2bd24ac89a8c717beaa7af7 /src/aig/hop
parentc44cc5de9429e6b4f1c05045fcf43c9cb96437b5 (diff)
downloadabc-8014f25f6db719fa62336f997963532a14c568f6.tar.gz
abc-8014f25f6db719fa62336f997963532a14c568f6.tar.bz2
abc-8014f25f6db719fa62336f997963532a14c568f6.zip
Major restructuring of the code.
Diffstat (limited to 'src/aig/hop')
-rw-r--r--src/aig/hop/cudd2.c2
-rw-r--r--src/aig/hop/cudd2.h4
-rw-r--r--src/aig/hop/hop.h8
-rw-r--r--src/aig/hop/hopDfs.c4
-rw-r--r--src/aig/hop/hopTable.c38
5 files changed, 10 insertions, 46 deletions
diff --git a/src/aig/hop/cudd2.c b/src/aig/hop/cudd2.c
index 3ad44e4c..57a85dc8 100644
--- a/src/aig/hop/cudd2.c
+++ b/src/aig/hop/cudd2.c
@@ -19,7 +19,7 @@
***********************************************************************/
#include "hop.h"
-#include "st.h"
+#include "misc/st/st.h"
ABC_NAMESPACE_IMPL_START
diff --git a/src/aig/hop/cudd2.h b/src/aig/hop/cudd2.h
index 2382b22f..e38118f4 100644
--- a/src/aig/hop/cudd2.h
+++ b/src/aig/hop/cudd2.h
@@ -18,8 +18,8 @@
***********************************************************************/
-#ifndef __CUDD2_H__
-#define __CUDD2_H__
+#ifndef ABC__aig__hop__cudd2_h
+#define ABC__aig__hop__cudd2_h
// HA: Added for printing messages
diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h
index a634f136..eff904fd 100644
--- a/src/aig/hop/hop.h
+++ b/src/aig/hop/hop.h
@@ -18,8 +18,8 @@
***********************************************************************/
-#ifndef __HOP_H__
-#define __HOP_H__
+#ifndef ABC__aig__hop__hop_h
+#define ABC__aig__hop__hop_h
////////////////////////////////////////////////////////////////////////
@@ -32,7 +32,7 @@
#include <assert.h>
#include <time.h>
-#include "vec.h"
+#include "src/misc/vec/vec.h"
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
@@ -186,7 +186,7 @@ static inline Hop_Obj_t * Hop_ObjChild1( Hop_Obj_t * pObj ) { return pObj-
static inline Hop_Obj_t * Hop_ObjChild0Copy( Hop_Obj_t * pObj ) { assert( !Hop_IsComplement(pObj) ); return Hop_ObjFanin0(pObj)? Hop_NotCond((Hop_Obj_t *)Hop_ObjFanin0(pObj)->pData, Hop_ObjFaninC0(pObj)) : NULL; }
static inline Hop_Obj_t * Hop_ObjChild1Copy( Hop_Obj_t * pObj ) { assert( !Hop_IsComplement(pObj) ); return Hop_ObjFanin1(pObj)? Hop_NotCond((Hop_Obj_t *)Hop_ObjFanin1(pObj)->pData, Hop_ObjFaninC1(pObj)) : NULL; }
static inline int Hop_ObjLevel( Hop_Obj_t * pObj ) { return pObj->nRefs; }
-static inline int Hop_ObjLevelNew( Hop_Obj_t * pObj ) { return 1 + Hop_ObjIsExor(pObj) + ABC_MAX(Hop_ObjFanin0(pObj)->nRefs, Hop_ObjFanin1(pObj)->nRefs); }
+static inline int Hop_ObjLevelNew( Hop_Obj_t * pObj ) { return 1 + Hop_ObjIsExor(pObj) + Abc_MaxInt(Hop_ObjFanin0(pObj)->nRefs, Hop_ObjFanin1(pObj)->nRefs); }
static inline int Hop_ObjPhaseCompl( Hop_Obj_t * pObj ) { return Hop_IsComplement(pObj)? !Hop_Regular(pObj)->fPhase : pObj->fPhase; }
static inline void Hop_ObjClean( Hop_Obj_t * pObj ) { memset( pObj, 0, sizeof(Hop_Obj_t) ); }
static inline int Hop_ObjWhatFanin( Hop_Obj_t * pObj, Hop_Obj_t * pFanin )
diff --git a/src/aig/hop/hopDfs.c b/src/aig/hop/hopDfs.c
index be1e6c0b..f6f8c507 100644
--- a/src/aig/hop/hopDfs.c
+++ b/src/aig/hop/hopDfs.c
@@ -128,13 +128,13 @@ int Hop_ManCountLevels( Hop_Man_t * p )
{
Level0 = (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData;
Level1 = (int)(ABC_PTRUINT_T)Hop_ObjFanin1(pObj)->pData;
- pObj->pData = (void *)(ABC_PTRUINT_T)(1 + Hop_ObjIsExor(pObj) + ABC_MAX(Level0, Level1));
+ pObj->pData = (void *)(ABC_PTRUINT_T)(1 + Hop_ObjIsExor(pObj) + Abc_MaxInt(Level0, Level1));
}
Vec_PtrFree( vNodes );
// get levels of the POs
LevelsMax = 0;
Hop_ManForEachPo( p, pObj, i )
- LevelsMax = ABC_MAX( LevelsMax, (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData );
+ LevelsMax = Abc_MaxInt( LevelsMax, (int)(ABC_PTRUINT_T)Hop_ObjFanin0(pObj)->pData );
return LevelsMax;
}
diff --git a/src/aig/hop/hopTable.c b/src/aig/hop/hopTable.c
index 8148a125..7db93f62 100644
--- a/src/aig/hop/hopTable.c
+++ b/src/aig/hop/hopTable.c
@@ -52,7 +52,6 @@ static Hop_Obj_t ** Hop_TableFind( Hop_Man_t * p, Hop_Obj_t * pObj )
}
static void Hop_TableResize( Hop_Man_t * p );
-static unsigned int Cudd_PrimeAig( unsigned int p );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -174,7 +173,7 @@ clk = clock();
pTableOld = p->pTable;
nTableSizeOld = p->nTableSize;
// get the new table
- p->nTableSize = Cudd_PrimeAig( 2 * Hop_ManNodeNum(p) );
+ p->nTableSize = Abc_PrimeCudd( 2 * Hop_ManNodeNum(p) );
p->pTable = ABC_ALLOC( Hop_Obj_t *, p->nTableSize );
memset( p->pTable, 0, sizeof(Hop_Obj_t *) * p->nTableSize );
// rehash the entries from the old table
@@ -223,41 +222,6 @@ void Hop_TableProfile( Hop_Man_t * p )
}
}
-/**Function********************************************************************
-
- Synopsis [Returns the next prime &gt;= p.]
-
- Description [Copied from CUDD, for stand-aloneness.]
-
- SideEffects [None]
-
- SeeAlso []
-
-******************************************************************************/
-unsigned int Cudd_PrimeAig( unsigned int p)
-{
- int i,pn;
- p--;
- do {
- p++;
- if (p&1) {
- pn = 1;
- i = 3;
- while ((unsigned) (i * i) <= p) {
- if (p % i == 0) {
- pn = 0;
- break;
- }
- i += 2;
- }
- } else {
- pn = 0;
- }
- } while (!pn);
- return(p);
-
-} /* end of Cudd_Prime */
-
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////