summaryrefslogtreecommitdiffstats
path: root/src/sat/fraig/fraigTable.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-28 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-28 08:01:00 -0700
commit3c25decf65704916943b0569e6d0608072550a89 (patch)
treec4b532e8edd1e2226bc84268e4e2368db8ee295d /src/sat/fraig/fraigTable.c
parent28db025b8393e307328d51ff6901c4ebab669e95 (diff)
downloadabc-3c25decf65704916943b0569e6d0608072550a89.tar.gz
abc-3c25decf65704916943b0569e6d0608072550a89.tar.bz2
abc-3c25decf65704916943b0569e6d0608072550a89.zip
Version abc50828
Diffstat (limited to 'src/sat/fraig/fraigTable.c')
-rw-r--r--src/sat/fraig/fraigTable.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/sat/fraig/fraigTable.c b/src/sat/fraig/fraigTable.c
index 5318c41e..4dc6afdc 100644
--- a/src/sat/fraig/fraigTable.c
+++ b/src/sat/fraig/fraigTable.c
@@ -373,6 +373,43 @@ int Fraig_CompareSimInfo( Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int iWor
/**Function*************************************************************
+ Synopsis [Find the number of the different pattern.]
+
+ Description [Returns -1 if there is no such pattern]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Fraig_FindFirstDiff( Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int iWordLast, int fUseRand )
+{
+ int i, v;
+ assert( !Fraig_IsComplement(pNode1) );
+ assert( !Fraig_IsComplement(pNode2) );
+ if ( fUseRand )
+ {
+ // check the simulation info
+ for ( i = 0; i < iWordLast; i++ )
+ if ( pNode1->puSimR[i] != pNode2->puSimR[i] )
+ for ( v = 0; v < 32; v++ )
+ if ( (pNode1->puSimR[i] ^ pNode2->puSimR[i]) & (1 << v) )
+ return i * 32 + v;
+ }
+ else
+ {
+ // check the simulation info
+ for ( i = 0; i < iWordLast; i++ )
+ if ( pNode1->puSimD[i] != pNode2->puSimD[i] )
+ for ( v = 0; v < 32; v++ )
+ if ( (pNode1->puSimD[i] ^ pNode2->puSimD[i]) & (1 << v) )
+ return i * 32 + v;
+ }
+ return -1;
+}
+
+/**Function*************************************************************
+
Synopsis [Compares two pieces of simulation info.]
Description [Returns 1 if they are equal.]