19 #ifndef ABC__map__mapper__mapperInt_h
20 #define ABC__map__mapper__mapperInt_h
51 #define MAP_MASK(n) ((~((unsigned)0)) >> (32-(n)))
52 #define MAP_FULL (~((unsigned)0))
53 #define MAP_NO_VAR (-9999.0)
56 #define MAP_MIN(a,b) (((a) < (b))? (a) : (b))
57 #define MAP_MAX(a,b) (((a) > (b))? (a) : (b))
60 #define MAP_FLOAT_LARGE ((float)(FLT_MAX/10))
61 #define MAP_FLOAT_SMALL ((float)1.0e-03)
64 #define MAP_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
67 #define Map_CutIsComplement(p) (((int)((ABC_PTRUINT_T) (p) & 01)))
68 #define Map_CutRegular(p) ((Map_Cut_t *)((ABC_PTRUINT_T)(p) & ~01))
69 #define Map_CutNot(p) ((Map_Cut_t *)((ABC_PTRUINT_T)(p) ^ 01))
70 #define Map_CutNotCond(p,c) ((Map_Cut_t *)((ABC_PTRUINT_T)(p) ^ (c)))
73 #define Map_NodeReadRef(p) ((Map_Regular(p))->nRefs)
74 #define Map_NodeRef(p) ((Map_Regular(p))->nRefs++)
77 #define Map_InfoSetVar(p,i) (p[(i)>>5] |= (1<<((i) & 31)))
78 #define Map_InfoRemVar(p,i) (p[(i)>>5] &= ~(1<<((i) & 31)))
79 #define Map_InfoFlipVar(p,i) (p[(i)>>5] ^= (1<<((i) & 31)))
80 #define Map_InfoReadVar(p,i) ((p[(i)>>5] & (1<<((i) & 31))) > 0)
83 #define Map_NodeIsSimComplement(p) (Map_IsComplement(p)? !(Map_Regular(p)->fInv) : (p)->fInv)
226 #ifdef MAP_ALLOCATE_FANOUT
325 #define Map_NodeReadNextFanout( pNode, pFanout ) \
326 ( ( pFanout == NULL )? NULL : \
327 ((Map_Regular((pFanout)->p1) == (pNode))? \
328 (pFanout)->pFanFanin1 : (pFanout)->pFanFanin2) )
331 #define Map_NodeReadNextFanoutPlace( pNode, pFanout ) \
332 ( (Map_Regular((pFanout)->p1) == (pNode))? \
333 &(pFanout)->pFanFanin1 : &(pFanout)->pFanFanin2 )
336 #define Map_NodeForEachFanout( pNode, pFanout ) \
337 for ( pFanout = (pNode)->pFanPivot; pFanout; \
338 pFanout = Map_NodeReadNextFanout(pNode, pFanout) )
341 #define Map_NodeForEachFanoutSafe( pNode, pFanout, pFanout2 ) \
342 for ( pFanout = (pNode)->pFanPivot, \
343 pFanout2 = Map_NodeReadNextFanout(pNode, pFanout); \
345 pFanout = pFanout2, \
346 pFanout2 = Map_NodeReadNextFanout(pNode, pFanout) )
void Map_LibraryPrintTree(Map_SuperLib_t *pLib)
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
void Map_SuperTableSortSupergatesByDelay(Map_HashTable_t *p, int nSupersMax)
int Map_NodeVecReadSize(Map_NodeVec_t *p)
float Map_CutDeref(Map_Cut_t *pCut, int fPhase)
int Map_LibraryDeriveGateInfo(Map_SuperLib_t *pLib, st__table *tExcludeGate)
void Map_NodeVecWriteEntry(Map_NodeVec_t *p, int i, Map_Node_t *Entry)
void Map_NodeVecSortByLevel(Map_NodeVec_t *p)
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
float Map_MappingGetSwitching(Map_Man_t *pMan)
float Map_CutGetAreaRefed(Map_Cut_t *pCut, int fPhase)
void Map_MappingMark_rec(Map_Node_t *pNode)
float Map_SwitchCutRef(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
void Map_SuperTableSortSupergates(Map_HashTable_t *p, int nSupersMax)
void Map_MappingSetRefs(Map_Man_t *pMan)
void Map_CutInsertFanouts(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
void Map_CutPrint(Map_Man_t *p, Map_Node_t *pRoot, Map_Cut_t *pCut, int fPhase)
void Map_MappingExpandTruth(unsigned uTruth[2], int nVars)
int Map_MappingMatches(Map_Man_t *p)
void Map_CutRemoveFanouts(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
int Map_TruthCountOnes(unsigned *uTruth, int nLeaves)
void Map_CutFree(Map_Man_t *p, Map_Cut_t *pCut)
int Map_NodeGetFanoutNum(Map_Node_t *pNode)
float Map_CutGetRootArea(Map_Cut_t *pCut, int fPhase)
void Map_MappingUnmark(Map_Man_t *pMan)
void Map_MappingWireReport(Map_Man_t *p)
float Map_CutGetAreaDerefed(Map_Cut_t *pCut, int fPhase)
unsigned uTruthsLarge[10][32]
void Map_MappingTruths(Map_Man_t *pMan)
FUNCTION DEFINITIONS ///.
void Map_MappingSetChoiceLevels(Map_Man_t *pMan)
void Map_SuperLibFree(Map_SuperLib_t *p)
float Map_CutRef(Map_Cut_t *pCut, int fPhase)
int Map_LibraryReadTree(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, char *pFileName, char *pExcludeFile)
int Map_MappingGetMaxLevel(Map_Man_t *pMan)
Map_SuperLib_t * pSuperLib
void Map_NodeVecShrink(Map_NodeVec_t *p, int nSizeNew)
void Map_MappingEstimateRefs(Map_Man_t *p)
int Map_NodeVecPushUnique(Map_NodeVec_t *p, Map_Node_t *Entry)
float Map_TimeComputeArrivalMax(Map_Man_t *p)
DECLARATIONS ///.
void Map_MappingCuts(Map_Man_t *p)
GLOBAL VARIABLES ///.
Map_Cut_t * Map_CutListAppend(Map_Cut_t *pSetAll, Map_Cut_t *pSets)
Map_HashTable_t * Map_SuperTableCreate(Map_SuperLib_t *pLib)
FUNCTION DEFINITIONS ///.
Map_Time_t * pInputArrivals
void Map_NodeVecGrow(Map_NodeVec_t *p, int nCapMin)
Extra_MmFixed_t * mmNodes
int Map_LibraryRead(Map_SuperLib_t *p, char *pFileName)
FUNCTION DEFINITIONS ///.
void Map_MappingEstimateRefsInit(Map_Man_t *p)
int Map_CutGetLeafPhase(Map_Cut_t *pCut, int fPhase, int iLeaf)
Extra_MmFixed_t * mmSupers
float Map_MappingComputeDelayWithFanouts(Map_Man_t *p)
int Map_MappingNodeIsViolator(Map_Node_t *pNode, Map_Cut_t *pCut, int fPosPol)
Map_Time_t * pOutputRequireds
STRUCTURE DEFINITIONS ///.
float Map_TimeCutComputeArrival(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float tWorstCaseLimit)
int Map_MappingCountDoubles(Map_Man_t *pMan, Map_NodeVec_t *vNodes)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Map_Super_t * Map_SuperTableLookup(Map_HashTable_t *p, unsigned uTruth[], unsigned *puPhase)
Map_Cut_t * Map_CutAlloc(Map_Man_t *p)
DECLARATIONS ///.
#define ABC_NAMESPACE_HEADER_END
Extra_MmFixed_t * mmEntries
int Map_CutListCount(Map_Cut_t *pSets)
Map_Node_t * Map_NodeVecReadEntry(Map_NodeVec_t *p, int i)
float Map_SwitchCutDeref(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
float Map_MappingGetAreaFlow(Map_Man_t *p)
void Map_MappingUnmark_rec(Map_Node_t *pNode)
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
void Map_NodeVecClear(Map_NodeVec_t *p)
void Map_TimeComputeRequiredGlobal(Map_Man_t *p)
void Map_NodeVecFree(Map_NodeVec_t *p)
Map_NodeVec_t * Map_MappingDfs(Map_Man_t *pMan, int fCollectEquiv)
void Map_MappingSortByLevel(Map_Man_t *pMan, Map_NodeVec_t *vNodes)
int Map_TruthsCutDontCare(Map_Man_t *pMan, Map_Cut_t *pCut, unsigned *uTruthDc)
int Map_TruthDetectTwoFirst(unsigned *uTruth, int nLeaves)
float Map_CutGetAreaFlow(Map_Cut_t *pCut, int fPhase)
Map_NodeVec_t * Map_NodeVecDup(Map_NodeVec_t *p)
int Map_MappingCountLevels(Map_Man_t *pMan)
void Map_MappingReportChoices(Map_Man_t *pMan)
float Map_MappingGetArea(Map_Man_t *pMan)
void Map_LibraryPrintSupergate(Map_Super_t *pGate)
void Map_NodeVecRemove(Map_NodeVec_t *p, Map_Node_t *Entry)
float Map_MappingPrintWirelength(Map_Man_t *p)
void Map_MappingSetupMask(unsigned uMask[], int nVarsMax)
void Map_SuperTableFree(Map_HashTable_t *p)
float Map_SwitchCutGetDerefed(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
FUNCTION DEFINITIONS ///.
int Map_NodeGetLeafPhase(Map_Node_t *pNode, int fPhase, int iLeaf)
void Map_MappingSetPlacementInfo(Map_Man_t *p)
void Map_CutListRecycle(Map_Man_t *p, Map_Cut_t *pSetList, Map_Cut_t *pSave)
STRUCTURE DEFINITIONS ///.
int Map_SuperTableInsertC(Map_HashTable_t *pLib, unsigned uTruthC[], Map_Super_t *pGate)
int Map_LibraryReadFileTreeStr(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName)
Map_HashTable_t * tTableC
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
void Map_MappingPrintOutputArrivals(Map_Man_t *p)
void Map_NodeRemoveFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanoutToRemove)
Map_Node_t * Map_NodeVecPop(Map_NodeVec_t *p)
Map_SuperLib_t * Map_SuperLibCreate(Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName, char *pExcludeFile, int fAlgorithm, int fVerbose)
DECLARATIONS ///.
float Map_MappingPrintSwitching(Map_Man_t *pMan)
int Map_SuperTableInsert(Map_HashTable_t *pLib, unsigned uTruth[], Map_Super_t *pGate, unsigned uPhase)