152 for ( pSuper = pMatch->
pSupers, Counter = 0; pSuper; pSuper = pSuper->
pNext, Counter++ )
163 for ( i = 0; i < (int)pSuper->
nPhases; i++ )
168 if ( p->fMappingMode == 0 )
173 if ( pMatch->
tArrive.
Worst > fWorstLimit + p->fEpsilon )
181 if ( p->fMappingMode == 2 || p->fMappingMode == 3 )
183 else if ( p->fMappingMode == 4 )
193 if ( pMatch->
tArrive.
Worst > fWorstLimit + p->fEpsilon )
202 if ( p->fMappingMode == 0 )
214 if ( p->fMappingMode == 2 || p->fMappingMode == 3 )
216 else if ( p->fMappingMode == 4 )
240 float Area2, fWorstLimit;
244 if ( p->fMappingMode != 0 && pCutBest == NULL )
250 if ( p->fMappingMode != 0 )
261 if ( p->fMappingMode == 2 || p->fMappingMode == 3 )
263 pMatch = pCutBest->
M + fPhase;
264 if ( pNode->
nRefAct[fPhase] > 0 ||
270 else if ( p->fMappingMode == 4 )
272 pMatch = pCutBest->
M + fPhase;
273 if ( pNode->
nRefAct[fPhase] > 0 ||
282 MatchBest = pCutBest->
M[fPhase];
293 pMatch = pCut->
M + fPhase;
308 if ( p->fMappingMode == 0 )
313 if ( pCutBest == NULL )
318 pCutBest->
M[fPhase] = MatchBest;
321 if ( p->fMappingMode >= 2 &&
325 if ( p->fMappingMode == 2 || p->fMappingMode == 3 )
327 else if ( p->fMappingMode == 4 )
355 for ( i = 0; i < p->nInputs; i++ )
357 pNode = p->pInputs[i];
359 pNode->
tArrival[1] = p->pInputArrivals[i];
360 pNode->
tArrival[1].
Rise += p->pNodeDelays ? p->pNodeDelays[pNode->
Num] : 0;
361 pNode->
tArrival[1].
Fall += p->pNodeDelays ? p->pNodeDelays[pNode->
Num] : 0;
362 pNode->
tArrival[1].
Worst += p->pNodeDelays ? p->pNodeDelays[pNode->
Num] : 0;
387 return tArrInv.
Worst;
404 float tWorst0Using1, tWorst1Using0;
405 int fUsePhase1, fUsePhase0;
412 if ( p->fMappingMode == 1 )
425 if ( p->fMappingMode == 0 && p->DelayTarget <
ABC_INFINITY )
429 if ( pMatchBest0->
tArrive.
Worst > tWorst0Using1 + p->fEpsilon )
431 else if ( pMatchBest1->
tArrive.
Worst > tWorst1Using0 + p->fEpsilon )
441 fUsePhase0 = fUsePhase1 = 0;
442 if ( p->fMappingMode == 2 )
444 fUsePhase0 = (pNode->
tRequired[1].
Worst > tWorst1Using0 + 3*p->pSuperLib->tDelayInv.Worst + p->fEpsilon);
445 fUsePhase1 = (pNode->
tRequired[0].
Worst > tWorst0Using1 + 3*p->pSuperLib->tDelayInv.Worst + p->fEpsilon);
447 else if ( p->fMappingMode == 3 || p->fMappingMode == 4 )
449 fUsePhase0 = (pNode->
tRequired[1].
Worst > tWorst1Using0 + p->fEpsilon);
450 fUsePhase1 = (pNode->
tRequired[0].
Worst > tWorst0Using1 + p->fEpsilon);
452 if ( !fUsePhase0 && !fUsePhase1 )
456 if ( fUsePhase0 && fUsePhase1 )
464 assert( fUsePhase0 ^ fUsePhase1 );
470 if ( p->fMappingMode >= 2 && pNode->
nRefAct[1] > 0 )
475 if ( p->fMappingMode >= 2 && pNode->
nRefAct[0] == 0 )
481 if ( p->fMappingMode >= 2 && pNode->
nRefAct[0] > 0 )
486 if ( p->fMappingMode >= 2 && pNode->
nRefAct[1] == 0 )
559 assert( p->fMappingMode >= 0 && p->fMappingMode <= 4 );
562 if ( p->fMappingMode == 0 )
566 if ( p->fMappingMode == 0 )
568 else if ( p->fMappingMode == 1 )
574 for ( i = 0; i < p->vMapObjs->nSize; i++ )
576 pNode = p->vMapObjs->pArray[i];
593 printf(
"\nError: A node in the mapping graph does not have feasible cuts.\n" );
613 printf(
"\nError: Could not match both phases of AIG node %d.\n", pNode->
Num );
614 printf(
"Please make sure that the supergate library has equivalents of AND2 or NAND2.\n" );
615 printf(
"If such supergates exist in the library, report a bug.\n" );
float Map_CutDeref(Map_Cut_t *pCut, int fPhase)
int Map_NodeIsAnd(Map_Node_t *p)
float Map_SwitchCutRef(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
int Map_MatchNodePhase(Map_Man_t *p, Map_Node_t *pNode, int fPhase)
int Map_NodeIsBuf(Map_Node_t *p)
int Map_MatchCompare(Map_Man_t *pMan, Map_Match_t *pM1, Map_Match_t *pM2, int fDoingArea)
float Map_CutGetAreaDerefed(Map_Cut_t *pCut, int fPhase)
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
float Map_CutRef(Map_Cut_t *pCut, int fPhase)
void Map_MappingEstimateRefs(Map_Man_t *p)
void Map_MappingSetPiArrivalTimes(Map_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
void Map_MappingEstimateRefsInit(Map_Man_t *p)
ABC_NAMESPACE_IMPL_START void Map_MatchClean(Map_Match_t *pMatch)
DECLARATIONS ///.
float Map_TimeCutComputeArrival(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float tWorstCaseLimit)
float Map_SwitchCutDeref(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
#define ABC_NAMESPACE_IMPL_START
int Map_MappingMatches(Map_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
float Map_CutGetAreaFlow(Map_Cut_t *pCut, int fPhase)
void Map_NodeTransferArrivalTimes(Map_Man_t *p, Map_Node_t *pNode)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
float Map_SwitchCutGetDerefed(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
FUNCTION DEFINITIONS ///.
int Map_MatchNodeCut(Map_Man_t *p, Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float fWorstLimit)
float Map_TimeMatchWithInverter(Map_Man_t *p, Map_Match_t *pMatch)
void Map_NodeTryDroppingOnePhase(Map_Man_t *p, Map_Node_t *pNode)