ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
fretTime.c File Reference
#include "fretime.h"
Include dependency graph for fretTime.c:

Go to the source code of this file.

Functions

void trace2 (Abc_Obj_t *pObj)
 
void Abc_FlowRetime_InitTiming (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
void Abc_FlowRetime_ConstrainConserv (Abc_Ntk_t *pNtk)
 
void Abc_FlowRetime_ConstrainExact (Abc_Obj_t *pObj)
 
void Abc_FlowRetime_ConstrainExact_forw_rec (Abc_Obj_t *pObj, Vec_Ptr_t *vNodes, int latch)
 
void Abc_FlowRetime_ConstrainExact_back_rec (Abc_Obj_t *pObj, Vec_Ptr_t *vNodes, int latch)
 
void Abc_FlowRetime_ConstrainExactAll (Abc_Ntk_t *pNtk)
 
void Abc_FlowRetime_FreeTiming (Abc_Ntk_t *pNtk)
 
int Abc_FlowRetime_RefineConstraints ()
 

Function Documentation

◆ Abc_FlowRetime_ConstrainConserv()

void Abc_FlowRetime_ConstrainConserv ( Abc_Ntk_t * pNtk)

Function*************************************************************

Synopsis [Marks nodes with conservative constraints.]

Description []

SideEffects []

SeeAlso []

Definition at line 90 of file fretTime.c.

90 {
91 Abc_Obj_t *pObj;
92 int i;
93 void *pArray;
94
95 // clear all exact constraints
96 pManMR->nExactConstraints = 0;
97 while( Vec_PtrSize( pManMR->vExactNodes )) {
98 pObj = (Abc_Obj_t*)Vec_PtrPop( pManMR->vExactNodes );
99
100 if ( Vec_PtrSize( FTIMEEDGES(pObj) )) {
101 pArray = Vec_PtrReleaseArray( FTIMEEDGES(pObj) );
102 ABC_FREE( pArray );
103 }
104 }
105
106#if !defined(IGNORE_TIMING)
107 if (pManMR->fIsForward) {
108 Abc_FlowRetime_ConstrainConserv_forw(pNtk);
109 } else {
110 Abc_FlowRetime_ConstrainConserv_back(pNtk);
111 }
112#endif
113
114 Abc_NtkForEachObj( pNtk, pObj, i)
115 assert( !Vec_PtrSize(FTIMEEDGES(pObj)) );
116}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449
#define ABC_FREE(obj)
Definition abc_global.h:267
MinRegMan_t * pManMR
Definition fretMain.c:52
#define FTIMEEDGES(x)
Definition fretime.h:84
#define assert(ex)
Definition util_old.h:213

◆ Abc_FlowRetime_ConstrainExact()

void Abc_FlowRetime_ConstrainExact ( Abc_Obj_t * pObj)

Function*************************************************************

Synopsis [Introduces exact timing constraints for a node.]

Description []

SideEffects []

SeeAlso []

Definition at line 407 of file fretTime.c.

407 {
408
409 if (FTEST( pObj, CONSERVATIVE )) {
410 pManMR->nConservConstraints--;
411 FUNSET( pObj, CONSERVATIVE );
412 }
413
414#if !defined(IGNORE_TIMING)
415 if (pManMR->fIsForward) {
416 Abc_FlowRetime_ConstrainExact_forw(pObj);
417 } else {
418 Abc_FlowRetime_ConstrainExact_back(pObj);
419 }
420#endif
421}
#define FUNSET(x, y)
Definition fretime.h:82
#define CONSERVATIVE
Definition fretime.h:55
#define FTEST(x, y)
Definition fretime.h:83
Here is the caller graph for this function:

◆ Abc_FlowRetime_ConstrainExact_back_rec()

void Abc_FlowRetime_ConstrainExact_back_rec ( Abc_Obj_t * pObj,
Vec_Ptr_t * vNodes,
int latch )

Definition at line 497 of file fretTime.c.

497 {
498 Abc_Obj_t *pNext;
499 int i;
500
501 // terminate?
502 if (Abc_ObjIsLatch(pObj)) {
503 if (latch) return;
504 latch = 1;
505 }
506
507 // already visited?
508 if (!latch) {
509 if (pObj->fMarkA) return;
510 pObj->fMarkA = 1;
511 } else {
512 if (pObj->fMarkB) return;
513 pObj->fMarkB = 1;
514 }
515
516 // recurse
517 Abc_ObjForEachFanout(pObj, pNext, i) {
518 Abc_FlowRetime_ConstrainExact_back_rec( pNext, vNodes, latch );
519 }
520
521 // add
522 pObj->Level = 0;
523 Vec_PtrPush(vNodes, Abc_ObjNotCond(pObj, latch));
524}
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition abc.h:529
void Abc_FlowRetime_ConstrainExact_back_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vNodes, int latch)
Definition fretTime.c:497
unsigned fMarkB
Definition abc.h:135
unsigned fMarkA
Definition abc.h:134
unsigned Level
Definition abc.h:142
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_FlowRetime_ConstrainExact_forw_rec()

