diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-01 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-01 08:01:00 -0800 |
commit | 320c429bc46728c1faddfc561c166810aa134a04 (patch) | |
tree | c773cc96431cd38ae35484dae7d7d17a79671ac2 /src/map | |
parent | f65983c2c0810cfb933f696952325a81d2378987 (diff) | |
download | abc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2 abc-320c429bc46728c1faddfc561c166810aa134a04.zip |
Version abc80301
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/fpga/fpga.h | 8 | ||||
-rw-r--r-- | src/map/fpga/fpgaInt.h | 3 | ||||
-rw-r--r-- | src/map/if/if.h | 11 | ||||
-rw-r--r-- | src/map/if/ifCore.c | 1 | ||||
-rw-r--r-- | src/map/if/ifUtil.c | 32 | ||||
-rw-r--r-- | src/map/mapper/mapper.h | 8 | ||||
-rw-r--r-- | src/map/mapper/mapperInt.h | 8 | ||||
-rw-r--r-- | src/map/super/superAnd.c | 8 |
8 files changed, 56 insertions, 23 deletions
diff --git a/src/map/fpga/fpga.h b/src/map/fpga/fpga.h index 708cf385..b2ca4882 100644 --- a/src/map/fpga/fpga.h +++ b/src/map/fpga/fpga.h @@ -52,10 +52,10 @@ typedef struct Fpga_LutLibStruct_t_ Fpga_LutLib_t; /// MACRO DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -#define Fpga_IsComplement(p) (((int)((unsigned long) (p) & 01))) -#define Fpga_Regular(p) ((Fpga_Node_t *)((unsigned long)(p) & ~01)) -#define Fpga_Not(p) ((Fpga_Node_t *)((unsigned long)(p) ^ 01)) -#define Fpga_NotCond(p,c) ((Fpga_Node_t *)((unsigned long)(p) ^ (c))) +#define Fpga_IsComplement(p) (((int)((PORT_PTRUINT_T) (p) & 01))) +#define Fpga_Regular(p) ((Fpga_Node_t *)((PORT_PTRUINT_T)(p) & ~01)) +#define Fpga_Not(p) ((Fpga_Node_t *)((PORT_PTRUINT_T)(p) ^ 01)) +#define Fpga_NotCond(p,c) ((Fpga_Node_t *)((PORT_PTRUINT_T)(p) ^ (c))) #define Fpga_Ref(p) #define Fpga_Deref(p) diff --git a/src/map/fpga/fpgaInt.h b/src/map/fpga/fpgaInt.h index c01d1e3d..be790a55 100644 --- a/src/map/fpga/fpgaInt.h +++ b/src/map/fpga/fpgaInt.h @@ -88,9 +88,6 @@ // generating random unsigned (#define RAND_MAX 0x7fff) #define FPGA_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) -// outputs the runtime in seconds -#define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC)) - //////////////////////////////////////////////////////////////////////// /// STRUCTURE DEFINITIONS /// //////////////////////////////////////////////////////////////////////// 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 /// //////////////////////////////////////////////////////////////////////// diff --git a/src/map/mapper/mapper.h b/src/map/mapper/mapper.h index 8eade761..673f7538 100644 --- a/src/map/mapper/mapper.h +++ b/src/map/mapper/mapper.h @@ -63,10 +63,10 @@ struct Map_TimeStruct_t_ /// MACRO DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -#define Map_IsComplement(p) (((int)((unsigned long) (p) & 01))) -#define Map_Regular(p) ((Map_Node_t *)((unsigned long)(p) & ~01)) -#define Map_Not(p) ((Map_Node_t *)((unsigned long)(p) ^ 01)) -#define Map_NotCond(p,c) ((Map_Node_t *)((unsigned long)(p) ^ (c))) +#define Map_IsComplement(p) (((int)((PORT_PTRUINT_T) (p) & 01))) +#define Map_Regular(p) ((Map_Node_t *)((PORT_PTRUINT_T)(p) & ~01)) +#define Map_Not(p) ((Map_Node_t *)((PORT_PTRUINT_T)(p) ^ 01)) +#define Map_NotCond(p,c) ((Map_Node_t *)((PORT_PTRUINT_T)(p) ^ (c))) //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// diff --git a/src/map/mapper/mapperInt.h b/src/map/mapper/mapperInt.h index 37cca3d3..541077d5 100644 --- a/src/map/mapper/mapperInt.h +++ b/src/map/mapper/mapperInt.h @@ -61,10 +61,10 @@ #define MAP_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) // internal macros to work with cuts -#define Map_CutIsComplement(p) (((int)((unsigned long) (p) & 01))) -#define Map_CutRegular(p) ((Map_Cut_t *)((unsigned long)(p) & ~01)) -#define Map_CutNot(p) ((Map_Cut_t *)((unsigned long)(p) ^ 01)) -#define Map_CutNotCond(p,c) ((Map_Cut_t *)((unsigned long)(p) ^ (c))) +#define Map_CutIsComplement(p) (((int)((PORT_PTRUINT_T) (p) & 01))) +#define Map_CutRegular(p) ((Map_Cut_t *)((PORT_PTRUINT_T)(p) & ~01)) +#define Map_CutNot(p) ((Map_Cut_t *)((PORT_PTRUINT_T)(p) ^ 01)) +#define Map_CutNotCond(p,c) ((Map_Cut_t *)((PORT_PTRUINT_T)(p) ^ (c))) // internal macros for referencing of nodes #define Map_NodeReadRef(p) ((Map_Regular(p))->nRefs) diff --git a/src/map/super/superAnd.c b/src/map/super/superAnd.c index 52473fba..26235a0e 100644 --- a/src/map/super/superAnd.c +++ b/src/map/super/superAnd.c @@ -61,10 +61,10 @@ struct Super2_GateStruct_t_ // manipulation of complemented attributes -#define Super2_IsComplement(p) (((int)((unsigned long) (p) & 01))) -#define Super2_Regular(p) ((Super2_Gate_t *)((unsigned long)(p) & ~01)) -#define Super2_Not(p) ((Super2_Gate_t *)((unsigned long)(p) ^ 01)) -#define Super2_NotCond(p,c) ((Super2_Gate_t *)((unsigned long)(p) ^ (c))) +#define Super2_IsComplement(p) (((int)((PORT_PTRUINT_T) (p) & 01))) +#define Super2_Regular(p) ((Super2_Gate_t *)((PORT_PTRUINT_T)(p) & ~01)) +#define Super2_Not(p) ((Super2_Gate_t *)((PORT_PTRUINT_T)(p) ^ 01)) +#define Super2_NotCond(p,c) ((Super2_Gate_t *)((PORT_PTRUINT_T)(p) ^ (c))) // iterating through the gates in the library #define Super2_LibForEachGate( Lib, Gate ) \ |