ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcTiming.c
Go to the documentation of this file.
1
20
21#include <math.h>
22
23#include "base/abc/abc.h"
24#include "base/main/main.h"
25#include "map/mio/mio.h"
26
27
29
30
31
35
47
48#define TOLERANCE 0.001
49
50static inline int Abc_FloatEqual( float x, float y ) { return fabs(x-y) < TOLERANCE; }
51
52// static functions
53static Abc_ManTime_t * Abc_ManTimeStart( Abc_Ntk_t * pNtk );
54static void Abc_ManTimeExpand( Abc_ManTime_t * p, int nSize, int fProgressive );
55
56// accessing the arrival and required times of a node
57static inline Abc_Time_t * Abc_NodeArrival( Abc_Obj_t * pNode ) { return (Abc_Time_t *)pNode->pNtk->pManTime->vArrs->pArray[pNode->Id]; }
58static inline Abc_Time_t * Abc_NodeRequired( Abc_Obj_t * pNode ) { return (Abc_Time_t *)pNode->pNtk->pManTime->vReqs->pArray[pNode->Id]; }
59
63
76{
77 assert( pNtk->pManTime );
78 return &pNtk->pManTime->tArrDef;
79}
81{
82 assert( pNtk->pManTime );
83 return &pNtk->pManTime->tReqDef;
84}
86{
87 assert( pNode->pNtk->pManTime );
88 return Abc_NodeArrival(pNode);
89}
91{
92 assert( pNode->pNtk->pManTime );
93 return Abc_NodeRequired(pNode);
94}
96{
97 return 0.5 * pNtk->pManTime->tArrDef.Rise + 0.5 * pNtk->pManTime->tArrDef.Fall;
98}
100{
101 return 0.5 * pNtk->pManTime->tReqDef.Rise + 0.5 * pNtk->pManTime->tReqDef.Fall;
102}
104{
105 return 0.5 * Abc_NodeArrival(pNode)->Rise + 0.5 * Abc_NodeArrival(pNode)->Fall;
106}
108{
109 return 0.5 * Abc_NodeReadRequired(pNode)->Rise + 0.5 * Abc_NodeReadRequired(pNode)->Fall;
110}
112{
113 return Abc_MaxFloat( Abc_NodeArrival(pNode)->Rise, Abc_NodeArrival(pNode)->Fall );
114}
116{
117 return Abc_MinFloat( Abc_NodeReadRequired(pNode)->Rise, Abc_NodeReadRequired(pNode)->Fall );
118}
119
132{
133 assert( pNtk->pManTime );
134 return &pNtk->pManTime->tInDriveDef;
135}
137{
138 assert( pNtk->pManTime );
139 return &pNtk->pManTime->tOutLoadDef;
140}
142{
143 assert( pNtk->pManTime );
144 return pNtk->pManTime->tInDrive ? pNtk->pManTime->tInDrive + iPi : NULL;
145}
147{
148 assert( pNtk->pManTime );
149 return pNtk->pManTime->tOutLoad ? pNtk->pManTime->tOutLoad + iPo : NULL;
150}
152{
153 return Abc_MaxFloat( Abc_NodeReadInputDrive(pNtk, iPi)->Rise, Abc_NodeReadInputDrive(pNtk, iPi)->Fall );
154}
156{
157 return Abc_MaxFloat( Abc_NodeReadOutputLoad(pNtk, iPo)->Rise, Abc_NodeReadOutputLoad(pNtk, iPo)->Fall );
158}
159
173void Abc_NtkTimeSetDefaultArrival( Abc_Ntk_t * pNtk, float Rise, float Fall )
174{
175 Abc_Obj_t * pObj; int i;
176 if ( pNtk->pManTime == NULL )
177 pNtk->pManTime = Abc_ManTimeStart(pNtk);
178 pNtk->pManTime->tArrDef.Rise = Rise;
179 pNtk->pManTime->tArrDef.Fall = Fall;
180 // set the arrival times for each input
181 Abc_NtkForEachCi( pNtk, pObj, i )
182 Abc_NtkTimeSetArrival( pNtk, Abc_ObjId(pObj), Rise, Fall );
183}
184void Abc_NtkTimeSetDefaultRequired( Abc_Ntk_t * pNtk, float Rise, float Fall )
185{
186 Abc_Obj_t * pObj; int i;
187 if ( pNtk->pManTime == NULL )
188 pNtk->pManTime = Abc_ManTimeStart(pNtk);
189 pNtk->pManTime->tReqDef.Rise = Rise;
190 pNtk->pManTime->tReqDef.Fall = Fall;
191 // set the required times for each output
192 Abc_NtkForEachCo( pNtk, pObj, i ){
193 Abc_NtkTimeSetRequired( pNtk, Abc_ObjId(pObj), Rise, Fall );
194 }
195}
196
208void Abc_NtkTimeSetArrival( Abc_Ntk_t * pNtk, int ObjId, float Rise, float Fall )
209{
210 Vec_Ptr_t * vTimes;
211 Abc_Time_t * pTime;
212
213 if ( pNtk->pManTime == NULL )
214 pNtk->pManTime = Abc_ManTimeStart(pNtk);
215 Abc_ManTimeExpand( pNtk->pManTime, ObjId + 1, 1 );
216 // set the arrival time
217 vTimes = pNtk->pManTime->vArrs;
218 pTime = (Abc_Time_t *)vTimes->pArray[ObjId];
219 pTime->Rise = Rise;
220 pTime->Fall = Fall;
221
222
223}
224void Abc_NtkTimeSetRequired( Abc_Ntk_t * pNtk, int ObjId, float Rise, float Fall )
225{
226 Vec_Ptr_t * vTimes;
227 Abc_Time_t * pTime;
228 if ( pNtk->pManTime == NULL )
229 pNtk->pManTime = Abc_ManTimeStart(pNtk);
230 Abc_ManTimeExpand( pNtk->pManTime, ObjId + 1, 1 );
231 // set the required time
232 vTimes = pNtk->pManTime->vReqs;
233 pTime = (Abc_Time_t *)vTimes->pArray[ObjId];
234 pTime->Rise = Rise;
235 pTime->Fall = Fall;
236}
237
249void Abc_NtkTimeSetDefaultInputDrive( Abc_Ntk_t * pNtk, float Rise, float Fall )
250{
251// if ( Rise == 0.0 && Fall == 0.0 )
252// return;
253 if ( pNtk->pManTime == NULL )
254 pNtk->pManTime = Abc_ManTimeStart(pNtk);
255 pNtk->pManTime->tInDriveDef.Rise = Rise;
256 pNtk->pManTime->tInDriveDef.Fall = Fall;
257 if ( pNtk->pManTime->tInDrive != NULL )
258 {
259 int i;
260 for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ )
261 if ( pNtk->pManTime->tInDrive[i].Rise == 0 && pNtk->pManTime->tInDrive[i].Fall == 0 )
262 pNtk->pManTime->tInDrive[i] = pNtk->pManTime->tInDriveDef;
263 }
264}
265void Abc_NtkTimeSetDefaultOutputLoad( Abc_Ntk_t * pNtk, float Rise, float Fall )
266{
267// if ( Rise == 0.0 && Fall == 0.0 )
268// return;
269 if ( pNtk->pManTime == NULL )
270 pNtk->pManTime = Abc_ManTimeStart(pNtk);
271 pNtk->pManTime->tOutLoadDef.Rise = Rise;
272 pNtk->pManTime->tOutLoadDef.Fall = Fall;
273 if ( pNtk->pManTime->tOutLoad != NULL )
274 {
275 int i;
276 for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
277 if ( pNtk->pManTime->tOutLoad[i].Rise == 0 && pNtk->pManTime->tOutLoad[i].Fall == 0 )
278 pNtk->pManTime->tOutLoad[i] = pNtk->pManTime->tOutLoadDef;
279 }
280}
281
293void Abc_NtkTimeSetInputDrive( Abc_Ntk_t * pNtk, int PiNum, float Rise, float Fall )
294{
295 Abc_Time_t * pTime;
296 assert( PiNum >= 0 && PiNum < Abc_NtkCiNum(pNtk) );
297 if ( pNtk->pManTime == NULL )
298 pNtk->pManTime = Abc_ManTimeStart(pNtk);
299 if ( pNtk->pManTime->tInDriveDef.Rise == Rise && pNtk->pManTime->tInDriveDef.Fall == Fall )
300 return;
301 if ( pNtk->pManTime->tInDrive == NULL )
302 {
303 int i;
304 pNtk->pManTime->tInDrive = ABC_CALLOC( Abc_Time_t, Abc_NtkCiNum(pNtk) );
305 for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ )
306 pNtk->pManTime->tInDrive[i] = pNtk->pManTime->tInDriveDef;
307 }
308 pTime = pNtk->pManTime->tInDrive + PiNum;
309 pTime->Rise = Rise;
310 pTime->Fall = Fall;
311}
312void Abc_NtkTimeSetOutputLoad( Abc_Ntk_t * pNtk, int PoNum, float Rise, float Fall )
313{
314 Abc_Time_t * pTime;
315 assert( PoNum >= 0 && PoNum < Abc_NtkCoNum(pNtk) );
316 if ( pNtk->pManTime == NULL )
317 pNtk->pManTime = Abc_ManTimeStart(pNtk);
318 if ( pNtk->pManTime->tOutLoadDef.Rise == Rise && pNtk->pManTime->tOutLoadDef.Fall == Fall )
319 return;
320 if ( pNtk->pManTime->tOutLoad == NULL )
321 {
322 int i;
323 pNtk->pManTime->tOutLoad = ABC_CALLOC( Abc_Time_t, Abc_NtkCoNum(pNtk) );
324 for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
325 pNtk->pManTime->tOutLoad[i] = pNtk->pManTime->tOutLoadDef;
326 }
327 pTime = pNtk->pManTime->tOutLoad + PoNum;
328 pTime->Rise = Rise;
329 pTime->Fall = Fall;
330}
331
344{
345 Abc_Obj_t * pObj;
346 Abc_Time_t ** ppTimes;
347 int i;
348 assert( pNtkOld == NULL || pNtkOld->pManTime != NULL );
349 assert( pNtkOld == NULL || Abc_NtkCiNum(pNtk) == Abc_NtkCiNum(pNtkOld) );
350 assert( pNtkOld == NULL || Abc_NtkCoNum(pNtk) == Abc_NtkCoNum(pNtkOld) );
351 if ( pNtk->pManTime == NULL )
352 return;
353 // create timing manager with default values
354 Abc_ManTimeExpand( pNtk->pManTime, Abc_NtkObjNumMax(pNtk), 0 );
355 // set global defaults from pNtkOld
356 if ( pNtkOld )
357 {
358 pNtk->pManTime->tArrDef = pNtkOld->pManTime->tArrDef;
359 pNtk->pManTime->tReqDef = pNtkOld->pManTime->tReqDef;
360 pNtk->AndGateDelay = pNtkOld->AndGateDelay;
361 }
362 // set the default timing for CI and COs
363 ppTimes = (Abc_Time_t **)pNtk->pManTime->vArrs->pArray;
364 Abc_NtkForEachCi( pNtk, pObj, i )
365 *ppTimes[pObj->Id] = pNtkOld ? *Abc_NodeReadArrival(Abc_NtkCi(pNtkOld, i)) : pNtk->pManTime->tArrDef;
366 ppTimes = (Abc_Time_t **)pNtk->pManTime->vReqs->pArray;
367 Abc_NtkForEachCo( pNtk, pObj, i )
368 *ppTimes[pObj->Id] = pNtkOld ? *Abc_NodeReadRequired(Abc_NtkCo(pNtkOld, i)) : pNtk->pManTime->tReqDef;
369}
370
382void Abc_NtkTimeScale( Abc_Ntk_t * pNtk, float Scale )
383{
384 Abc_Obj_t * pObj;
385 Abc_Time_t ** ppTimes, * pTime;
386 int i;
387 if ( pNtk->pManTime == NULL )
388 return;
389 // arrival
390 pNtk->pManTime->tArrDef.Fall *= Scale;
391 pNtk->pManTime->tArrDef.Rise *= Scale;
392 // departure
393 pNtk->pManTime->tReqDef.Fall *= Scale;
394 pNtk->pManTime->tReqDef.Rise *= Scale;
395 // set the default timing
396 ppTimes = (Abc_Time_t **)pNtk->pManTime->vArrs->pArray;
397 Abc_NtkForEachCi( pNtk, pObj, i )
398 {
399 pTime = ppTimes[pObj->Id];
400 pTime->Fall *= Scale;
401 pTime->Rise *= Scale;
402 }
403 // set the default timing
404 ppTimes = (Abc_Time_t **)pNtk->pManTime->vReqs->pArray;
405 Abc_NtkForEachCo( pNtk, pObj, i )
406 {
407 pTime = ppTimes[pObj->Id];
408 pTime->Fall *= Scale;
409 pTime->Rise *= Scale;
410 }
411}
412
425{
426 Abc_Obj_t * pObj;
427 Abc_Time_t ** ppTimes, * pTime;
428 int i;
429 // if there is no timing manager, allocate and initialize
430 if ( pNtk->pManTime == NULL )
431 {
432 pNtk->pManTime = Abc_ManTimeStart(pNtk);
433 Abc_NtkTimeInitialize( pNtk, NULL );
434 return;
435 }
436 // if timing manager is given, expand it if necessary
437 Abc_ManTimeExpand( pNtk->pManTime, Abc_NtkObjNumMax(pNtk), 0 );
438 // clean arrivals except for PIs
439 ppTimes = (Abc_Time_t **)pNtk->pManTime->vArrs->pArray;
440 Abc_NtkForEachNode( pNtk, pObj, i )
441 {
442 pTime = ppTimes[pObj->Id];
443 pTime->Fall = pTime->Rise = Abc_ObjFaninNum(pObj) ? -ABC_INFINITY : 0; // set contant node arrivals to zero
444 }
445 Abc_NtkForEachCo( pNtk, pObj, i )
446 {
447 pTime = ppTimes[pObj->Id];
448 pTime->Fall = pTime->Rise = -ABC_INFINITY;
449 }
450 // clean required except for POs
451 ppTimes = (Abc_Time_t **)pNtk->pManTime->vReqs->pArray;
452 Abc_NtkForEachNode( pNtk, pObj, i )
453 {
454 pTime = ppTimes[pObj->Id];
455 pTime->Fall = pTime->Rise = ABC_INFINITY;
456 }
457 Abc_NtkForEachCi( pNtk, pObj, i )
458 {
459 pTime = ppTimes[pObj->Id];
460 pTime->Fall = pTime->Rise = ABC_INFINITY;
461 }
462}
463
464
465
466
478Abc_ManTime_t * Abc_ManTimeStart( Abc_Ntk_t * pNtk )
479{
480 int fUseZeroDefaultOutputRequired = 1;
482 Abc_Time_t* pTime;
483 Abc_Obj_t * pObj; int i;
484 p = pNtk->pManTime = ABC_ALLOC( Abc_ManTime_t, 1 );
485 memset( p, 0, sizeof(Abc_ManTime_t) );
486 p->vArrs = Vec_PtrAlloc( 0 );
487 p->vReqs = Vec_PtrAlloc( 0 );
488 // set default default input=arrivals (assumed to be 0)
489 // set default default output-requireds (can be either 0 or +infinity, based on the flag)
490
491 // extend manager
492 Abc_ManTimeExpand( p, Abc_NtkObjNumMax(pNtk) + 1, 0 );
493 // set the default timing for CIs
494 Abc_NtkForEachCi( pNtk, pObj, i ){
495
496 //get the constrained value, if there is one
497 Vec_Ptr_t * vTimes;
498 vTimes = pNtk->pManTime->vArrs;
499 pTime = (Abc_Time_t *)vTimes->pArray[Abc_ObjId(pObj)];
500 //unconstrained arrival defaults. Note that
501 //unconstrained value in vTimes set to -ABC_INFINITY.
502 if (pTime &&
503 (!(p-> tArrDef.Fall == -ABC_INFINITY ||
504 p-> tArrDef.Rise != -ABC_INFINITY ))
505 ){
506 p->tArrDef.Fall = pTime -> Fall;
507 p->tArrDef.Rise = pTime -> Rise;
508 }
509 else {
510 //use the default arrival time 0 (implicit in memset 0, above).
511 p->tArrDef.Rise = 0;
512 p->tArrDef.Fall = 0;
513 }
514 Abc_NtkTimeSetArrival( pNtk, Abc_ObjId(pObj), p->tArrDef.Rise, p->tArrDef.Rise );
515 }
516
517
518 Abc_NtkForEachCo( pNtk, pObj, i ){
519 Vec_Ptr_t * vTimes;
520 vTimes = pNtk->pManTime->vArrs;
521 pTime = (Abc_Time_t *)vTimes->pArray[Abc_ObjId(pObj)];
522 if (pTime){
523 p->tReqDef.Fall = pTime -> Fall;
524 p->tReqDef.Rise = pTime -> Rise;
525 }
526 else{
527 //use the default
528 p->tReqDef.Rise = fUseZeroDefaultOutputRequired ? 0 : ABC_INFINITY;
529 p->tReqDef.Fall = fUseZeroDefaultOutputRequired ? 0 : ABC_INFINITY;
530 }
531 Abc_NtkTimeSetRequired( pNtk, Abc_ObjId(pObj), p->tReqDef.Rise, p->tReqDef.Rise );
532 }
533 return p;
534}
535
548{
549 if ( p->tInDrive )
550 ABC_FREE( p->tInDrive );
551 if ( p->tOutLoad )
552 ABC_FREE( p->tOutLoad );
553 if ( Vec_PtrSize(p->vArrs) > 0 )
554 ABC_FREE( p->vArrs->pArray[0] );
555 Vec_PtrFree( p->vArrs );
556 if ( Vec_PtrSize(p->vReqs) > 0 )
557 ABC_FREE( p->vReqs->pArray[0] );
558 Vec_PtrFree( p->vReqs );
559 ABC_FREE( p );
560}
561
573void Abc_ManTimeDup( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew )
574{
575 extern void Abc_NtkTimePrint( Abc_Ntk_t * pNtk );
576
577 Abc_Obj_t * pObj;
578 Abc_Time_t ** ppTimesOld, ** ppTimesNew;
579 int i;
580 if ( pNtkOld->pManTime == NULL )
581 return;
582 assert( Abc_NtkCiNum(pNtkOld) == Abc_NtkCiNum(pNtkNew) );
583 assert( Abc_NtkCoNum(pNtkOld) == Abc_NtkCoNum(pNtkNew) );
584 assert( Abc_NtkLatchNum(pNtkOld) == Abc_NtkLatchNum(pNtkNew) );
585 // create the new timing manager
586 pNtkNew->pManTime = Abc_ManTimeStart(pNtkNew);
587 Abc_ManTimeExpand( pNtkNew->pManTime, Abc_NtkObjNumMax(pNtkNew), 0 );
588 // set the default timing
589 pNtkNew->pManTime->tArrDef = pNtkOld->pManTime->tArrDef;
590 pNtkNew->pManTime->tReqDef = pNtkOld->pManTime->tReqDef;
591 // set the CI timing
592 ppTimesOld = (Abc_Time_t **)pNtkOld->pManTime->vArrs->pArray;
593 ppTimesNew = (Abc_Time_t **)pNtkNew->pManTime->vArrs->pArray;
594 Abc_NtkForEachCi( pNtkOld, pObj, i )
595 *ppTimesNew[ Abc_NtkCi(pNtkNew,i)->Id ] = *ppTimesOld[ pObj->Id ];
596 // set the CO timing
597 ppTimesOld = (Abc_Time_t **)pNtkOld->pManTime->vReqs->pArray;
598 ppTimesNew = (Abc_Time_t **)pNtkNew->pManTime->vReqs->pArray;
599 Abc_NtkForEachCo( pNtkOld, pObj, i )
600 *ppTimesNew[ Abc_NtkCo(pNtkNew,i)->Id ] = *ppTimesOld[ pObj->Id ];
601 // duplicate input drive
602 pNtkNew->pManTime->tInDriveDef = pNtkOld->pManTime->tInDriveDef;
603 pNtkNew->pManTime->tOutLoadDef = pNtkOld->pManTime->tOutLoadDef;
604 if ( pNtkOld->pManTime->tInDrive )
605 {
606 pNtkNew->pManTime->tInDrive = ABC_ALLOC( Abc_Time_t, Abc_NtkCiNum(pNtkOld) );
607 memcpy( pNtkNew->pManTime->tInDrive, pNtkOld->pManTime->tInDrive, sizeof(Abc_Time_t) * Abc_NtkCiNum(pNtkOld) );
608 }
609 if ( pNtkOld->pManTime->tOutLoad )
610 {
611 pNtkNew->pManTime->tOutLoad = ABC_ALLOC( Abc_Time_t, Abc_NtkCoNum(pNtkOld) );
612 memcpy( pNtkNew->pManTime->tOutLoad, pNtkOld->pManTime->tOutLoad, sizeof(Abc_Time_t) * Abc_NtkCoNum(pNtkOld) );
613 }
614
615
616}
617
630{
631 if ( pNtk->pManTime == NULL )
632 printf( "There is no timing manager\n" );
633 else
634 {
635 Abc_Obj_t * pObj; int i;
636 printf( "Default arrival = %8f\n", pNtk->pManTime->tArrDef.Fall );
637 printf( "Default required = %8f\n", pNtk->pManTime->tReqDef.Fall );
638 printf( "Inputs (%d):\n", Abc_NtkCiNum(pNtk) );
639 Abc_NtkForEachCi( pNtk, pObj, i )
640 printf( "%20s arrival = %8f required = %8f\n",
641 Abc_ObjName(pObj),
644 printf( "Outputs (%d):\n", Abc_NtkCoNum(pNtk) );
645 Abc_NtkForEachCo( pNtk, pObj, i )
646 printf( "%20s arrival = %8f required = %8f\n",
647 Abc_ObjName(pObj),
650 }
651}
652
664void Abc_ManTimeExpand( Abc_ManTime_t * p, int nSize, int fProgressive )
665{
666 Vec_Ptr_t * vTimes;
667 Abc_Time_t * ppTimes, * ppTimesOld, * pTime;
668 int nSizeOld, nSizeNew, i;
669
670 nSizeOld = p->vArrs->nSize;
671 if ( nSizeOld >= nSize )
672 return;
673 nSizeNew = fProgressive? 2 * nSize : nSize;
674 if ( nSizeNew < 100 )
675 nSizeNew = 100;
676
677 vTimes = p->vArrs;
678 Vec_PtrGrow( vTimes, nSizeNew );
679 vTimes->nSize = nSizeNew;
680 ppTimesOld = ( nSizeOld == 0 )? NULL : (Abc_Time_t *)vTimes->pArray[0];
681 ppTimes = ABC_REALLOC( Abc_Time_t, ppTimesOld, nSizeNew );
682 for ( i = 0; i < nSizeNew; i++ )
683 vTimes->pArray[i] = ppTimes + i;
684 for ( i = nSizeOld; i < nSizeNew; i++ )
685 {
686 pTime = (Abc_Time_t *)vTimes->pArray[i];
687 pTime->Rise = -ABC_INFINITY;
688 pTime->Fall = -ABC_INFINITY;
689 }
690
691 vTimes = p->vReqs;
692 Vec_PtrGrow( vTimes, nSizeNew );
693 vTimes->nSize = nSizeNew;
694 ppTimesOld = ( nSizeOld == 0 )? NULL : (Abc_Time_t *)vTimes->pArray[0];
695 ppTimes = ABC_REALLOC( Abc_Time_t, ppTimesOld, nSizeNew );
696 for ( i = 0; i < nSizeNew; i++ )
697 vTimes->pArray[i] = ppTimes + i;
698 for ( i = nSizeOld; i < nSizeNew; i++ )
699 {
700 pTime = (Abc_Time_t *)vTimes->pArray[i];
701 pTime->Rise = ABC_INFINITY;
702 pTime->Fall = ABC_INFINITY;
703 }
704}
705
706
707
708
709
710
723{
724 Abc_Obj_t * pNodeOld, * pNodeNew;
725 float tAndDelay;
726 int i;
727 if ( pNtkOld->pManTime == NULL )
728 return;
730 return;
732 Abc_NtkForEachCi( pNtkOld, pNodeOld, i )
733 {
734 pNodeNew = pNodeOld->pCopy;
735 pNodeNew->Level = (int)(Abc_NodeReadArrivalWorst(pNodeOld) / tAndDelay);
736 }
737}
738
751{
752 Abc_Time_t * p;
753 Abc_Obj_t * pNode;
754 int i;
755 p = ABC_CALLOC( Abc_Time_t, Abc_NtkCiNum(pNtk) );
756 if ( pNtk->pManTime == NULL )
757 return p;
758 // set the PI arrival times
759 Abc_NtkForEachCi( pNtk, pNode, i )
760 p[i] = *Abc_NodeArrival(pNode);
761 return p;
762}
764{
765 Abc_Time_t * p;
766 Abc_Obj_t * pNode;
767 int i;
768 p = ABC_CALLOC( Abc_Time_t, Abc_NtkCoNum(pNtk) );
769 if ( pNtk->pManTime == NULL )
770 return p;
771 // set the PO required times
772 Abc_NtkForEachCo( pNtk, pNode, i )
773 p[i] = *Abc_NodeRequired(pNode);
774 return p;
775}
776
777
790{
791 float * p;
792 Abc_Obj_t * pNode;
793 int i;
794 p = ABC_CALLOC( float, Abc_NtkCiNum(pNtk) );
795 if ( pNtk->pManTime == NULL )
796 return p;
797 // set the PI arrival times
798 Abc_NtkForEachCi( pNtk, pNode, i )
799 p[i] = Abc_NodeReadArrivalWorst(pNode);
800 return p;
801}
803{
804 float * p;
805 Abc_Obj_t * pNode;
806 int i;
807 if ( pNtk->pManTime == NULL )
808 return NULL;
809 // set the PO required times
810 p = ABC_CALLOC( float, Abc_NtkCoNum(pNtk) );
811 Abc_NtkForEachCo( pNtk, pNode, i )
812 p[i] = Abc_NodeReadRequiredWorst(pNode);
813 return p;
814}
815
816
829{
830 Vec_Int_t * vSlacks;
831 Abc_Obj_t * pObj;
832 int i, k;
833 vSlacks = Vec_IntAlloc( Abc_NtkObjNumMax(pNtk) + Abc_NtkGetTotalFanins(pNtk) );
834 Vec_IntFill( vSlacks, Abc_NtkObjNumMax(pNtk), -1 );
835 Abc_NtkForEachNode( pNtk, pObj, i )
836 {
837 Vec_IntWriteEntry( vSlacks, i, Vec_IntSize(vSlacks) );
838 for ( k = 0; k < Abc_ObjFaninNum(pObj); k++ )
839 Vec_IntPush( vSlacks, -1 );
840 }
841// assert( Abc_MaxInt(16, Vec_IntSize(vSlacks)) == Vec_IntCap(vSlacks) );
842 return vSlacks;
843}
844
856static inline float Abc_NtkDelayTraceSlack( Vec_Int_t * vSlacks, Abc_Obj_t * pObj, int iFanin )
857{
858 return Abc_Int2Float( Vec_IntEntry( vSlacks, Vec_IntEntry(vSlacks, Abc_ObjId(pObj)) + iFanin ) );
859}
860static inline void Abc_NtkDelayTraceSetSlack( Vec_Int_t * vSlacks, Abc_Obj_t * pObj, int iFanin, float Num )
861{
862 Vec_IntWriteEntry( vSlacks, Vec_IntEntry(vSlacks, Abc_ObjId(pObj)) + iFanin, Abc_Float2Int(Num) );
863}
864
876int Abc_NtkDelayTraceCritPath_rec( Vec_Int_t * vSlacks, Abc_Obj_t * pNode, Abc_Obj_t * pLeaf, Vec_Int_t * vBest )
877{
878 Abc_Obj_t * pFanin, * pFaninBest = NULL;
879 float SlackMin = ABC_INFINITY; int i;
880 // check primary inputs
881 if ( Abc_ObjIsCi(pNode) )
882 return (pLeaf == NULL || pLeaf == pNode);
883 assert( Abc_ObjIsNode(pNode) );
884 // check visited
885 if ( Abc_NodeIsTravIdCurrent( pNode ) )
886 return Vec_IntEntry(vBest, Abc_ObjId(pNode)) >= 0;
887 Abc_NodeSetTravIdCurrent( pNode );
888 // check the node
889 assert( Abc_ObjIsNode(pNode) );
890 Abc_ObjForEachFanin( pNode, pFanin, i )
891 {
892 if ( !Abc_NtkDelayTraceCritPath_rec( vSlacks, pFanin, pLeaf, vBest ) )
893 continue;
894 if ( pFaninBest == NULL || SlackMin > Abc_NtkDelayTraceSlack(vSlacks, pNode, i) )
895 {
896 pFaninBest = pFanin;
897 SlackMin = Abc_NtkDelayTraceSlack(vSlacks, pNode, i);
898 }
899 }
900 if ( pFaninBest != NULL )
901 Vec_IntWriteEntry( vBest, Abc_ObjId(pNode), Abc_NodeFindFanin(pNode, pFaninBest) );
902 return (pFaninBest != NULL);
903}
904
917{
918 assert( Abc_ObjIsCi(pNode) || Abc_ObjIsNode(pNode) );
919 if ( Abc_ObjIsNode(pNode) )
920 {
921 int iFanin = Vec_IntEntry( vBest, Abc_ObjId(pNode) );
922 assert( iFanin >= 0 );
923 Abc_NtkDelayTraceCritPathCollect_rec( vSlacks, Abc_ObjFanin(pNode, iFanin), vBest, vPath );
924 }
925 Vec_PtrPush( vPath, pNode );
926}
927
940{
941 Abc_Obj_t * pFanin;
942 Abc_Time_t * pTimeIn, * pTimeOut;
943 float tDelayBlockRise, tDelayBlockFall;
944 Mio_PinPhase_t PinPhase;
945 Mio_Pin_t * pPin;
946 int i;
947
948 // start the arrival time of the node
949 pTimeOut = Abc_NodeArrival(pNode);
950 pTimeOut->Rise = pTimeOut->Fall = -ABC_INFINITY;
951 // consider the buffer
952 if ( Abc_ObjIsBarBuf(pNode) )
953 {
954 pTimeIn = Abc_NodeArrival(Abc_ObjFanin0(pNode));
955 *pTimeOut = *pTimeIn;
956 return;
957 }
958 // go through the pins of the gate
959 pPin = Mio_GateReadPins((Mio_Gate_t *)pNode->pData);
960 Abc_ObjForEachFanin( pNode, pFanin, i )
961 {
962 pTimeIn = Abc_NodeArrival(pFanin);
963 // get the interesting parameters of this pin
964 PinPhase = Mio_PinReadPhase(pPin);
965 tDelayBlockRise = (float)Mio_PinReadDelayBlockRise( pPin );
966 tDelayBlockFall = (float)Mio_PinReadDelayBlockFall( pPin );
967 // compute the arrival times of the positive phase
968 if ( PinPhase != MIO_PHASE_INV ) // NONINV phase is present
969 {
970 if ( pTimeOut->Rise < pTimeIn->Rise + tDelayBlockRise )
971 pTimeOut->Rise = pTimeIn->Rise + tDelayBlockRise;
972 if ( pTimeOut->Fall < pTimeIn->Fall + tDelayBlockFall )
973 pTimeOut->Fall = pTimeIn->Fall + tDelayBlockFall;
974 }
975 if ( PinPhase != MIO_PHASE_NONINV ) // INV phase is present
976 {
977 if ( pTimeOut->Rise < pTimeIn->Fall + tDelayBlockRise )
978 pTimeOut->Rise = pTimeIn->Fall + tDelayBlockRise;
979 if ( pTimeOut->Fall < pTimeIn->Rise + tDelayBlockFall )
980 pTimeOut->Fall = pTimeIn->Rise + tDelayBlockFall;
981 }
982 pPin = Mio_PinReadNext(pPin);
983 }
984
985 // compute edge slacks
986 if ( vSlacks )
987 {
988 float Slack;
989 // go through the pins of the gate
990 pPin = Mio_GateReadPins((Mio_Gate_t *)pNode->pData);
991 Abc_ObjForEachFanin( pNode, pFanin, i )
992 {
993 pTimeIn = Abc_NodeArrival(pFanin);
994 // get the interesting parameters of this pin
995 PinPhase = Mio_PinReadPhase(pPin);
996 tDelayBlockRise = (float)Mio_PinReadDelayBlockRise( pPin );
997 tDelayBlockFall = (float)Mio_PinReadDelayBlockFall( pPin );
998 // compute the arrival times of the positive phase
999 Slack = ABC_INFINITY;
1000 if ( PinPhase != MIO_PHASE_INV ) // NONINV phase is present
1001 {
1002 Slack = Abc_MinFloat( Slack, Abc_AbsFloat(pTimeIn->Rise + tDelayBlockRise - pTimeOut->Rise) );
1003 Slack = Abc_MinFloat( Slack, Abc_AbsFloat(pTimeIn->Fall + tDelayBlockFall - pTimeOut->Fall) );
1004 }
1005 if ( PinPhase != MIO_PHASE_NONINV ) // INV phase is present
1006 {
1007 Slack = Abc_MinFloat( Slack, Abc_AbsFloat(pTimeIn->Fall + tDelayBlockRise - pTimeOut->Rise) );
1008 Slack = Abc_MinFloat( Slack, Abc_AbsFloat(pTimeIn->Rise + tDelayBlockFall - pTimeOut->Fall) );
1009 }
1010 pPin = Mio_PinReadNext(pPin);
1011 Abc_NtkDelayTraceSetSlack( vSlacks, pNode, i, Slack );
1012 }
1013 }
1014}
1015
1016
1031float Abc_NtkDelayTrace( Abc_Ntk_t * pNtk, Abc_Obj_t * pOut, Abc_Obj_t * pIn, int fPrint )
1032{
1033 Vec_Int_t * vSlacks = NULL;
1034 Abc_Obj_t * pNode, * pDriver;
1035 Vec_Ptr_t * vNodes;
1036 Abc_Time_t * pTime;
1037 float tArrivalMax;
1038 int i;
1039
1040 assert( Abc_NtkIsMappedLogic(pNtk) );
1041 assert( pOut == NULL || Abc_ObjIsCo(pOut) );
1042 assert( pIn == NULL || Abc_ObjIsCi(pIn) );
1043
1044 // create slacks (need slacks if printing is requested even if pIn/pOut are not given)
1045 if ( pOut || pIn || fPrint )
1046 vSlacks = Abc_NtkDelayTraceSlackStart( pNtk );
1047
1048 // compute the timing
1049 Abc_NtkTimePrepare( pNtk );
1050 vNodes = Abc_NtkDfs( pNtk, 1 );
1051 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1052 Abc_NodeDelayTraceArrival( pNode, vSlacks );
1053 Vec_PtrFree( vNodes );
1054
1055 // get the latest arrival times
1056 tArrivalMax = -ABC_INFINITY;
1057 Abc_NtkForEachCo( pNtk, pNode, i )
1058 {
1059 pDriver = Abc_ObjFanin0(pNode);
1060 pTime = Abc_NodeArrival(pDriver);
1061 if ( tArrivalMax < Abc_MaxFloat(pTime->Fall, pTime->Rise) )
1062 tArrivalMax = Abc_MaxFloat(pTime->Fall, pTime->Rise);
1063 }
1064
1065 // determine the output to print
1066 if ( fPrint && pOut == NULL )
1067 {
1068 Abc_NtkForEachCo( pNtk, pNode, i )
1069 {
1070 pDriver = Abc_ObjFanin0(pNode);
1071 pTime = Abc_NodeArrival(pDriver);
1072 if ( tArrivalMax == Abc_MaxFloat(pTime->Fall, pTime->Rise) )
1073 pOut = pNode;
1074 }
1075 assert( pOut != NULL );
1076 }
1077
1078 if ( fPrint )
1079 {
1080 Vec_Ptr_t * vPath = Vec_PtrAlloc( 100 );
1081 Vec_Int_t * vBest = Vec_IntStartFull( Abc_NtkObjNumMax(pNtk) );
1082 // traverse to determine the critical path
1083 Abc_NtkIncrementTravId( pNtk );
1084 if ( !Abc_NtkDelayTraceCritPath_rec( vSlacks, Abc_ObjFanin0(pOut), pIn, vBest ) )
1085 {
1086 if ( pIn == NULL )
1087 printf( "The logic cone of PO \"%s\" has no primary inputs.\n", Abc_ObjName(pOut) );
1088 else
1089 printf( "There is no combinational path between PI \"%s\" and PO \"%s\".\n", Abc_ObjName(pIn), Abc_ObjName(pOut) );
1090 }
1091 else
1092 {
1093 float Slack = 0.0, SlackAdd;
1094 int k, iFanin, Length = 0;
1095 Abc_Obj_t * pFanin;
1096 // check the additional slack
1097 SlackAdd = Abc_NodeReadRequiredWorst(pOut) - Abc_NodeReadArrivalWorst(Abc_ObjFanin0(pOut));
1098 // collect the critical path
1099 Abc_NtkDelayTraceCritPathCollect_rec( vSlacks, Abc_ObjFanin0(pOut), vBest, vPath );
1100 if ( pIn == NULL )
1101 pIn = (Abc_Obj_t *)Vec_PtrEntry( vPath, 0 );
1102 // find the longest gate name
1103 Vec_PtrForEachEntry( Abc_Obj_t *, vPath, pNode, i )
1104 if ( Abc_ObjIsNode(pNode) )
1105 Length = Abc_MaxInt( Length, strlen(Mio_GateReadName((Mio_Gate_t *)pNode->pData)) );
1106 // print critical path
1107 Abc_NtkLevel( pNtk );
1108 printf( "Critical path from PI \"%s\" to PO \"%s\":\n", Abc_ObjName(pIn), Abc_ObjName(pOut) );
1109 Vec_PtrForEachEntry( Abc_Obj_t *, vPath, pNode, i )
1110 {
1111 printf( "Level %3d : ", Abc_ObjLevel(pNode) );
1112 if ( Abc_ObjIsCi(pNode) )
1113 {
1114 printf( "Primary input \"%s\". ", Abc_ObjName(pNode) );
1115 printf( "Arrival time =%6.1f. ", Abc_NodeReadArrivalWorst(pNode) );
1116 printf( "\n" );
1117 continue;
1118 }
1119 if ( Abc_ObjIsCo(pNode) )
1120 {
1121 printf( "Primary output \"%s\". ", Abc_ObjName(pNode) );
1122 printf( "Arrival =%6.1f. ", Abc_NodeReadArrivalWorst(pNode) );
1123 }
1124 else
1125 {
1126 assert( Abc_ObjIsNode(pNode) );
1127 iFanin = Abc_NodeFindFanin( pNode, (Abc_Obj_t *)Vec_PtrEntry(vPath,i-1) );
1128 Slack = Abc_NtkDelayTraceSlack(vSlacks, pNode, iFanin);
1129 printf( "%10s/", Abc_ObjName(pNode) );
1130 printf( "%-4s", Mio_GateReadPinName((Mio_Gate_t *)pNode->pData, iFanin) );
1131 printf( " (%s)", Mio_GateReadName((Mio_Gate_t *)pNode->pData) );
1132 for ( k = strlen(Mio_GateReadName((Mio_Gate_t *)pNode->pData)); k < Length; k++ )
1133 printf( " " );
1134 printf( " " );
1135 printf( "Arrival =%6.1f. ", Abc_NodeReadArrivalWorst(pNode) );
1136 printf( "I/O times: (" );
1137 Abc_ObjForEachFanin( pNode, pFanin, k )
1138 printf( "%s%.1f", (k? ", ":""), Abc_NodeReadArrivalWorst(pFanin) );
1139// printf( " -> %.1f)", Abc_NodeReadArrival(pNode)->Worst + Slack + SlackAdd );
1140 printf( " -> %.1f)", Abc_NodeReadArrivalWorst(pNode) );
1141 }
1142 printf( "\n" );
1143 }
1144 printf( "Level %3d : ", Abc_ObjLevel(Abc_ObjFanin0(pOut)) + 1 );
1145 printf( "Primary output \"%s\". ", Abc_ObjName(pOut) );
1146 printf( "Required time = %6.1f. ", Abc_NodeReadRequiredWorst(pOut) );
1147 printf( "Path slack = %6.1f.\n", SlackAdd );
1148 }
1149 Vec_PtrFree( vPath );
1150 Vec_IntFree( vBest );
1151 }
1152
1153 Vec_IntFreeP( &vSlacks );
1154 return tArrivalMax;
1155}
1156
1157
1158
1171{
1172 Abc_Obj_t * pFanin;
1173 int i, Level = 0;
1174 Abc_ObjForEachFanin( pObj, pFanin, i )
1175 Level = Abc_MaxFloat( Level, Abc_ObjLevel(pFanin) );
1176 return Level + (int)(Abc_ObjFaninNum(pObj) > 0);
1177}
1178
1191{
1192 Abc_Obj_t * pFanout;
1193 int i, LevelCur, Level = 0;
1194 Abc_ObjForEachFanout( pObj, pFanout, i )
1195 {
1196 LevelCur = Abc_ObjReverseLevel( pFanout );
1197 Level = Abc_MaxFloat( Level, LevelCur );
1198 }
1199 return Level + 1;
1200}
1201
1215{
1216 Abc_Ntk_t * pNtk = pObj->pNtk;
1217 assert( pNtk->vLevelsR );
1218 return pNtk->LevelMax + 1 - Abc_ObjReverseLevel(pObj);
1219}
1220
1234{
1235 Abc_Ntk_t * pNtk = pObj->pNtk;
1236 assert( pNtk->vLevelsR );
1237 Vec_IntFillExtra( pNtk->vLevelsR, pObj->Id + 1, 0 );
1238 return Vec_IntEntry(pNtk->vLevelsR, pObj->Id);
1239}
1240
1253void Abc_ObjSetReverseLevel( Abc_Obj_t * pObj, int LevelR )
1254{
1255 Abc_Ntk_t * pNtk = pObj->pNtk;
1256 assert( pNtk->vLevelsR );
1257 Vec_IntFillExtra( pNtk->vLevelsR, pObj->Id + 1, 0 );
1258 Vec_IntWriteEntry( pNtk->vLevelsR, pObj->Id, LevelR );
1259}
1260
1274void Abc_NtkStartReverseLevels( Abc_Ntk_t * pNtk, int nMaxLevelIncrease )
1275{
1276 Vec_Ptr_t * vNodes;
1277 Abc_Obj_t * pObj;
1278 int i;
1279 // remember the maximum number of direct levels
1280 pNtk->LevelMax = Abc_NtkLevel(pNtk) + nMaxLevelIncrease;
1281 // start the reverse levels
1282 pNtk->vLevelsR = Vec_IntAlloc( 0 );
1283 Vec_IntFill( pNtk->vLevelsR, 1 + Abc_NtkObjNumMax(pNtk), 0 );
1284 // compute levels in reverse topological order
1285 vNodes = Abc_NtkDfsReverse( pNtk );
1286 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
1288 Vec_PtrFree( vNodes );
1289}
1290
1303{
1304 assert( pNtk->vLevelsR );
1305 Vec_IntFree( pNtk->vLevelsR );
1306 pNtk->vLevelsR = NULL;
1307 pNtk->LevelMax = 0;
1308
1309}
1310
1322void Abc_NtkUpdateLevel( Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels )
1323{
1324 Abc_Obj_t * pFanout, * pTemp;
1325 int LevelOld, Lev, k, m;
1326// int Counter = 0, CounterMax = 0;
1327 // check if level has changed
1328 LevelOld = Abc_ObjLevel(pObjNew);
1329 if ( LevelOld == Abc_ObjLevelNew(pObjNew) )
1330 return;
1331 // start the data structure for level update
1332 // we cannot fail to visit a node when using this structure because the
1333 // nodes are stored by their _old_ levels, which are assumed to be correct
1334 Vec_VecClear( vLevels );
1335 Vec_VecPush( vLevels, LevelOld, pObjNew );
1336 pObjNew->fMarkA = 1;
1337 // recursively update level
1338 Vec_VecForEachEntryStart( Abc_Obj_t *, vLevels, pTemp, Lev, k, LevelOld )
1339 {
1340// Counter--;
1341 pTemp->fMarkA = 0;
1342 assert( Abc_ObjLevel(pTemp) == Lev );
1343 Abc_ObjSetLevel( pTemp, Abc_ObjLevelNew(pTemp) );
1344 // if the level did not change, no need to check the fanout levels
1345 if ( Abc_ObjLevel(pTemp) == Lev )
1346 continue;
1347 // schedule fanout for level update
1348 Abc_ObjForEachFanout( pTemp, pFanout, m )
1349 {
1350 if ( !Abc_ObjIsCo(pFanout) && !pFanout->fMarkA )
1351 {
1352 assert( Abc_ObjLevel(pFanout) >= Lev );
1353 Vec_VecPush( vLevels, Abc_ObjLevel(pFanout), pFanout );
1354// Counter++;
1355// CounterMax = Abc_MaxFloat( CounterMax, Counter );
1356 pFanout->fMarkA = 1;
1357 }
1358 }
1359 }
1360// printf( "%d ", CounterMax );
1361}
1362
1375{
1376 Abc_Obj_t * pFanin, * pTemp;
1377 int LevelOld, LevFanin, Lev, k, m;
1378 // check if level has changed
1379 LevelOld = Abc_ObjReverseLevel(pObjNew);
1380 if ( LevelOld == Abc_ObjReverseLevelNew(pObjNew) )
1381 return;
1382 // start the data structure for level update
1383 // we cannot fail to visit a node when using this structure because the
1384 // nodes are stored by their _old_ levels, which are assumed to be correct
1385 Vec_VecClear( vLevels );
1386 Vec_VecPush( vLevels, LevelOld, pObjNew );
1387 pObjNew->fMarkA = 1;
1388 // recursively update level
1389 Vec_VecForEachEntryStart( Abc_Obj_t *, vLevels, pTemp, Lev, k, LevelOld )
1390 {
1391 pTemp->fMarkA = 0;
1392 LevelOld = Abc_ObjReverseLevel(pTemp);
1393 assert( LevelOld == Lev );
1395 // if the level did not change, no need to check the fanout levels
1396 if ( Abc_ObjReverseLevel(pTemp) == Lev )
1397 continue;
1398 // schedule fanins for level update
1399 Abc_ObjForEachFanin( pTemp, pFanin, m )
1400 {
1401 if ( !Abc_ObjIsCi(pFanin) && !pFanin->fMarkA )
1402 {
1403 LevFanin = Abc_ObjReverseLevel( pFanin );
1404 assert( LevFanin >= Lev );
1405 Vec_VecPush( vLevels, LevFanin, pFanin );
1406 pFanin->fMarkA = 1;
1407 }
1408 }
1409 }
1410}
1411
1423void Abc_NtkUpdate( Abc_Obj_t * pObj, Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels )
1424{
1425 // replace the old node by the new node
1426 pObjNew->Level = pObj->Level;
1427 Abc_ObjReplace( pObj, pObjNew );
1428 // update the level of the node
1429 Abc_NtkUpdateLevel( pObjNew, vLevels );
1430 Abc_ObjSetReverseLevel( pObjNew, 0 );
1431 Abc_NtkUpdateReverseLevel( pObjNew, vLevels );
1432}
1433
1437
1438
1440
void Abc_NtkTimeSetDefaultRequired(Abc_Ntk_t *pNtk, float Rise, float Fall)
Definition abcTiming.c:184
float Abc_NodeReadArrivalWorst(Abc_Obj_t *pNode)
Definition abcTiming.c:111
Abc_Time_t * Abc_NtkReadDefaultRequired(Abc_Ntk_t *pNtk)
Definition abcTiming.c:80
void Abc_NtkTimePrint(Abc_Ntk_t *pNtk)
Definition abcTiming.c:629
void Abc_ManTimeStop(Abc_ManTime_t *p)
Definition abcTiming.c:547
Abc_Time_t * Abc_NtkReadDefaultInputDrive(Abc_Ntk_t *pNtk)
Definition abcTiming.c:131
#define TOLERANCE
Definition abcTiming.c:48
void Abc_NtkTimeSetDefaultArrival(Abc_Ntk_t *pNtk, float Rise, float Fall)
Definition abcTiming.c:173
void Abc_NtkDelayTraceCritPathCollect_rec(Vec_Int_t *vSlacks, Abc_Obj_t *pNode, Vec_Int_t *vBest, Vec_Ptr_t *vPath)
Definition abcTiming.c:916
void Abc_NtkTimeSetRequired(Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
Definition abcTiming.c:224
void Abc_NtkUpdate(Abc_Obj_t *pObj, Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
Definition abcTiming.c:1423
int Abc_ObjRequiredLevel(Abc_Obj_t *pObj)
Definition abcTiming.c:1214
void Abc_ObjSetReverseLevel(Abc_Obj_t *pObj, int LevelR)
Definition abcTiming.c:1253
void Abc_NtkTimeSetDefaultInputDrive(Abc_Ntk_t *pNtk, float Rise, float Fall)
Definition abcTiming.c:249
Vec_Int_t * Abc_NtkDelayTraceSlackStart(Abc_Ntk_t *pNtk)
Definition abcTiming.c:828
int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition abcTiming.c:1170
float Abc_NodeReadOutputLoadWorst(Abc_Ntk_t *pNtk, int iPo)
Definition abcTiming.c:155
void Abc_NtkSetNodeLevelsArrival(Abc_Ntk_t *pNtkOld)
Definition abcTiming.c:722
float * Abc_NtkGetCoRequiredFloats(Abc_Ntk_t *pNtk)
Definition abcTiming.c:802
void Abc_NtkUpdateLevel(Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
Definition abcTiming.c:1322
int Abc_NtkDelayTraceCritPath_rec(Vec_Int_t *vSlacks, Abc_Obj_t *pNode, Abc_Obj_t *pLeaf, Vec_Int_t *vBest)
Definition abcTiming.c:876
float Abc_NodeReadArrivalAve(Abc_Obj_t *pNode)
Definition abcTiming.c:103
void Abc_ManTimeDup(Abc_Ntk_t *pNtkOld, Abc_Ntk_t *pNtkNew)
Definition abcTiming.c:573
float * Abc_NtkGetCiArrivalFloats(Abc_Ntk_t *pNtk)
Definition abcTiming.c:789
void Abc_NtkTimeSetInputDrive(Abc_Ntk_t *pNtk, int PiNum, float Rise, float Fall)
Definition abcTiming.c:293
int Abc_ObjReverseLevel(Abc_Obj_t *pObj)
Definition abcTiming.c:1233
float Abc_NtkReadDefaultRequiredWorst(Abc_Ntk_t *pNtk)
Definition abcTiming.c:99
Abc_Time_t * Abc_NodeReadArrival(Abc_Obj_t *pNode)
Definition abcTiming.c:85
void Abc_NtkTimeSetOutputLoad(Abc_Ntk_t *pNtk, int PoNum, float Rise, float Fall)
Definition abcTiming.c:312
void Abc_NtkTimePrepare(Abc_Ntk_t *pNtk)
Definition abcTiming.c:424
float Abc_NodeReadInputDriveWorst(Abc_Ntk_t *pNtk, int iPi)
Definition abcTiming.c:151
void Abc_NtkUpdateReverseLevel(Abc_Obj_t *pObjNew, Vec_Vec_t *vLevels)
Definition abcTiming.c:1374
int Abc_ObjReverseLevelNew(Abc_Obj_t *pObj)
Definition abcTiming.c:1190
Abc_Time_t * Abc_NodeReadRequired(Abc_Obj_t *pNode)
Definition abcTiming.c:90
Abc_Time_t * Abc_NodeReadInputDrive(Abc_Ntk_t *pNtk, int iPi)
Definition abcTiming.c:141
Abc_Time_t * Abc_NodeReadOutputLoad(Abc_Ntk_t *pNtk, int iPo)
Definition abcTiming.c:146
Abc_Time_t * Abc_NtkReadDefaultArrival(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcTiming.c:75
float Abc_NtkDelayTrace(Abc_Ntk_t *pNtk, Abc_Obj_t *pOut, Abc_Obj_t *pIn, int fPrint)
Definition abcTiming.c:1031
float Abc_NtkReadDefaultArrivalWorst(Abc_Ntk_t *pNtk)
Definition abcTiming.c:95
void Abc_NtkTimeInitialize(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkOld)
Definition abcTiming.c:343
void Abc_NodeDelayTraceArrival(Abc_Obj_t *pNode, Vec_Int_t *vSlacks)
Definition abcTiming.c:939
Abc_Time_t * Abc_NtkGetCoRequiredTimes(Abc_Ntk_t *pNtk)
Definition abcTiming.c:763
void Abc_NtkTimeScale(Abc_Ntk_t *pNtk, float Scale)
Definition abcTiming.c:382
void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
Definition abcTiming.c:1302
float Abc_NodeReadRequiredWorst(Abc_Obj_t *pNode)
Definition abcTiming.c:115
void Abc_NtkTimeSetArrival(Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
Definition abcTiming.c:208
Abc_Time_t * Abc_NtkGetCiArrivalTimes(Abc_Ntk_t *pNtk)
Definition abcTiming.c:750
float Abc_NodeReadRequiredAve(Abc_Obj_t *pNode)
Definition abcTiming.c:107
Abc_Time_t * Abc_NtkReadDefaultOutputLoad(Abc_Ntk_t *pNtk)
Definition abcTiming.c:136
void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
Definition abcTiming.c:1274
void Abc_NtkTimeSetDefaultOutputLoad(Abc_Ntk_t *pNtk, float Rise, float Fall)
Definition abcTiming.c:265
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
struct Abc_ManTime_t_ Abc_ManTime_t
Definition abc.h:118
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition abc.h:529
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition abcNames.c:49
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL void Abc_ObjReplace(Abc_Obj_t *pObjOld, Abc_Obj_t *pObjNew)
Definition abcFanio.c:325
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1449
struct Abc_Time_t_ Abc_Time_t
Definition abc.h:120
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_DLL Vec_Ptr_t * Abc_NtkDfsReverse(Abc_Ntk_t *pNtk)
Definition abcDfs.c:221
ABC_DLL int Abc_NtkGetTotalFanins(Abc_Ntk_t *pNtk)
Definition abcUtil.c:520
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition abcUtil.c:791
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
Mio_Pin_t * Mio_GateReadPins(Mio_Gate_t *pGate)
Definition mioApi.c:173
double Mio_PinReadDelayBlockFall(Mio_Pin_t *pPin)
Definition mioApi.c:214
Mio_PinPhase_t
INCLUDES ///.
Definition mio.h:40
@ MIO_PHASE_INV
Definition mio.h:40
@ MIO_PHASE_NONINV
Definition mio.h:40
float Mio_LibraryReadDelayNand2Max(Mio_Library_t *pLib)
Definition mioApi.c:62
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
Mio_PinPhase_t Mio_PinReadPhase(Mio_Pin_t *pPin)
Definition mioApi.c:209
char * Mio_GateReadPinName(Mio_Gate_t *pGate, int iPin)
Definition mioApi.c:230
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition mioApi.c:169
Mio_Gate_t * Mio_LibraryReadNand2(Mio_Library_t *pLib)
Definition mioApi.c:53
Mio_Pin_t * Mio_PinReadNext(Mio_Pin_t *pPin)
Definition mioApi.c:217
struct Mio_PinStruct_t_ Mio_Pin_t
Definition mio.h:44
double Mio_PinReadDelayBlockRise(Mio_Pin_t *pPin)
Definition mioApi.c:212
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
DECLARATIONS ///.
Definition abcTiming.c:37
Vec_Ptr_t * vArrs
Definition abcTiming.c:40
Abc_Time_t * tOutLoad
Definition abcTiming.c:45
Abc_Time_t * tInDrive
Definition abcTiming.c:44
Abc_Time_t tReqDef
Definition abcTiming.c:39
Abc_Time_t tArrDef
Definition abcTiming.c:38
Abc_Time_t tInDriveDef
Definition abcTiming.c:42
Abc_Time_t tOutLoadDef
Definition abcTiming.c:43
Vec_Ptr_t * vReqs
Definition abcTiming.c:41
Vec_Int_t * vLevelsR
Definition abc.h:196
float AndGateDelay
Definition abc.h:194
Abc_ManTime_t * pManTime
Definition abc.h:192
int LevelMax
Definition abc.h:195
void * pData
Definition abc.h:145
Abc_Ntk_t * pNtk
Definition abc.h:130
int Id
Definition abc.h:132
Abc_Obj_t * pCopy
Definition abc.h:148
unsigned fMarkA
Definition abc.h:134
unsigned Level
Definition abc.h:142
float Rise
Definition abc.h:124
float Fall
Definition abc.h:125
#define assert(ex)
Definition util_old.h:213
char * memcpy()
char * memset()
int strlen()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
#define Vec_VecForEachEntryStart(Type, vGlob, pEntry, i, k, LevelStart)
Definition vecVec.h:92
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42