abc/src/map/mapper/mapperTime.c
/**Function*************************************************************

  Synopsis    [Computes the arrival times of the cut.]

  Description [Computes the arrival times of the cut if it is implemented using 
  the given supergate with the given phase. Uses the constraint-type specification
  of rise/fall arrival times.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Computes the arrival times of the cut.]

Description [Computes the arrival times of the cut if it is implemented using
the given supergate with the given phase. Uses the constraint-type specification
of rise/fall arrival times.]




Function Synopsis [ Computes the arrival times of the cut . ] Description [ Computes the arrival times of the cut if it is implemented using the given supergate with the given phase . Uses the constraint - type specification of rise / fall arrival times . ]
float Map_TimeCutComputeArrival( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, float tWorstLimit )
{
    Map_Match_t * pM = pCut->M + fPhase;
    Map_Super_t * pSuper = pM->pSuperBest;
    unsigned uPhaseTot = pM->uPhaseBest;
    Map_Time_t * ptArrRes = &pM->tArrive;
    Map_Time_t * ptArrIn;
    int fPinPhase;
    float tDelay, tExtra;
    int i;
    tExtra = pNode->p->pNodeDelays ? pNode->p->pNodeDelays[pNode->Num] : 0;
    ptArrRes->Rise  = ptArrRes->Fall = 0.0;
    ptArrRes->Worst = MAP_FLOAT_LARGE;
    for ( i = pCut->nLeaves - 1; i >= 0; i-- )
    {
        fPinPhase = ((uPhaseTot & (1 << i)) == 0);
        ptArrIn = pCut->ppLeaves[i]->tArrival + fPinPhase;
        if ( pSuper->tDelaysR[i].Rise > 0 )
        {
            tDelay = ptArrIn->Rise + pSuper->tDelaysR[i].Rise + tExtra;
            if ( tDelay > tWorstLimit )
                return MAP_FLOAT_LARGE;
            if ( ptArrRes->Rise < tDelay )
                ptArrRes->Rise = tDelay;
        }
        if ( pSuper->tDelaysR[i].Fall > 0 )
        {
            tDelay = ptArrIn->Fall + pSuper->tDelaysR[i].Fall + tExtra;
            if ( tDelay > tWorstLimit )
                return MAP_FLOAT_LARGE;
            if ( ptArrRes->Rise < tDelay )
                ptArrRes->Rise = tDelay;
        }
        if ( pSuper->tDelaysF[i].Rise > 0 )
        {
            tDelay = ptArrIn->Rise + pSuper->tDelaysF[i].Rise + tExtra;
            if ( tDelay > tWorstLimit )
                return MAP_FLOAT_LARGE;
            if ( ptArrRes->Fall < tDelay )
                ptArrRes->Fall = tDelay;
        }
        if ( pSuper->tDelaysF[i].Fall > 0 )
        {
            tDelay = ptArrIn->Fall + pSuper->tDelaysF[i].Fall + tExtra;
            if ( tDelay > tWorstLimit )
                return MAP_FLOAT_LARGE;
            if ( ptArrRes->Fall < tDelay )
                ptArrRes->Fall = tDelay;
        }
    }
    ptArrRes->Worst = MAP_MAX(ptArrRes->Rise, ptArrRes->Fall);
    return ptArrRes->Worst;
}
float Map_TimeCutComputeArrival ( Map_Node_t * pNode , Map_Cut_t * pCut , int fPhase , float tWorstLimit ) { Map_Match_t * pM = pCut -> M + fPhase ; Map_Super_t * pSuper = pM -> pSuperBest ; unsigned uPhaseTot = pM -> uPhaseBest ; Map_Time_t * ptArrRes = & pM -> tArrive ; Map_Time_t * ptArrIn ; int fPinPhase ; float tDelay , tExtra ; int i ; tExtra = pNode -> p -> pNodeDelays ? pNode -> p -> pNodeDelays [ pNode -> Num ] : 0 ; ptArrRes -> Rise = ptArrRes -> Fall = 0.0 ; ptArrRes -> Worst = MAP_FLOAT_LARGE ; for ( i = pCut -> nLeaves - 1 ; i >= 0 ; i -- ) { fPinPhase = ( ( uPhaseTot & ( 1 << i ) ) == 0 ) ; ptArrIn = pCut -> ppLeaves [ i ] -> tArrival + fPinPhase ; if ( pSuper -> tDelaysR [ i ] . Rise > 0 ) { tDelay = ptArrIn -> Rise + pSuper -> tDelaysR [ i ] . Rise + tExtra ; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE ; if ( ptArrRes -> Rise < tDelay ) ptArrRes -> Rise = tDelay ; } if ( pSuper -> tDelaysR [ i ] . Fall > 0 ) { tDelay = ptArrIn -> Fall + pSuper -> tDelaysR [ i ] . Fall + tExtra ; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE ; if ( ptArrRes -> Rise < tDelay ) ptArrRes -> Rise = tDelay ; } if ( pSuper -> tDelaysF [ i ] . Rise > 0 ) { tDelay = ptArrIn -> Rise + pSuper -> tDelaysF [ i ] . Rise + tExtra ; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE ; if ( ptArrRes -> Fall < tDelay ) ptArrRes -> Fall = tDelay ; } if ( pSuper -> tDelaysF [ i ] . Fall > 0 ) { tDelay = ptArrIn -> Fall + pSuper -> tDelaysF [ i ] . Fall + tExtra ; if ( tDelay > tWorstLimit ) return MAP_FLOAT_LARGE ; if ( ptArrRes -> Fall < tDelay ) ptArrRes -> Fall = tDelay ; } } ptArrRes -> Worst = MAP_MAX ( ptArrRes -> Rise , ptArrRes -> Fall ) ; return ptArrRes -> Worst ; }
Function
Synopsis    [Computes the arrival times of the cut.]
Function Synopsis [ Computes the arrival times of the cut . ]
// get the phase of the given pin // get the rise of the output due to rise of the inputs // get the rise of the output due to fall of the inputs // get the fall of the output due to rise of the inputs // get the fall of the output due to fall of the inputs // return the worst-case of rise/fall arrival times