void Abc_FlowRetime_ConstrainExact_forw_rec ( Abc_Obj_t * pObj,
Vec_Ptr_t * vNodes,
int latch )

Definition at line 423 of file fretTime.c.

423 {
424 Abc_Obj_t *pNext;
425 int i;
426
427 // terminate?
428 if (Abc_ObjIsLatch(pObj)) {
429 if (latch) return;
430 latch = 1;
431 }
432
433 // already visited?
434 if (!latch) {
435 if (pObj->fMarkA) return;
436 pObj->fMarkA = 1;
437 } else {
438 if (pObj->fMarkB) return;
439 pObj->fMarkB = 1;
440 }
441
442 // recurse
443 Abc_ObjForEachFanin(pObj, pNext, i) {
444 Abc_FlowRetime_ConstrainExact_forw_rec( pNext, vNodes, latch );
445 }
446
447 // add
448 pObj->Level = 0;
449 Vec_PtrPush(vNodes, Abc_ObjNotCond(pObj, latch));
450}
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
void Abc_FlowRetime_ConstrainExact_forw_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vNodes, int latch)
Definition fretTime.c:423
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_FlowRetime_ConstrainExactAll()

void Abc_FlowRetime_ConstrainExactAll ( Abc_Ntk_t * pNtk)

Function*************************************************************

Synopsis [Introduces all exact timing constraints in a network]

Description []

SideEffects []

SeeAlso []

Definition at line 584 of file fretTime.c.

584 {
585 int i;
586 Abc_Obj_t *pObj;
587 void *pArray;
588
589 // free existing constraints
590 Abc_NtkForEachObj( pNtk, pObj, i )
591 if ( Vec_PtrSize( FTIMEEDGES(pObj) )) {
592 pArray = Vec_PtrReleaseArray( FTIMEEDGES(pObj) );
593 ABC_FREE( pArray );
594 }
595 pManMR->nExactConstraints = 0;
596
597 // generate all constraints
598 Abc_NtkForEachObj(pNtk, pObj, i)
599 if (!Abc_ObjIsLatch(pObj) && FTEST( pObj, CONSERVATIVE ) && !FTEST( pObj, BLOCK ))
600 if (!Vec_PtrSize( FTIMEEDGES( pObj ) ))
602}
void Abc_FlowRetime_ConstrainExact(Abc_Obj_t *pObj)
Definition fretTime.c:407
#define BLOCK
Definition fretime.h:51
Here is the call graph for this function:

◆ Abc_FlowRetime_FreeTiming()

void Abc_FlowRetime_FreeTiming ( Abc_Ntk_t * pNtk)

Function*************************************************************

Synopsis [Deallocates exact constraints.]

Description []

SideEffects []

SeeAlso []

Definition at line 617 of file fretTime.c.

617 {
618 Abc_Obj_t *pObj;
619 void *pArray;
620
621 while( Vec_PtrSize( pManMR->vExactNodes )) {
622 pObj = (Abc_Obj_t*)Vec_PtrPop( pManMR->vExactNodes );
623
624 if ( Vec_PtrSize( FTIMEEDGES(pObj) )) {
625 pArray = Vec_PtrReleaseArray( FTIMEEDGES(pObj) );
626 ABC_FREE( pArray );
627 }
628 }
629
630 Vec_PtrFree(pManMR->vExactNodes);
631 ABC_FREE( pManMR->vTimeEdges );
632}
Here is the caller graph for this function:

◆ Abc_FlowRetime_InitTiming()

void Abc_FlowRetime_InitTiming ( Abc_Ntk_t * pNtk)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Initializes timing]

Description []

SideEffects []

SeeAlso []

Definition at line 67 of file fretTime.c.

