void Map_TimeComputeRequiredGlobal( Map_Man_t * p ) { Map_Time_t * ptTime, * ptTimeA; int fPhase, i; // update the required times according to the target p->fRequiredGlo = Map_TimeComputeArrivalMax( p ); if ( p->DelayTarget != -1 ) { if ( p->fRequiredGlo > p->DelayTarget + p->fEpsilon ) { if ( p->fMappingMode == 1 ) printf( "Cannot meet the target required times (%4.2f). Continue anyway.\n", p->DelayTarget ); } else if ( p->fRequiredGlo < p->DelayTarget - p->fEpsilon ) { if ( p->fMappingMode == 1 && p->fVerbose ) printf( "Relaxing the required times from (%4.2f) to the target (%4.2f).\n", p->fRequiredGlo, p->DelayTarget ); p->fRequiredGlo = p->DelayTarget; } } // clean the required times for ( i = 0; i < p->vMapObjs->nSize; i++ ) { p->vMapObjs->pArray[i]->tRequired[0].Rise = MAP_FLOAT_LARGE; p->vMapObjs->pArray[i]->tRequired[0].Fall = MAP_FLOAT_LARGE; p->vMapObjs->pArray[i]->tRequired[0].Worst = MAP_FLOAT_LARGE; p->vMapObjs->pArray[i]->tRequired[1].Rise = MAP_FLOAT_LARGE; p->vMapObjs->pArray[i]->tRequired[1].Fall = MAP_FLOAT_LARGE; p->vMapObjs->pArray[i]->tRequired[1].Worst = MAP_FLOAT_LARGE; } // set the required times for the POs for ( i = 0; i < p->nOutputs; i++ ) { fPhase = !Map_IsComplement(p->pOutputs[i]); ptTime = Map_Regular(p->pOutputs[i])->tRequired + fPhase; ptTimeA = Map_Regular(p->pOutputs[i])->tArrival + fPhase; // if external required time can be achieved, use it if ( p->pOutputRequireds && p->pOutputRequireds[i].Worst > 0 && ptTimeA->Worst <= p->pOutputRequireds[i].Worst )//&& p->pOutputRequireds[i].Worst <= p->fRequiredGlo ) ptTime->Rise = ptTime->Fall = ptTime->Worst = p->pOutputRequireds[i].Worst; // if external required cannot be achieved, set the earliest possible arrival time else if ( p->pOutputRequireds && p->pOutputRequireds[i].Worst > 0 && ptTimeA->Worst > p->pOutputRequireds[i].Worst ) ptTime->Rise = ptTime->Fall = ptTime->Worst = ptTimeA->Worst; // otherwise, set the global required time else ptTime->Rise = ptTime->Fall = ptTime->Worst = p->fRequiredGlo; } // visit nodes in the reverse topological order Map_TimePropagateRequired( p ); }
/**Function************************************************************* Synopsis [Compute the arrival times.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ float Map_MappingComputeDelayWithFanouts( Map_Man_t * p ) { Map_Node_t * pNode; float Result; int i; for ( i = 0; i < p->vMapObjs->nSize; i++ ) { // skip primary inputs pNode = p->vMapObjs->pArray[i]; if ( !Map_NodeIsAnd( pNode ) ) continue; // skip a secondary node if ( pNode->pRepr ) continue; // count the switching nodes if ( pNode->nRefAct[0] > 0 ) Map_TimeCutComputeArrival( pNode, pNode->pCutBest[0], 0, MAP_FLOAT_LARGE ); if ( pNode->nRefAct[1] > 0 ) Map_TimeCutComputeArrival( pNode, pNode->pCutBest[1], 1, MAP_FLOAT_LARGE ); } Result = Map_TimeComputeArrivalMax(p); printf( "Max arrival times with fanouts = %10.2f.\n", Result ); return Result; }