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