summaryrefslogtreecommitdiffstats
path: root/src/aig
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-10-26 21:03:30 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-10-26 21:03:30 -0700
commit736c2245ea4ce5e630d1d5db66f0f985a6440202 (patch)
tree2329f1e0d196cb73e3df9383884041c9d3cdb1b3 /src/aig
parent836723cf73a721e47faa22cf59a00352cdefeb99 (diff)
downloadabc-736c2245ea4ce5e630d1d5db66f0f985a6440202.tar.gz
abc-736c2245ea4ce5e630d1d5db66f0f985a6440202.tar.bz2
abc-736c2245ea4ce5e630d1d5db66f0f985a6440202.zip
Adding MAJ gate to GIA package.
Diffstat (limited to 'src/aig')
-rw-r--r--src/aig/gia/gia.h1
-rw-r--r--src/aig/gia/giaHash.c19
2 files changed, 20 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index f503b740..dba5c9db 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -1174,6 +1174,7 @@ extern int Gia_ManHashAnd( Gia_Man_t * p, int iLit0, int iLit1 )
extern int Gia_ManHashOr( Gia_Man_t * p, int iLit0, int iLit1 );
extern int Gia_ManHashXor( Gia_Man_t * p, int iLit0, int iLit1 );
extern int Gia_ManHashMux( Gia_Man_t * p, int iCtrl, int iData1, int iData0 );
+extern int Gia_ManHashMaj( Gia_Man_t * p, int iData0, int iData1, int iData2 );
extern int Gia_ManHashAndTry( Gia_Man_t * p, int iLit0, int iLit1 );
extern Gia_Man_t * Gia_ManRehash( Gia_Man_t * p, int fAddStrash );
extern void Gia_ManHashProfile( Gia_Man_t * p );
diff --git a/src/aig/gia/giaHash.c b/src/aig/gia/giaHash.c
index f7253c51..10e1866e 100644
--- a/src/aig/gia/giaHash.c
+++ b/src/aig/gia/giaHash.c
@@ -688,6 +688,25 @@ int Gia_ManHashMux( Gia_Man_t * p, int iCtrl, int iData1, int iData0 )
/**Function*************************************************************
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Gia_ManHashMaj( Gia_Man_t * p, int iData0, int iData1, int iData2 )
+{
+ int iTemp0 = Gia_ManHashOr( p, iData1, iData2 );
+ int iTemp1 = Gia_ManHashAnd( p, iData0, iTemp0 );
+ int iTemp2 = Gia_ManHashAnd( p, iData1, iData2 );
+ return Gia_ManHashOr( p, iTemp1, iTemp2 );
+}
+
+/**Function*************************************************************
+
Synopsis [Rehashes AIG.]
Description []