#include "if.h"
Go to the source code of this file.
Functions | |
static void | If_CutSortInputPins (If_Man_t *p, If_Cut_t *pCut, int *pPinPerm, float *pPinDelays) |
float | If_CutDelay (If_Man_t *p, If_Cut_t *pCut) |
void | If_CutPropagateRequired (If_Man_t *p, If_Cut_t *pCut, float ObjRequired) |
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Computes delay.]
Description []
SideEffects []
SeeAlso []
Definition at line 44 of file ifTime.c.
00045 { 00046 static int pPinPerm[IF_MAX_LUTSIZE]; 00047 static float pPinDelays[IF_MAX_LUTSIZE]; 00048 If_Obj_t * pLeaf; 00049 float Delay, DelayCur; 00050 float * pLutDelays; 00051 int i, Shift; 00052 assert( p->pPars->fSeqMap || pCut->nLeaves > 1 ); 00053 Delay = -IF_FLOAT_LARGE; 00054 if ( p->pPars->pLutLib ) 00055 { 00056 assert( !p->pPars->fLiftLeaves ); 00057 pLutDelays = p->pPars->pLutLib->pLutDelays[pCut->nLeaves]; 00058 if ( p->pPars->pLutLib->fVarPinDelays ) 00059 { 00060 // compute the delay using sorted pins 00061 If_CutSortInputPins( p, pCut, pPinPerm, pPinDelays ); 00062 for ( i = 0; i < (int)pCut->nLeaves; i++ ) 00063 { 00064 DelayCur = pPinDelays[pPinPerm[i]] + pLutDelays[i]; 00065 Delay = IF_MAX( Delay, DelayCur ); 00066 } 00067 } 00068 else 00069 { 00070 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00071 { 00072 DelayCur = If_ObjCutBest(pLeaf)->Delay + pLutDelays[0]; 00073 Delay = IF_MAX( Delay, DelayCur ); 00074 } 00075 } 00076 } 00077 else 00078 { 00079 if ( pCut->fUser ) 00080 { 00081 assert( !p->pPars->fLiftLeaves ); 00082 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00083 { 00084 DelayCur = If_ObjCutBest(pLeaf)->Delay + (float)pCut->pPerm[i]; 00085 Delay = IF_MAX( Delay, DelayCur ); 00086 } 00087 } 00088 else 00089 { 00090 if ( p->pPars->fLiftLeaves ) 00091 { 00092 If_CutForEachLeafSeq( p, pCut, pLeaf, Shift, i ) 00093 { 00094 DelayCur = If_ObjCutBest(pLeaf)->Delay - Shift * p->Period; 00095 Delay = IF_MAX( Delay, DelayCur ); 00096 } 00097 } 00098 else 00099 { 00100 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00101 { 00102 DelayCur = If_ObjCutBest(pLeaf)->Delay; 00103 Delay = IF_MAX( Delay, DelayCur ); 00104 } 00105 } 00106 Delay += 1.0; 00107 } 00108 } 00109 return Delay; 00110 }
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 123 of file ifTime.c.
00124 { 00125 static int pPinPerm[IF_MAX_LUTSIZE]; 00126 static float pPinDelays[IF_MAX_LUTSIZE]; 00127 If_Obj_t * pLeaf; 00128 float * pLutDelays; 00129 float Required; 00130 int i; 00131 assert( !p->pPars->fLiftLeaves ); 00132 // compute the pins 00133 if ( p->pPars->pLutLib ) 00134 { 00135 pLutDelays = p->pPars->pLutLib->pLutDelays[pCut->nLeaves]; 00136 if ( p->pPars->pLutLib->fVarPinDelays ) 00137 { 00138 // compute the delay using sorted pins 00139 If_CutSortInputPins( p, pCut, pPinPerm, pPinDelays ); 00140 for ( i = 0; i < (int)pCut->nLeaves; i++ ) 00141 { 00142 Required = ObjRequired - pLutDelays[i]; 00143 pLeaf = If_ManObj( p, pCut->pLeaves[pPinPerm[i]] ); 00144 pLeaf->Required = IF_MIN( pLeaf->Required, Required ); 00145 } 00146 } 00147 else 00148 { 00149 Required = ObjRequired - pLutDelays[0]; 00150 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00151 pLeaf->Required = IF_MIN( pLeaf->Required, Required ); 00152 } 00153 } 00154 else 00155 { 00156 if ( pCut->fUser ) 00157 { 00158 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00159 { 00160 Required = ObjRequired - (float)pCut->pPerm[i]; 00161 pLeaf->Required = IF_MIN( pLeaf->Required, Required ); 00162 } 00163 } 00164 else 00165 { 00166 Required = ObjRequired - (float)1.0; 00167 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00168 pLeaf->Required = IF_MIN( pLeaf->Required, Required ); 00169 } 00170 } 00171 }
void If_CutSortInputPins | ( | If_Man_t * | p, | |
If_Cut_t * | pCut, | |||
int * | pPinPerm, | |||
float * | pPinDelays | |||
) | [static] |
CFile****************************************************************
FileName [ifTime.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [FPGA mapping based on priority cuts.]
Synopsis [Computation of delay paramters depending on the library.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - November 21, 2006.]
Revision [
] DECLARATIONS ///
Function*************************************************************
Synopsis [Sorts the pins in the decreasing order of delays.]
Description []
SideEffects []
SeeAlso []
Definition at line 184 of file ifTime.c.
00185 { 00186 If_Obj_t * pLeaf; 00187 int i, j, best_i, temp; 00188 // start the trivial permutation and collect pin delays 00189 If_CutForEachLeaf( p, pCut, pLeaf, i ) 00190 { 00191 pPinPerm[i] = i; 00192 pPinDelays[i] = If_ObjCutBest(pLeaf)->Delay; 00193 } 00194 // selection sort the pins in the decreasible order of delays 00195 // this order will match the increasing order of LUT input pins 00196 for ( i = 0; i < (int)pCut->nLeaves-1; i++ ) 00197 { 00198 best_i = i; 00199 for ( j = i+1; j < (int)pCut->nLeaves; j++ ) 00200 if ( pPinDelays[pPinPerm[j]] > pPinDelays[pPinPerm[best_i]] ) 00201 best_i = j; 00202 if ( best_i == i ) 00203 continue; 00204 temp = pPinPerm[i]; 00205 pPinPerm[i] = pPinPerm[best_i]; 00206 pPinPerm[best_i] = temp; 00207 } 00208 // verify 00209 assert( pPinPerm[0] < (int)pCut->nLeaves ); 00210 for ( i = 1; i < (int)pCut->nLeaves; i++ ) 00211 { 00212 assert( pPinPerm[i] < (int)pCut->nLeaves ); 00213 assert( pPinDelays[pPinPerm[i-1]] >= pPinDelays[pPinPerm[i]] ); 00214 } 00215 }