91 float * pDelayTable, * pDelayTableNew;
92 int i, k, nInputs, nOutputs;
121 if ( pDelayTable == NULL )
123 assert( i == (
int)pDelayTable[0] );
124 nInputs = (int)pDelayTable[1];
125 nOutputs = (int)pDelayTable[2];
126 pDelayTableNew =
ABC_ALLOC(
float, 3 + nInputs * nOutputs );
127 pDelayTableNew[0] = (int)pDelayTable[0];
128 pDelayTableNew[1] = (int)pDelayTable[1];
129 pDelayTableNew[2] = (int)pDelayTable[2];
130 for ( k = 0; k < nInputs * nOutputs; k++ )
134 pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k];
147 pBox->Inouts[pBox->nInputs], pBox->nOutputs, pBox->iDelayTable );
168 float * pDelayTable, * pDelayTableNew;
169 int i, k, nNewCis, nNewCos, nInputs, nOutputs;
178 nNewCis += pBox->nOutputs;
179 nNewCos += pBox->nInputs;
203 if ( pDelayTable == NULL )
205 assert( i == (
int)pDelayTable[0] );
206 nInputs = (int)pDelayTable[1];
207 nOutputs = (int)pDelayTable[2];
208 pDelayTableNew =
ABC_ALLOC(
float, 3 + nInputs * nOutputs );
209 pDelayTableNew[0] = (int)pDelayTable[0];
210 pDelayTableNew[1] = (int)pDelayTable[1];
211 pDelayTableNew[2] = (int)pDelayTable[2];
212 for ( k = 0; k < nInputs * nOutputs; k++ )
213 pDelayTableNew[3+k] = pDelayTable[3+k];
228 Tim_ManCreateBox( pNew, curPo, pBox->nInputs, curPi, pBox->nOutputs, pBox->iDelayTable );
230 curPi += pBox->nOutputs;
231 curPo += pBox->nInputs;
256 float * pDelayTable, * pDelayTableNew;
257 int i, k, iBox, nNewCis, nNewCos, nInputs, nOutputs;
267 nNewCis += pBox->nOutputs;
268 nNewCos += pBox->nInputs;
281 memcpy( pNew->pCos + nNewCos - nNewPoNum,
291 if ( pDelayTable == NULL )
293 if ( i != (
int)pDelayTable[0] && fWarning == 0 )
295 printf(
"Warning: Mismatch in delay-table number between the manager and the box.\n" );
299 nInputs = (int)pDelayTable[1];
300 nOutputs = (int)pDelayTable[2];
301 pDelayTableNew =
ABC_ALLOC(
float, 3 + nInputs * nOutputs );
302 pDelayTableNew[0] = i;
303 pDelayTableNew[1] = (int)pDelayTable[1];
304 pDelayTableNew[2] = (int)pDelayTable[2];
305 for ( k = 0; k < nInputs * nOutputs; k++ )
306 pDelayTableNew[3+k] = pDelayTable[3+k];
315 int curPi = nNewPiNum;
321 Tim_ManCreateBox( pNew, curPo, pBox->nInputs, curPi, pBox->nOutputs, pBox->iDelayTable );
323 curPi += pBox->nOutputs;
324 curPo += pBox->nInputs;
352 if ( pBox->iCopy < 0 || pBox->iCopy >=
Tim_ManBoxNum(pSpec) )
411 assert( p->vDelayTables == NULL );
416 if ( pBox->iDelayTable == -1 || pLibBox == NULL )
419 pTable =
ABC_ALLOC(
float, 3 + pBox->nInputs * pBox->nOutputs );
420 pTable[0] = pBox->iDelayTable;
421 pTable[1] = pBox->nInputs;
422 pTable[2] = pBox->nOutputs;
423 for ( k = 0; k < pBox->nInputs * pBox->nOutputs; k++ )
435 pBox->fBlack = pIfBox->
fBlack;
436 if (
Vec_PtrEntry( p->vDelayTables, pBox->iDelayTable ) != NULL )
439 pTable =
ABC_ALLOC(
float, 3 + pBox->nInputs * pBox->nOutputs );
440 pTable[0] = pBox->iDelayTable;
441 pTable[1] = pBox->nInputs;
442 pTable[2] = pBox->nOutputs;
443 for ( k = 0; k < pBox->nInputs * pBox->nOutputs; k++ )
444 pTable[3 + k] = pIfBox->
pDelays[k];
528 int i, j, k, TableX, TableY;
531 printf(
"TIMING MANAGER:\n" );
532 printf(
"PI = %d. CI = %d. PO = %d. CO = %d. Box = %d.\n",
541 printf(
"All PIs : arrival = %5.3f required = %5.3f\n", pPrev->
timeArr, pPrev->
timeReq );
544 printf(
"PI%5d : arrival = %5.3f required = %5.3f\n", i, pObj->
timeArr, pObj->
timeReq );
552 printf(
"All POs : arrival = %5.3f required = %5.3f\n", pPrev->
timeArr, pPrev->
timeReq );
557 printf(
"PO%5d : arrival = %5.3f required = %5.3f\n", k++, pObj->
timeArr, pObj->
timeReq );
564 printf(
"*** Box %5d : I =%4d. O =%4d. I1 =%6d. O1 =%6d. Table =%4d\n",
565 i, pBox->nInputs, pBox->nOutputs,
575 printf(
"Box inputs : arrival = %5.3f required = %5.3f\n", pPrev->
timeArr, pPrev->
timeReq );
578 printf(
"box-in%4d : arrival = %5.3f required = %5.3f\n", k, pObj->
timeArr, pObj->
timeReq );
586 printf(
"Box outputs : arrival = %5.3f required = %5.3f\n", pPrev->
timeArr, pPrev->
timeReq );
589 printf(
"box-out%3d : arrival = %5.3f required = %5.3f\n", k, pObj->
timeArr, pObj->
timeReq );
599 if ( pTable == NULL )
601 printf(
"Delay table %d:\n", i );
602 assert( i == (
int)pTable[0] );
603 TableX = (int)pTable[1];
604 TableY = (int)pTable[2];
605 for ( j = 0; j < TableY; j++, printf(
"\n" ) )
606 for ( k = 0; k < TableX; k++ )
608 printf(
"%5s",
"-" );
610 printf(
"%5.0f", pTable[3+j*TableX+k] );
635 printf(
"PI/CI = %d/%d PO/CO = %d/%d Box = %d ",
640 printf(
"delay(AND2) = %d", nAnd2Delay );
646 IdMax =
Abc_MaxInt( IdMax, pBox->iDelayTable );
657 if ( Count == 0 )
continue;
659 printf(
" Box %4d ", i );
660 printf(
"Num = %4d ", Count );
661 printf(
"Ins = %4d ", pBox->nInputs );
662 printf(
"Outs = %4d", pBox->nOutputs );
712 Counter += pBox->fBlack;
717 return p->vDelayTables ?
Vec_PtrSize(p->vDelayTables) : 0;
733 assert( p->vDelayTables == NULL );
734 p->vDelayTables = vDelayTables;
int Tim_ManBoxOutputFirst(Tim_Man_t *p, int iBox)
static Vec_Ptr_t * Vec_PtrStart(int nSize)
Tim_Man_t * Tim_ManDup(Tim_Man_t *p, int fUnitDelay)
#define Tim_ManForEachTable(p, pTable, i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
void Tim_ManSetDelayTables(Tim_Man_t *p, Vec_Ptr_t *vDelayTables)
Tim_Man_t * Tim_ManTrim(Tim_Man_t *p, Vec_Int_t *vBoxPres)
#define Tim_ManBoxForEachOutput(p, pBox, pObj, i)
float * Tim_ManGetReqTimes(Tim_Man_t *p)
void Tim_ManPrint(Tim_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Tim_ManStopP(Tim_Man_t **p)
#define Tim_ManForEachBox(p, pBox, i)
static void Vec_PtrFreeFree(Vec_Ptr_t *p)
int Tim_ManPiNum(Tim_Man_t *p)
#define Tim_ManForEachPo(p, pObj, i)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
int Tim_ManBoxOutputNum(Tim_Man_t *p, int iBox)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
int Tim_ManDelayTableNum(Tim_Man_t *p)
static Tim_Obj_t * Tim_ManBoxOutput(Tim_Man_t *p, Tim_Box_t *pBox, int i)
void Tim_ManTravIdDisable(Tim_Man_t *p)
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable)
ITERATORS ///.
void Tim_ManPrintStats(Tim_Man_t *p, int nAnd2Delay)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Mem_Flex_t * Mem_FlexStart()
int Tim_ManPoNum(Tim_Man_t *p)
int Tim_ManBoxNum(Tim_Man_t *p)
static Vec_Int_t * Vec_IntStart(int nSize)
ABC_NAMESPACE_IMPL_START Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
Vec_Int_t * Tim_ManAlignTwo(Tim_Man_t *pSpec, Tim_Man_t *pImpl)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
#define Tim_ManForEachCo(p, pObj, i)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
#define Tim_ManBoxForEachInput(p, pBox, pObj, i)
static void Abc_Print(int level, const char *format,...)
static Tim_Box_t * Tim_ManBox(Tim_Man_t *p, int i)
float * Tim_ManGetArrTimes(Tim_Man_t *p)
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void Tim_ManInitPiArrivalAll(Tim_Man_t *p, float Delay)
static int Vec_IntSize(Vec_Int_t *p)
#define Tim_ManForEachPi(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define TIM_ETERNITY
MACRO DEFINITIONS ///.
#define Tim_ManForEachCi(p, pObj, i)
ITERATORS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
static void Vec_PtrFreeP(Vec_Ptr_t **p)
int Tim_ManCoNum(Tim_Man_t *p)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Tim_Man_t * Tim_ManReduce(Tim_Man_t *p, Vec_Int_t *vBoxesLeft, int nTermsDiff)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
static Tim_Obj_t * Tim_ManBoxInput(Tim_Man_t *p, Tim_Box_t *pBox, int i)
static float Vec_FltEntry(Vec_Flt_t *p, int i)
void Tim_ManCreate(Tim_Man_t *p, void *pLib, Vec_Flt_t *vInArrs, Vec_Flt_t *vOutReqs)
void Tim_ManTravIdEnable(Tim_Man_t *p)
static void Vec_IntFree(Vec_Int_t *p)
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
void Tim_ManStop(Tim_Man_t *p)
static int Vec_FltSize(Vec_Flt_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int Tim_ManBlackBoxNum(Tim_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Tim_Box_t_ Tim_Box_t
INCLUDES ///.
void Tim_ManBoxSetCopy(Tim_Man_t *p, int iBox, int iCopy)
int Tim_ManCiNum(Tim_Man_t *p)
void Tim_ManInitPoRequiredAll(Tim_Man_t *p, float Delay)
#define ABC_FALLOC(type, num)
static void Vec_PtrFree(Vec_Ptr_t *p)