67 {
68
69 pManMR->nConservConstraints = pManMR->nExactConstraints = 0;
70
71 pManMR->vExactNodes = Vec_PtrAlloc(1000);
72
73 pManMR->vTimeEdges = ABC_ALLOC( Vec_Ptr_t, Abc_NtkObjNumMax(pNtk)+1 );
74 assert(pManMR->vTimeEdges);
75 memset(pManMR->vTimeEdges, 0, (Abc_NtkObjNumMax(pNtk)+1) * sizeof(Vec_Ptr_t) );
76}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
char * memset()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_FlowRetime_RefineConstraints()

int Abc_FlowRetime_RefineConstraints ( )

Function*************************************************************

Synopsis [Main timing-constrained routine.]

Description [Refines constraints that are limiting area improvement. These are identified by computing the min-cuts both with and without the conservative constraints: these two situation represent an over- and under-constrained version of the timing.]

SideEffects []

SeeAlso []

Definition at line 693 of file fretTime.c.

693 {
694 Abc_Ntk_t *pNtk = pManMR->pNtk;
695 int i, flow, count = 0;
696 Abc_Obj_t *pObj;
697 int maxTighten = 99999;
698
699 vprintf("\t\tsubiter %d : constraints = {cons, exact} = %d, %d\n",
700 pManMR->subIteration, pManMR->nConservConstraints, pManMR->nExactConstraints);
701
702 // 1. overconstrained
703 pManMR->constraintMask = BLOCK | CONSERVATIVE;
704 vprintf("\t\trefinement: over ");
705 fflush(stdout);
706 flow = Abc_FlowRetime_PushFlows( pNtk, 0 );
707 vprintf("= %d ", flow);
708
709 // remember nodes
710 if (pManMR->fIsForward) {
711 Abc_NtkForEachObj( pNtk, pObj, i )
712 if (!FTEST(pObj, VISITED_R))
713 pObj->fMarkC = 1;
714 } else {
715 Abc_NtkForEachObj( pNtk, pObj, i )
716 if (!FTEST(pObj, VISITED_E))
717 pObj->fMarkC = 1;
718 }
719
720 if (pManMR->fConservTimingOnly) {
721 vprintf(" done\n");
722 return 0;
723 }
724
725 // 2. underconstrained
726 pManMR->constraintMask = BLOCK;
728 vprintf("under = ");
729 fflush(stdout);
730 flow = Abc_FlowRetime_PushFlows( pNtk, 0 );
731 vprintf("%d refined nodes = ", flow);
732 fflush(stdout);
733
734 // find area-limiting constraints
735 if (pManMR->fIsForward) {
736 Abc_NtkForEachObj( pNtk, pObj, i ) {
737 if (pObj->fMarkC &&
738 FTEST(pObj, VISITED_R) &&
739 FTEST(pObj, CONSERVATIVE) &&
740 count < maxTighten) {
741 count++;
743 }
744 pObj->fMarkC = 0;
745 }
746 } else {
747 Abc_NtkForEachObj( pNtk, pObj, i ) {
748 if (pObj->fMarkC &&
749 FTEST(pObj, VISITED_E) &&
750 FTEST(pObj, CONSERVATIVE) &&
751 count < maxTighten) {
752 count++;
754 }
755 pObj->fMarkC = 0;
756 }
757 }
758
759 vprintf("%d\n", count);
760
761 return (count > 0);
762}
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
#define vprintf
Definition fretime.h:138
void Abc_FlowRetime_ClearFlows(int fClearAll)
Definition fretMain.c:1087
#define VISITED_E
Definition fretime.h:46
int Abc_FlowRetime_PushFlows(Abc_Ntk_t *pNtk, int fVerbose)
Definition fretMain.c:479
#define VISITED_R
Definition fretime.h:47
unsigned fMarkC
Definition abc.h:136
Here is the call graph for this function:

◆ trace2()

void trace2 ( Abc_Obj_t * pObj)

Definition at line 39 of file fretTime.c.

39 {
40 Abc_Obj_t *pNext;
41 int i;
42
43 print_node(pObj);
44 Abc_ObjForEachFanin(pObj, pNext, i)
45 if (pNext->Level >= pObj->Level - 1) {
46 trace2(pNext);
47 break;
48 }
49}
void trace2(Abc_Obj_t *pObj)
Definition fretTime.c:39
void print_node(Abc_Obj_t *pObj)
Definition fretMain.c:945
Here is the call graph for this function:
Here is the caller graph for this function: