abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
tim.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [tim.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Hierarchy/timing manager.]
8 
9  Synopsis [External declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - April 28, 2007.]
16 
17  Revision [$Id: tim.h,v 1.00 2007/04/28 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__aig__tim__tim_h
22 #define ABC__aig__tim__tim_h
23 
24 /*
25  The data-structure Tim_Man_t implemented in this package stores two types
26  of information:
27  (1) hierarchical information about the connectivity of a combinational
28  logic network with combinational logic node and combinational white boxes
29  (2) timing information about input-to-output delays of each combinational
30  white box.
31 
32  This data-structure is closely coupled with the AIG manager extracted from
33  the same combinational logic network. The AIG manager represents combinational
34  logic surrounding white boxes, and contains additional PIs/POs corresponding
35  to the outputs/inputs of the white boxes.
36 
37  The manager Tim_Man_t is created by a call to Tim_ManStart(). The arguments
38  of this call are the total number of all combinational inputs/output in
39  the extracted AIG. (Note that this number is different from the number of
40  inputs/outputs of the combinational logic network, because the extracted AIG
41  will have additional inputs/output due to white boxes.)
42 
43  The extracted AIG and the corresponding Tim_Man_t may be created at the same
44  time or at separate times. The following guideline assumes concurrent creation.
45 
46  First, PIs of the AIG are created in 1-to-1 correspondence with the PIs
47  of the original network.
48  Next, all nodes (logic nodes and white boxes) of the network are traversed
49  in a topologic order.
50  When a white box is encountered, the TFI cone of box inputs are tranversed
51  and all new logic nodes encoutered added to the AIG.
52  Then, the white box is created by the call to Tim_ManCreateBox().
53  Then, new POs of the AIG are created in 1-to-1 correspondence with box inputs.
54  Then, new PIs of the AIG are created in 1-to-1 correspondence with box outputs.
55  Finally, the TFO cone of the POs is traversed and all new logic nodes
56  encountered added to the AIG.
57  In the end, the POs of the AIG is constructed in 1-to-1 correspondence with
58  the PIs of the original combinational logic network.
59 
60  Delay tables representing input-to-output delays of each type of white
61  box should be computed in advance and given to the timing manager in one array
62  through the API Tim_ManSetDelayTables(). When each box is constructed, the delay
63  table ID of this box (which is the index of the table in the above array) is given
64  as the last argument 'iDelayTable' in Tim_ManCreateBox().
65 
66  A delay table is a one-dimensional array of floats whose size is: 3 + nInputs * nOutputs.
67  The first entry is the delay table ID used by the boxes to refer to the table.
68  The second and third entries are nInputs and nOutputs.
69  The following 'nInputs * nOutputs' entries are delay numbers for each output,
70  that is, the first set of nInputs entries give delay of the first output.
71  the second set of nInputs entries give delay of the second output, etc.
72 
73  The Tim_Man_t is typically associated with the AIG manager (pGia) using
74  pointer (pGia->pManTime). It is automatically deallocated when the host
75  AIG manager is deleted.
76 */
77 
78 ////////////////////////////////////////////////////////////////////////
79 /// INCLUDES ///
80 ////////////////////////////////////////////////////////////////////////
81 
82 ////////////////////////////////////////////////////////////////////////
83 /// PARAMETERS ///
84 ////////////////////////////////////////////////////////////////////////
85 
87 
88 ////////////////////////////////////////////////////////////////////////
89 /// BASIC TYPES ///
90 ////////////////////////////////////////////////////////////////////////
91 
92 typedef struct Tim_Man_t_ Tim_Man_t;
93 
94 ////////////////////////////////////////////////////////////////////////
95 /// MACRO DEFINITIONS ///
96 ////////////////////////////////////////////////////////////////////////
97 
98 #define TIM_ETERNITY 1000000000
99 
100 ////////////////////////////////////////////////////////////////////////
101 /// ITERATORS ///
102 ////////////////////////////////////////////////////////////////////////
103 
104 ////////////////////////////////////////////////////////////////////////
105 /// SEQUENTIAL ITERATORS ///
106 ////////////////////////////////////////////////////////////////////////
107 
108 ////////////////////////////////////////////////////////////////////////
109 /// FUNCTION DECLARATIONS ///
110 ////////////////////////////////////////////////////////////////////////
111 
112 /*=== timBox.c ===========================================================*/
113 extern void Tim_ManCreateBox( Tim_Man_t * p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable );
114 extern int Tim_ManBoxForCi( Tim_Man_t * p, int iCo );
115 extern int Tim_ManBoxForCo( Tim_Man_t * p, int iCi );
116 extern int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox );
117 extern int Tim_ManBoxInputLast( Tim_Man_t * p, int iBox );
118 extern int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox );
119 extern int Tim_ManBoxOutputLast( Tim_Man_t * p, int iBox );
120 extern int Tim_ManBoxInputNum( Tim_Man_t * p, int iBox );
121 extern int Tim_ManBoxOutputNum( Tim_Man_t * p, int iBox );
122 extern int Tim_ManBoxDelayTableId( Tim_Man_t * p, int iBox );
123 extern float * Tim_ManBoxDelayTable( Tim_Man_t * p, int iBox );
124 extern int Tim_ManBoxIsBlack( Tim_Man_t * p, int iBox );
125 extern int Tim_ManBoxCopy( Tim_Man_t * p, int iBox );
126 extern void Tim_ManBoxSetCopy( Tim_Man_t * p, int iBox, int iCopy );
127 extern int Tim_ManBoxFindFromCiNum( Tim_Man_t * p, int iCiNum );
128 /*=== timDump.c ===========================================================*/
129 extern Vec_Str_t * Tim_ManSave( Tim_Man_t * p, int fHieOnly );
130 extern Tim_Man_t * Tim_ManLoad( Vec_Str_t * p, int fHieOnly );
131 /*=== timMan.c ===========================================================*/
132 extern Tim_Man_t * Tim_ManStart( int nCis, int nCos );
133 extern Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay );
134 extern Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres );
135 extern Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft, int nTermsDiff );
136 extern Vec_Int_t * Tim_ManAlignTwo( Tim_Man_t * pSpec, Tim_Man_t * pImpl );
137 extern void Tim_ManCreate( Tim_Man_t * p, void * pLib, Vec_Flt_t * vInArrs, Vec_Flt_t * vOutReqs );
138 extern float * Tim_ManGetArrTimes( Tim_Man_t * p );
139 extern float * Tim_ManGetReqTimes( Tim_Man_t * p );
140 extern void Tim_ManStop( Tim_Man_t * p );
141 extern void Tim_ManStopP( Tim_Man_t ** p );
142 extern void Tim_ManPrint( Tim_Man_t * p );
143 extern void Tim_ManPrintStats( Tim_Man_t * p, int nAnd2Delay );
144 extern int Tim_ManCiNum( Tim_Man_t * p );
145 extern int Tim_ManCoNum( Tim_Man_t * p );
146 extern int Tim_ManPiNum( Tim_Man_t * p );
147 extern int Tim_ManPoNum( Tim_Man_t * p );
148 extern int Tim_ManBoxNum( Tim_Man_t * p );
149 extern int Tim_ManBlackBoxNum( Tim_Man_t * p );
150 extern int Tim_ManDelayTableNum( Tim_Man_t * p );
152 extern void Tim_ManTravIdDisable( Tim_Man_t * p );
153 extern void Tim_ManTravIdEnable( Tim_Man_t * p );
154 /*=== timTime.c ===========================================================*/
155 extern void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay );
156 extern void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay );
157 extern void Tim_ManInitPiArrivalAll( Tim_Man_t * p, float Delay );
158 extern void Tim_ManInitPoRequiredAll( Tim_Man_t * p, float Delay );
159 extern void Tim_ManSetCoArrival( Tim_Man_t * p, int iCo, float Delay );
160 extern void Tim_ManSetCiRequired( Tim_Man_t * p, int iCi, float Delay );
161 extern void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay );
162 extern float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi );
163 extern float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo );
164 /*=== timTrav.c ===========================================================*/
165 extern void Tim_ManIncrementTravId( Tim_Man_t * p );
166 extern void Tim_ManSetCurrentTravIdBoxInputs( Tim_Man_t * p, int iBox );
167 extern void Tim_ManSetCurrentTravIdBoxOutputs( Tim_Man_t * p, int iBox );
168 extern void Tim_ManSetPreviousTravIdBoxInputs( Tim_Man_t * p, int iBox );
169 extern void Tim_ManSetPreviousTravIdBoxOutputs( Tim_Man_t * p, int iBox );
170 extern int Tim_ManIsCiTravIdCurrent( Tim_Man_t * p, int iCi );
171 extern int Tim_ManIsCoTravIdCurrent( Tim_Man_t * p, int iCo );
172 
173 
175 
176 
177 
178 #endif
179 
180 ////////////////////////////////////////////////////////////////////////
181 /// END OF FILE ///
182 ////////////////////////////////////////////////////////////////////////
183 
int Tim_ManBoxOutputFirst(Tim_Man_t *p, int iBox)
Definition: timBox.c:154
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
Definition: timBox.c:86
int Tim_ManCoNum(Tim_Man_t *p)
Definition: timMan.c:684
int Tim_ManIsCiTravIdCurrent(Tim_Man_t *p, int iCi)
Definition: timTrav.c:154
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Vec_Str_t * Tim_ManSave(Tim_Man_t *p, int fHieOnly)
FUNCTION DEFINITIONS ///.
Definition: timDump.c:46
void Tim_ManSetCurrentTravIdBoxOutputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:91
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
Definition: timTrav.c:44
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int nCos
Definition: timInt.h:60
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
Definition: timBox.c:104
void Tim_ManPrintStats(Tim_Man_t *p, int nAnd2Delay)
Definition: timMan.c:626
int Tim_ManBoxOutputLast(Tim_Man_t *p, int iBox)
Definition: timBox.c:170
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
Definition: timTime.c:116
void Tim_ManSetCurrentTravIdBoxInputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:70
int Tim_ManBoxOutputNum(Tim_Man_t *p, int iBox)
Definition: timBox.c:202
int Tim_ManBoxDelayTableId(Tim_Man_t *p, int iBox)
Definition: timBox.c:218
void Tim_ManSetPreviousTravIdBoxOutputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:133
Tim_Man_t * Tim_ManReduce(Tim_Man_t *p, Vec_Int_t *vBoxesLeft, int nTermsDiff)
Definition: timMan.c:251
void Tim_ManCreate(Tim_Man_t *p, void *pLib, Vec_Flt_t *vInArrs, Vec_Flt_t *vOutReqs)
Definition: timMan.c:403
int Tim_ManPiNum(Tim_Man_t *p)
Definition: timMan.c:688
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable)
ITERATORS ///.
Definition: timBox.c:44
void Tim_ManSetPreviousTravIdBoxInputs(Tim_Man_t *p, int iBox)
Definition: timTrav.c:112
void Tim_ManSetCiRequired(Tim_Man_t *p, int iCi, float Delay)
Definition: timTime.c:135
void Tim_ManPrint(Tim_Man_t *p)
Definition: timMan.c:523
void Tim_ManInitPoRequired(Tim_Man_t *p, int iPo, float Delay)
Definition: timTime.c:61
int Tim_ManBoxFindFromCiNum(Tim_Man_t *p, int iCiNum)
Definition: timBox.c:306
int Tim_ManIsCoTravIdCurrent(Tim_Man_t *p, int iCo)
Definition: timTrav.c:172
void Tim_ManTravIdDisable(Tim_Man_t *p)
Definition: timMan.c:748
int Tim_ManDelayTableNum(Tim_Man_t *p)
Definition: timMan.c:715
int Tim_ManBoxInputLast(Tim_Man_t *p, int iBox)
Definition: timBox.c:138
int Tim_ManCiNum(Tim_Man_t *p)
Definition: timMan.c:680
void Tim_ManInitPiArrival(Tim_Man_t *p, int iPi, float Delay)
DECLARATIONS ///.
Definition: timTime.c:44
Tim_Man_t * Tim_ManDup(Tim_Man_t *p, int fUnitDelay)
Definition: timMan.c:86
Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
Definition: timMan.c:45
void Tim_ManStop(Tim_Man_t *p)
Definition: timMan.c:375
Tim_Man_t * Tim_ManTrim(Tim_Man_t *p, Vec_Int_t *vBoxPres)
Definition: timMan.c:163
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
int Tim_ManBoxNum(Tim_Man_t *p)
Definition: timMan.c:702
void Tim_ManStopP(Tim_Man_t **p)
Definition: timMan.c:384
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
float * Tim_ManGetReqTimes(Tim_Man_t *p)
Definition: timMan.c:494
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition: timBox.c:186
void Tim_ManInitPiArrivalAll(Tim_Man_t *p, float Delay)
Definition: timTime.c:78
int Tim_ManBoxIsBlack(Tim_Man_t *p, int iBox)
Definition: timBox.c:257
void Tim_ManSetDelayTables(Tim_Man_t *p, Vec_Ptr_t *vDelayTables)
Definition: timMan.c:731
int Tim_ManBlackBoxNum(Tim_Man_t *p)
Definition: timMan.c:706
Vec_Ptr_t * vDelayTables
Definition: timInt.h:55
int Tim_ManBoxCopy(Tim_Man_t *p, int iBox)
Definition: timBox.c:274
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
int nCis
Definition: timInt.h:59
float Tim_ManGetCoRequired(Tim_Man_t *p, int iCo)
Definition: timTime.c:222
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
void Tim_ManSetCoRequired(Tim_Man_t *p, int iCo, float Delay)
Definition: timTime.c:154
float * Tim_ManGetArrTimes(Tim_Man_t *p)
Definition: timMan.c:479
Tim_Man_t * Tim_ManLoad(Vec_Str_t *p, int fHieOnly)
Definition: timDump.c:112
void Tim_ManTravIdEnable(Tim_Man_t *p)
Definition: timMan.c:764
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
Definition: timBox.c:122
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
Definition: timTime.c:174
Vec_Int_t * Tim_ManAlignTwo(Tim_Man_t *pSpec, Tim_Man_t *pImpl)
Definition: timMan.c:344
void Tim_ManBoxSetCopy(Tim_Man_t *p, int iBox, int iCopy)
Definition: timBox.c:290
int Tim_ManPoNum(Tim_Man_t *p)
Definition: timMan.c:694
void Tim_ManInitPoRequiredAll(Tim_Man_t *p, float Delay)
Definition: timTime.c:97
float * Tim_ManBoxDelayTable(Tim_Man_t *p, int iBox)
Definition: timBox.c:234