From 320c429bc46728c1faddfc561c166810aa134a04 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 1 Mar 2008 08:01:00 -0800 Subject: Version abc80301 --- src/map/if/if.h | 11 +++++++---- src/map/if/ifCore.c | 1 + src/map/if/ifUtil.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) (limited to 'src/map/if') 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 /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3