summaryrefslogtreecommitdiffstats
path: root/src/aig/kit
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-04-29 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2008-04-29 08:01:00 -0700
commit2b98b81837011f26d130ad0f44d4bc7b298f9cd7 (patch)
tree3f3eb36585157596614b1f0bf8b34ee5d1b533b2 /src/aig/kit
parente2e9aed11dd841801dae3cdf47db06946e7ffb28 (diff)
downloadabc-2b98b81837011f26d130ad0f44d4bc7b298f9cd7.tar.gz
abc-2b98b81837011f26d130ad0f44d4bc7b298f9cd7.tar.bz2
abc-2b98b81837011f26d130ad0f44d4bc7b298f9cd7.zip
Version abc80429
Diffstat (limited to 'src/aig/kit')
-rw-r--r--src/aig/kit/kit.h3
-rw-r--r--src/aig/kit/kitHop.c1
-rw-r--r--src/aig/kit/kitPla.c56
3 files changed, 60 insertions, 0 deletions
diff --git a/src/aig/kit/kit.h b/src/aig/kit/kit.h
index 7607d17c..a0fca09d 100644
--- a/src/aig/kit/kit.h
+++ b/src/aig/kit/kit.h
@@ -547,6 +547,9 @@ extern int Kit_GraphLeafDepth_rec( Kit_Graph_t * pGraph, Kit_Node_t
extern int Kit_TruthIsop( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
/*=== kitPla.c ==========================================================*/
extern int Kit_PlaIsConst0( char * pSop );
+extern int Kit_PlaIsConst1( char * pSop );
+extern int Kit_PlaIsBuf( char * pSop );
+extern int Kit_PlaIsInv( char * pSop );
extern int Kit_PlaGetVarNum( char * pSop );
extern int Kit_PlaGetCubeNum( char * pSop );
extern int Kit_PlaIsComplement( char * pSop );
diff --git a/src/aig/kit/kitHop.c b/src/aig/kit/kitHop.c
index 86ec5a88..044633bc 100644
--- a/src/aig/kit/kitHop.c
+++ b/src/aig/kit/kitHop.c
@@ -130,6 +130,7 @@ Hop_Obj_t * Kit_CoverToHop( Hop_Man_t * pMan, Vec_Int_t * vCover, int nVars, Vec
Kit_Graph_t * pGraph;
Hop_Obj_t * pFunc;
// perform factoring
+ Vec_IntClear( vMemory );
pGraph = Kit_SopFactor( vCover, 0, nVars, vMemory );
// convert graph to the AIG
pFunc = Kit_GraphToHop( pMan, pGraph );
diff --git a/src/aig/kit/kitPla.c b/src/aig/kit/kitPla.c
index be8f594a..776762c2 100644
--- a/src/aig/kit/kitPla.c
+++ b/src/aig/kit/kitPla.c
@@ -47,6 +47,62 @@ int Kit_PlaIsConst0( char * pSop )
/**Function*************************************************************
+ Synopsis [Checks if the cover is constant 1.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Kit_PlaIsConst1( char * pSop )
+{
+ return pSop[0] == ' ' && pSop[1] == '1';
+}
+
+/**Function*************************************************************
+
+ Synopsis [Checks if the cover is a buffer.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Kit_PlaIsBuf( char * pSop )
+{
+ if ( pSop[4] != 0 )
+ return 0;
+ if ( (pSop[0] == '1' && pSop[2] == '1') || (pSop[0] == '0' && pSop[2] == '0') )
+ return 1;
+ return 0;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Checks if the cover is an inverter.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Kit_PlaIsInv( char * pSop )
+{
+ if ( pSop[4] != 0 )
+ return 0;
+ if ( (pSop[0] == '0' && pSop[2] == '1') || (pSop[0] == '1' && pSop[2] == '0') )
+ return 1;
+ return 0;
+}
+
+/**Function*************************************************************
+
Synopsis [Reads the number of variables in the cover.]
Description []