ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
tim.h
Go to the documentation of this file.
1
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 POs 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
81
85
87
91
92typedef struct Tim_Man_t_ Tim_Man_t;
93
97
98#define TIM_ETERNITY 1000000000
99
103
107
111
112/*=== timBox.c ===========================================================*/
113extern void Tim_ManCreateBox( Tim_Man_t * p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable, int fBlack );
114extern int Tim_ManBoxForCi( Tim_Man_t * p, int iCo );
115extern int Tim_ManBoxForCo( Tim_Man_t * p, int iCi );
116extern int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox );
117extern int Tim_ManBoxInputLast( Tim_Man_t * p, int iBox );
118extern int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox );
119extern int Tim_ManBoxOutputLast( Tim_Man_t * p, int iBox );
120extern int Tim_ManBoxInputNum( Tim_Man_t * p, int iBox );
121extern int Tim_ManBoxOutputNum( Tim_Man_t * p, int iBox );
122extern int Tim_ManBoxDelayTableId( Tim_Man_t * p, int iBox );
123extern float * Tim_ManBoxDelayTable( Tim_Man_t * p, int iBox );
124extern int Tim_ManBoxIsBlack( Tim_Man_t * p, int iBox );
125extern int Tim_ManBoxCopy( Tim_Man_t * p, int iBox );
126extern void Tim_ManBoxSetCopy( Tim_Man_t * p, int iBox, int iCopy );
127extern int Tim_ManBoxFindFromCiNum( Tim_Man_t * p, int iCiNum );
128/*=== timDump.c ===========================================================*/
129extern Vec_Str_t * Tim_ManSave( Tim_Man_t * p, int fHieOnly );
130extern Tim_Man_t * Tim_ManLoad( Vec_Str_t * p, int fHieOnly );
131/*=== timMan.c ===========================================================*/
132extern Tim_Man_t * Tim_ManStart( int nCis, int nCos );
133extern Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay );
134extern Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres );
135extern Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft, int nTermsDiff );
136extern Vec_Int_t * Tim_ManAlignTwo( Tim_Man_t * pSpec, Tim_Man_t * pImpl );
137extern void Tim_ManCreate( Tim_Man_t * p, void * pLib, Vec_Flt_t * vInArrs, Vec_Flt_t * vOutReqs );
138extern float * Tim_ManGetArrTimes( Tim_Man_t * p );
139extern float * Tim_ManGetReqTimes( Tim_Man_t * p );
140extern void Tim_ManStop( Tim_Man_t * p );
141extern void Tim_ManStopP( Tim_Man_t ** p );
142extern void Tim_ManPrint( Tim_Man_t * p );
143extern void Tim_ManPrintBoxCopy( Tim_Man_t * p );
144extern void Tim_ManPrintStats( Tim_Man_t * p, int nAnd2Delay );
145extern int Tim_ManCiNum( Tim_Man_t * p );
146extern int Tim_ManCoNum( Tim_Man_t * p );
147extern int Tim_ManPiNum( Tim_Man_t * p );
148extern int Tim_ManPoNum( Tim_Man_t * p );
149extern int Tim_ManBoxNum( Tim_Man_t * p );
150extern int Tim_ManBlackBoxNum( Tim_Man_t * p );
151extern void Tim_ManBlackBoxIoNum( Tim_Man_t * p, int * pnBbIns, int * pnBbOuts );
152extern int Tim_ManDelayTableNum( Tim_Man_t * p );
154extern void Tim_ManTravIdDisable( Tim_Man_t * p );
155extern void Tim_ManTravIdEnable( Tim_Man_t * p );
156/*=== timTime.c ===========================================================*/
157extern void Tim_ManInitPiArrival( Tim_Man_t * p, int iPi, float Delay );
158extern void Tim_ManInitPoRequired( Tim_Man_t * p, int iPo, float Delay );
159extern void Tim_ManInitPiArrivalAll( Tim_Man_t * p, float Delay );
160extern void Tim_ManInitPoRequiredAll( Tim_Man_t * p, float Delay );
161extern void Tim_ManSetCoArrival( Tim_Man_t * p, int iCo, float Delay );
162extern void Tim_ManSetCiRequired( Tim_Man_t * p, int iCi, float Delay );
163extern void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay );
164extern float Tim_ManGetCiArrival( Tim_Man_t * p, int iCi );
165extern float Tim_ManGetCoRequired( Tim_Man_t * p, int iCo );
166/*=== timTrav.c ===========================================================*/
167extern void Tim_ManIncrementTravId( Tim_Man_t * p );
168extern void Tim_ManSetCurrentTravIdBoxInputs( Tim_Man_t * p, int iBox );
169extern void Tim_ManSetCurrentTravIdBoxOutputs( Tim_Man_t * p, int iBox );
170extern void Tim_ManSetPreviousTravIdBoxInputs( Tim_Man_t * p, int iBox );
171extern void Tim_ManSetPreviousTravIdBoxOutputs( Tim_Man_t * p, int iBox );
172extern int Tim_ManIsCiTravIdCurrent( Tim_Man_t * p, int iCi );
173extern int Tim_ManIsCoTravIdCurrent( Tim_Man_t * p, int iCo );
174
175
177
178
179
180#endif
181
185
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
Cube * p
Definition exorList.c:222
int nCis
Definition timInt.h:59
Vec_Ptr_t * vDelayTables
Definition timInt.h:55
int nCos
Definition timInt.h:60
void Tim_ManStopP(Tim_Man_t **p)
Definition timMan.c:387
int Tim_ManBoxIsBlack(Tim_Man_t *p, int iBox)
Definition timBox.c:258
void Tim_ManPrintStats(Tim_Man_t *p, int nAnd2Delay)
Definition timMan.c:646
int Tim_ManBoxOutputNum(Tim_Man_t *p, int iBox)
Definition timBox.c:203
int Tim_ManBlackBoxNum(Tim_Man_t *p)
Definition timMan.c:726
void Tim_ManSetDelayTables(Tim_Man_t *p, Vec_Ptr_t *vDelayTables)
Definition timMan.c:765
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
Definition timTime.c:116
int Tim_ManBoxNum(Tim_Man_t *p)
Definition timMan.c:722
int Tim_ManBoxFindFromCiNum(Tim_Man_t *p, int iCiNum)
Definition timBox.c:307
void Tim_ManSetPreviousTravIdBoxInputs(Tim_Man_t *p, int iBox)
Definition timTrav.c:112
int Tim_ManBoxOutputLast(Tim_Man_t *p, int iBox)
Definition timBox.c:171
void Tim_ManTravIdEnable(Tim_Man_t *p)
Definition timMan.c:798
void Tim_ManBlackBoxIoNum(Tim_Man_t *p, int *pnBbIns, int *pnBbOuts)
Definition timMan.c:735
void Tim_ManInitPiArrivalAll(Tim_Man_t *p, float Delay)
Definition timTime.c:78
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition tim.h:92
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
Definition timTrav.c:44
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
Definition timBox.c:87
void Tim_ManPrintBoxCopy(Tim_Man_t *p)
Definition timMan.c:619
Vec_Int_t * Tim_ManAlignTwo(Tim_Man_t *pSpec, Tim_Man_t *pImpl)
Definition timMan.c:347
Vec_Str_t * Tim_ManSave(Tim_Man_t *p, int fHieOnly)
FUNCTION DEFINITIONS ///.
Definition timDump.c:46
int Tim_ManCiNum(Tim_Man_t *p)
Definition timMan.c:700
Tim_Man_t * Tim_ManLoad(Vec_Str_t *p, int fHieOnly)
Definition timDump.c:113
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable, int fBlack)
ITERATORS ///.
Definition timBox.c:44
void Tim_ManTravIdDisable(Tim_Man_t *p)
Definition timMan.c:782
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
Definition timBox.c:105
float * Tim_ManGetArrTimes(Tim_Man_t *p)
Definition timMan.c:482
int Tim_ManPoNum(Tim_Man_t *p)
Definition timMan.c:714
int Tim_ManBoxInputLast(Tim_Man_t *p, int iBox)
Definition timBox.c:139
void Tim_ManCreate(Tim_Man_t *p, void *pLib, Vec_Flt_t *vInArrs, Vec_Flt_t *vOutReqs)
Definition timMan.c:406
Tim_Man_t * Tim_ManTrim(Tim_Man_t *p, Vec_Int_t *vBoxPres)
Definition timMan.c:166
void Tim_ManStop(Tim_Man_t *p)
Definition timMan.c:378
void Tim_ManBoxSetCopy(Tim_Man_t *p, int iBox, int iCopy)
Definition timBox.c:291
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
Definition timBox.c:123
void Tim_ManSetPreviousTravIdBoxOutputs(Tim_Man_t *p, int iBox)
Definition timTrav.c:133
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition timBox.c:187
int Tim_ManIsCoTravIdCurrent(Tim_Man_t *p, int iCo)
Definition timTrav.c:172
void Tim_ManSetCiRequired(Tim_Man_t *p, int iCi, float Delay)
Definition timTime.c:135
float * Tim_ManGetReqTimes(Tim_Man_t *p)
Definition timMan.c:497
void Tim_ManSetCurrentTravIdBoxInputs(Tim_Man_t *p, int iBox)
Definition timTrav.c:70
Tim_Man_t * Tim_ManReduce(Tim_Man_t *p, Vec_Int_t *vBoxesLeft, int nTermsDiff)
Definition timMan.c:254
void Tim_ManInitPoRequiredAll(Tim_Man_t *p, float Delay)
Definition timTime.c:97
void Tim_ManSetCurrentTravIdBoxOutputs(Tim_Man_t *p, int iBox)
Definition timTrav.c:91
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
int Tim_ManPiNum(Tim_Man_t *p)
Definition timMan.c:708
int Tim_ManIsCiTravIdCurrent(Tim_Man_t *p, int iCi)
Definition timTrav.c:154
void Tim_ManSetCoRequired(Tim_Man_t *p, int iCo, float Delay)
Definition timTime.c:154
int Tim_ManCoNum(Tim_Man_t *p)
Definition timMan.c:704
void Tim_ManInitPiArrival(Tim_Man_t *p, int iPi, float Delay)
DECLARATIONS ///.
Definition timTime.c:44
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
Definition timTime.c:174
void Tim_ManPrint(Tim_Man_t *p)
Definition timMan.c:526
int Tim_ManDelayTableNum(Tim_Man_t *p)
Definition timMan.c:749
int Tim_ManBoxCopy(Tim_Man_t *p, int iBox)
Definition timBox.c:275
int Tim_ManBoxDelayTableId(Tim_Man_t *p, int iBox)
Definition timBox.c:219
float * Tim_ManBoxDelayTable(Tim_Man_t *p, int iBox)
Definition timBox.c:235
int Tim_ManBoxOutputFirst(Tim_Man_t *p, int iBox)
Definition timBox.c:155
void Tim_ManInitPoRequired(Tim_Man_t *p, int iPo, float Delay)
Definition timTime.c:61
float Tim_ManGetCoRequired(Tim_Man_t *p, int iCo)
Definition timTime.c:222
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition vecFlt.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42