summaryrefslogtreecommitdiffstats
path: root/src/map/if
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
commit320c429bc46728c1faddfc561c166810aa134a04 (patch)
treec773cc96431cd38ae35484dae7d7d17a79671ac2 /src/map/if
parentf65983c2c0810cfb933f696952325a81d2378987 (diff)
downloadabc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz
abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2
abc-320c429bc46728c1faddfc561c166810aa134a04.zip
Version abc80301
Diffstat (limited to 'src/map/if')
-rw-r--r--src/map/if/if.h11
-rw-r--r--src/map/if/ifCore.c1
-rw-r--r--src/map/if/ifUtil.c32
3 files changed, 40 insertions, 4 deletions
diff --git a/src/map/if/if.h b/src/map/if/if.h
index 19222f3b..acda5d51 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -221,10 +221,10 @@ struct If_Obj_t_
If_Cut_t CutBest; // the best cut selected
};
-static inline If_Obj_t * If_Regular( If_Obj_t * p ) { return (If_Obj_t *)((unsigned long)(p) & ~01); }
-static inline If_Obj_t * If_Not( If_Obj_t * p ) { return (If_Obj_t *)((unsigned long)(p) ^ 01); }
-static inline If_Obj_t * If_NotCond( If_Obj_t * p, int c ) { return (If_Obj_t *)((unsigned long)(p) ^ (c)); }
-static inline int If_IsComplement( If_Obj_t * p ) { return (int )(((unsigned long)p) & 01); }
+static inline If_Obj_t * If_Regular( If_Obj_t * p ) { return (If_Obj_t *)((PORT_PTRUINT_T)(p) & ~01); }
+static inline If_Obj_t * If_Not( If_Obj_t * p ) { return (If_Obj_t *)((PORT_PTRUINT_T)(p) ^ 01); }
+static inline If_Obj_t * If_NotCond( If_Obj_t * p, int c ) { return (If_Obj_t *)((PORT_PTRUINT_T)(p) ^ (c)); }
+static inline int If_IsComplement( If_Obj_t * p ) { return (int )(((PORT_PTRUINT_T)p) & 01); }
static inline int If_ManCiNum( If_Man_t * p ) { return p->nObjs[IF_CI]; }
static inline int If_ManCoNum( If_Man_t * p ) { return p->nObjs[IF_CO]; }
@@ -399,6 +399,9 @@ extern Vec_Ptr_t * If_ManReverseOrder( If_Man_t * p );
extern void If_ManMarkMapping( If_Man_t * p );
extern Vec_Ptr_t * If_ManCollectMappingDirect( If_Man_t * p );
+extern int If_ManCountSpecialPos( If_Man_t * p );
+
+
#ifdef __cplusplus
}
diff --git a/src/map/if/ifCore.c b/src/map/if/ifCore.c
index f7124703..16a14153 100644
--- a/src/map/if/ifCore.c
+++ b/src/map/if/ifCore.c
@@ -138,6 +138,7 @@ int If_ManPerformMappingComb( If_Man_t * p )
}
// printf( "Cross cut memory = %d.\n", Mem_FixedReadMaxEntriesUsed(p->pMemSet) );
s_MappingTime = clock() - clkTotal;
+// printf( "Special POs = %d.\n", If_ManCountSpecialPos(p) );
return 1;
}
diff --git a/src/map/if/ifUtil.c b/src/map/if/ifUtil.c
index 2624efd0..c114236d 100644
--- a/src/map/if/ifUtil.c
+++ b/src/map/if/ifUtil.c
@@ -651,6 +651,38 @@ Vec_Ptr_t * If_ManCollectMappingDirect( If_Man_t * p )
return vOrder;
}
+/**Function*************************************************************
+
+ Synopsis [Returns the number of POs pointing to the same internal nodes.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int If_ManCountSpecialPos( If_Man_t * p )
+{
+ If_Obj_t * pObj;
+ int i, Counter = 0;
+ // clean all marks
+ If_ManForEachPo( p, pObj, i )
+ If_ObjFanin0(pObj)->fMark = 0;
+ // label nodes
+ If_ManForEachPo( p, pObj, i )
+ if ( !If_ObjFaninC0(pObj) )
+ If_ObjFanin0(pObj)->fMark = 1;
+ // label nodes
+ If_ManForEachPo( p, pObj, i )
+ if ( If_ObjFaninC0(pObj) )
+ Counter += If_ObjFanin0(pObj)->fMark;
+ // clean all marks
+ If_ManForEachPo( p, pObj, i )
+ If_ObjFanin0(pObj)->fMark = 0;
+ return Counter;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////