ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
timInt.h
Go to the documentation of this file.
1
20
21#ifndef ABC__aig__tim__timInt_h
22#define ABC__aig__tim__timInt_h
23
24
28
29#include <stdio.h>
30#include <stdlib.h>
31#include <string.h>
32#include <assert.h>
33
34#include "misc/vec/vec.h"
35#include "misc/mem/mem.h"
36#include "tim.h"
37
41
43
47
48typedef struct Tim_Box_t_ Tim_Box_t;
49typedef struct Tim_Obj_t_ Tim_Obj_t;
50
51// timing manager
53{
54 Vec_Ptr_t * vBoxes; // the timing boxes
55 Vec_Ptr_t * vDelayTables; // pointers to the delay tables
56 Mem_Flex_t * pMemObj; // memory manager for boxes
57 int nTravIds; // traversal ID of the manager
58 int fUseTravId; // enables the use of traversal ID
59 int nCis; // the number of PIs
60 int nCos; // the number of POs
61 Tim_Obj_t * pCis; // timing info for the PIs
62 Tim_Obj_t * pCos; // timing info for the POs
63};
64
65// timing box
67{
68 int iBox; // the unique ID of this box
69 int TravId; // traversal ID of this box
70 int nInputs; // the number of box inputs (POs)
71 int nOutputs; // the number of box outputs (PIs)
72 int iDelayTable; // index of the delay table
73 int iCopy; // copy of this box
74 int fBlack; // this is black box
75 int Inouts[0]; // the int numbers of PIs and POs
76};
77
78// timing object
80{
81 int Id; // the ID of this object
82 int TravId; // traversal ID of this object
83 int iObj2Box; // mapping of the object into its box
84 int iObj2Num; // mapping of the object into its number in the box
85 float timeArr; // arrival time of the object
86 float timeReq; // required time of the object
87};
88
92
93static inline Tim_Obj_t * Tim_ManCi( Tim_Man_t * p, int i ) { assert( i < p->nCis ); return p->pCis + i; }
94static inline Tim_Obj_t * Tim_ManCo( Tim_Man_t * p, int i ) { assert( i < p->nCos ); return p->pCos + i; }
95static inline Tim_Box_t * Tim_ManBox( Tim_Man_t * p, int i ) { return (Tim_Box_t *)Vec_PtrEntry(p->vBoxes, i); }
96
97static inline Tim_Box_t * Tim_ManCiBox( Tim_Man_t * p, int i ) { return Tim_ManCi(p,i)->iObj2Box < 0 ? NULL : (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, Tim_ManCi(p,i)->iObj2Box ); }
98static inline Tim_Box_t * Tim_ManCoBox( Tim_Man_t * p, int i ) { return Tim_ManCo(p,i)->iObj2Box < 0 ? NULL : (Tim_Box_t *)Vec_PtrEntry( p->vBoxes, Tim_ManCo(p,i)->iObj2Box ); }
99
100static inline Tim_Obj_t * Tim_ManBoxInput( Tim_Man_t * p, Tim_Box_t * pBox, int i ) { assert( i < pBox->nInputs ); return p->pCos + pBox->Inouts[i]; }
101static inline Tim_Obj_t * Tim_ManBoxOutput( Tim_Man_t * p, Tim_Box_t * pBox, int i ) { assert( i < pBox->nOutputs ); return p->pCis + pBox->Inouts[pBox->nInputs+i]; }
102
106
107#define Tim_ManForEachCi( p, pObj, i ) \
108 for ( i = 0; (i < (p)->nCis) && ((pObj) = (p)->pCis + i); i++ )
109#define Tim_ManForEachCo( p, pObj, i ) \
110 for ( i = 0; (i < (p)->nCos) && ((pObj) = (p)->pCos + i); i++ )
111
112#define Tim_ManForEachPi( p, pObj, i ) \
113 Tim_ManForEachCi( p, pObj, i ) if ( pObj->iObj2Box >= 0 ) {} else
114#define Tim_ManForEachPo( p, pObj, i ) \
115 Tim_ManForEachCo( p, pObj, i ) if ( pObj->iObj2Box >= 0 ) {} else
116
117#define Tim_ManForEachBox( p, pBox, i ) \
118 Vec_PtrForEachEntry( Tim_Box_t *, p->vBoxes, pBox, i )
119
120#define Tim_ManBoxForEachInput( p, pBox, pObj, i ) \
121 for ( i = 0; (i < (pBox)->nInputs) && ((pObj) = Tim_ManBoxInput(p, pBox, i)); i++ )
122#define Tim_ManBoxForEachOutput( p, pBox, pObj, i ) \
123 for ( i = 0; (i < (pBox)->nOutputs) && ((pObj) = Tim_ManBoxOutput(p, pBox, i)); i++ )
124
125#define Tim_ManForEachTable( p, pTable, i ) \
126 Vec_PtrForEachEntry( float *, p->vDelayTables, pTable, i )
127
131
135
136/*=== time.c ===========================================================*/
137
138
140
141
142
143#endif
144
148
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Cube * p
Definition exorList.c:222
struct Mem_Flex_t_ Mem_Flex_t
Definition mem.h:34
int iCopy
Definition timInt.h:73
int TravId
Definition timInt.h:69
int iDelayTable
Definition timInt.h:72
int fBlack
Definition timInt.h:74
int nOutputs
Definition timInt.h:71
int iBox
Definition timInt.h:68
int nInputs
Definition timInt.h:70
int Inouts[0]
Definition timInt.h:75
int nCis
Definition timInt.h:59
Tim_Obj_t * pCos
Definition timInt.h:62
Tim_Obj_t * pCis
Definition timInt.h:61
Vec_Ptr_t * vBoxes
Definition timInt.h:54
Vec_Ptr_t * vDelayTables
Definition timInt.h:55
int nTravIds
Definition timInt.h:57
int fUseTravId
Definition timInt.h:58
Mem_Flex_t * pMemObj
Definition timInt.h:56
int nCos
Definition timInt.h:60
float timeArr
Definition timInt.h:85
int TravId
Definition timInt.h:82
float timeReq
Definition timInt.h:86
int Id
Definition timInt.h:81
int iObj2Box
Definition timInt.h:83
int iObj2Num
Definition timInt.h:84
struct Tim_Obj_t_ Tim_Obj_t
Definition timInt.h:49
typedefABC_NAMESPACE_HEADER_START struct Tim_Box_t_ Tim_Box_t
INCLUDES ///.
Definition timInt.h:48
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition tim.h:92
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42