abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcHieGia.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcHieGia.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Procedures to handle hierarchy.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcHieGia.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "abc.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Transfers the AIG from one manager into another.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
46 {
47  assert( !Hop_IsComplement(pObj) );
48  if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
49  return;
50  Abc_NodeStrashToGia_rec( pNew, Hop_ObjFanin0(pObj) );
52  pObj->iData = Gia_ManHashAnd( pNew, Hop_ObjChild0CopyI(pObj), Hop_ObjChild1CopyI(pObj) );
53  assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
54  Hop_ObjSetMarkA( pObj );
55 }
56 int Abc_NodeStrashToGia( Gia_Man_t * pNew, Abc_Obj_t * pNode )
57 {
58  Hop_Man_t * pMan = (Hop_Man_t *)pNode->pNtk->pManFunc;
59  Hop_Obj_t * pRoot = (Hop_Obj_t *)pNode->pData;
60  Abc_Obj_t * pFanin; int i;
61  assert( Abc_ObjIsNode(pNode) );
62  assert( Abc_NtkHasAig(pNode->pNtk) && !Abc_NtkIsStrash(pNode->pNtk) );
63  // check the constant case
64  if ( Abc_NodeIsConst(pNode) || Hop_Regular(pRoot) == Hop_ManConst1(pMan) )
65  return Abc_LitNotCond( 1, Hop_IsComplement(pRoot) );
66  // set elementary variables
67  Abc_ObjForEachFanin( pNode, pFanin, i )
68  assert( pFanin->iTemp != -1 );
69  Abc_ObjForEachFanin( pNode, pFanin, i )
70  Hop_IthVar(pMan, i)->iData = pFanin->iTemp;
71  // strash the AIG of this node
72  Abc_NodeStrashToGia_rec( pNew, Hop_Regular(pRoot) );
74  return Abc_LitNotCond( Hop_Regular(pRoot)->iData, Hop_IsComplement(pRoot) );
75 }
76 
77 
78 /**Function*************************************************************
79 
80  Synopsis [Flattens the logic hierarchy of the netlist.]
81 
82  Description []
83 
84  SideEffects []
85 
86  SeeAlso []
87 
88 ***********************************************************************/
89 void Abc_NtkFlattenHierarchyGia2_rec( Gia_Man_t * pNew, Abc_Ntk_t * pNtk, int * pCounter, Vec_Int_t * vBufs )
90 {
91  Vec_Ptr_t * vDfs = (Vec_Ptr_t *)pNtk->pData;
92  Abc_Obj_t * pObj, * pTerm;
93  int i, k; (*pCounter)++;
94  //printf( "[%d:%d] ", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
95  Vec_PtrForEachEntry( Abc_Obj_t *, vDfs, pObj, i )
96  {
97  if ( Abc_ObjIsNode(pObj) )
98  Abc_ObjFanout0(pObj)->iTemp = Abc_NodeStrashToGia( pNew, pObj );
99  else
100  {
101  int iBufStart = Gia_ManBufNum(pNew);
102  Abc_Ntk_t * pModel = (Abc_Ntk_t *)pObj->pData;
103  assert( !Abc_ObjIsLatch(pObj) );
104  assert( Abc_NtkPiNum(pModel) == Abc_ObjFaninNum(pObj) );
105  assert( Abc_NtkPoNum(pModel) == Abc_ObjFanoutNum(pObj) );
106  Abc_NtkFillTemp( pModel );
107  Abc_ObjForEachFanin( pObj, pTerm, k )
108  {
109  assert( Abc_ObjIsNet(Abc_ObjFanin0(pTerm)) );
110  Abc_ObjFanout0(Abc_NtkPi(pModel, k))->iTemp = Abc_ObjFanin0(pTerm)->iTemp;
111  }
112  if ( vBufs )
113  Abc_ObjForEachFanin( pObj, pTerm, k )
114  Abc_ObjFanout0(Abc_NtkPi(pModel, k))->iTemp = Gia_ManAppendBuf( pNew, Abc_ObjFanout0(Abc_NtkPi(pModel, k))->iTemp );
115  Abc_NtkFlattenHierarchyGia2_rec( pNew, pModel, pCounter, vBufs );
116  if ( vBufs )
117  Abc_ObjForEachFanout( pObj, pTerm, k )
118  Abc_ObjFanin0(Abc_NtkPo(pModel, k))->iTemp = Gia_ManAppendBuf( pNew, Abc_ObjFanin0(Abc_NtkPo(pModel, k))->iTemp );
119  Abc_ObjForEachFanout( pObj, pTerm, k )
120  {
122  Abc_ObjFanout0(pTerm)->iTemp = Abc_ObjFanin0(Abc_NtkPo(pModel, k))->iTemp;
123  }
124  // save buffers
125  if ( vBufs == NULL )
126  continue;
127  Vec_IntPush( vBufs, iBufStart );
128  Vec_IntPush( vBufs, Abc_NtkPiNum(pModel) );
129  Vec_IntPush( vBufs, Gia_ManBufNum(pNew) - Abc_NtkPoNum(pModel) );
130  Vec_IntPush( vBufs, Abc_NtkPoNum(pModel) );
131  }
132  }
133 }
135 {
136  int fUseBufs = 1;
137  int fUseInter = 0;
138  Gia_Man_t * pNew, * pTemp;
139  Abc_Ntk_t * pModel;
140  Abc_Obj_t * pTerm;
141  int i, Counter = -1;
142  assert( Abc_NtkIsNetlist(pNtk) );
143 // Abc_NtkPrintBoxInfo( pNtk );
144  Abc_NtkFillTemp( pNtk );
145 
146  // start the manager
147  pNew = Gia_ManStart( Abc_NtkObjNumMax(pNtk) );
148  pNew->pName = Abc_UtilStrsav(pNtk->pName);
149  pNew->pSpec = Abc_UtilStrsav(pNtk->pSpec);
150  if ( fUseBufs )
151  pNew->vBarBufs = Vec_IntAlloc( 1000 );
152 
153  // create PIs and buffers
154  Abc_NtkForEachPi( pNtk, pTerm, i )
155  pTerm->iTemp = Gia_ManAppendCi( pNew );
156  Abc_NtkForEachPi( pNtk, pTerm, i )
157  Abc_ObjFanout0(pTerm)->iTemp = fUseInter ? Gia_ManAppendBuf(pNew, pTerm->iTemp) : pTerm->iTemp;
158 
159  // create DFS order of nets
160  if ( !pNtk->pDesign )
161  pNtk->pData = Abc_NtkDfsWithBoxes( pNtk );
162  else
163  Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
164  pModel->pData = Abc_NtkDfsWithBoxes( pModel );
165 
166  // call recursively
167  Gia_ManHashAlloc( pNew );
168  Abc_NtkFlattenHierarchyGia2_rec( pNew, pNtk, &Counter, pNew->vBarBufs );
169  Gia_ManHashStop( pNew );
170  printf( "Hierarchy reader flattened %d instances of logic boxes.\n", Counter );
171 
172  // delete DFS order of nets
173  if ( !pNtk->pDesign )
174  Vec_PtrFreeP( (Vec_Ptr_t **)&pNtk->pData );
175  else
176  Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
177  Vec_PtrFreeP( (Vec_Ptr_t **)&pModel->pData );
178 
179  // create buffers and POs
180  Abc_NtkForEachPo( pNtk, pTerm, i )
181  pTerm->iTemp = fUseInter ? Gia_ManAppendBuf(pNew, Abc_ObjFanin0(pTerm)->iTemp) : Abc_ObjFanin0(pTerm)->iTemp;
182  Abc_NtkForEachPo( pNtk, pTerm, i )
183  Gia_ManAppendCo( pNew, pTerm->iTemp );
184 
185  // save buffers
186  if ( fUseInter )
187  {
188  Vec_IntPush( pNew->vBarBufs, 0 );
189  Vec_IntPush( pNew->vBarBufs, Abc_NtkPiNum(pNtk) );
190  Vec_IntPush( pNew->vBarBufs, Gia_ManBufNum(pNew) - Abc_NtkPoNum(pNtk) );
191  Vec_IntPush( pNew->vBarBufs, Abc_NtkPoNum(pNtk) );
192  }
193  if ( fUseBufs )
194  Vec_IntPrint( pNew->vBarBufs );
195 
196  // cleanup
197  pNew = Gia_ManCleanup( pTemp = pNew );
198  Gia_ManStop( pTemp );
199  return pNew;
200 }
201 
202 
203 /**Function*************************************************************
204 
205  Synopsis [Flattens the logic hierarchy of the netlist.]
206 
207  Description [This procedure requires that models are uniqified.]
208 
209  SideEffects []
210 
211  SeeAlso []
212 
213 ***********************************************************************/
215 {
216  Abc_Obj_t * pTerm, * pBox;
217  int i, k;
218  Abc_NtkFillTemp( pNtk );
219  Abc_NtkForEachPi( pNtk, pTerm, i )
220  pTerm->iData = i;
221  Abc_NtkForEachPo( pNtk, pTerm, i )
222  pTerm->iData = i;
223  Abc_NtkForEachBox( pNtk, pBox, i )
224  {
225  assert( !Abc_ObjIsLatch(pBox) );
226  Abc_ObjForEachFanin( pBox, pTerm, k )
227  pTerm->iData = k;
228  Abc_ObjForEachFanout( pBox, pTerm, k )
229  pTerm->iData = k;
230  }
231  return Abc_NtkPiNum(pNtk) + Abc_NtkPoNum(pNtk);
232 }
233 int Abc_NtkFlattenHierarchyGia_rec( Gia_Man_t * pNew, Vec_Ptr_t * vSupers, Abc_Obj_t * pObj, Vec_Ptr_t * vBuffers )
234 {
235  Abc_Ntk_t * pModel;
236  Abc_Obj_t * pBox, * pFanin;
237  int iLit, i;
238  if ( pObj->iTemp != -1 )
239  return pObj->iTemp;
240  if ( Abc_ObjIsNet(pObj) || Abc_ObjIsPo(pObj) || Abc_ObjIsBi(pObj) )
241  return (pObj->iTemp = Abc_NtkFlattenHierarchyGia_rec(pNew, vSupers, Abc_ObjFanin0(pObj), vBuffers));
242  if ( Abc_ObjIsPi(pObj) )
243  {
244  pBox = (Abc_Obj_t *)Vec_PtrPop( vSupers );
245  pModel = Abc_ObjModel(pBox);
246  //printf( " Exiting %s\n", Abc_NtkName(pModel) );
247  assert( Abc_ObjFaninNum(pBox) == Abc_NtkPiNum(pModel) );
248  assert( pObj->iData >= 0 && pObj->iData < Abc_NtkPiNum(pModel) );
249  pFanin = Abc_ObjFanin( pBox, pObj->iData );
250  iLit = Abc_NtkFlattenHierarchyGia_rec( pNew, vSupers, pFanin, vBuffers );
251  Vec_PtrPush( vSupers, pBox );
252  //if ( vBuffers ) Vec_PtrPush( vBuffers, pFanin ); // save BI
253  if ( vBuffers ) Vec_PtrPush( vBuffers, pObj ); // save PI
254  return (pObj->iTemp = (vBuffers ? Gia_ManAppendBuf(pNew, iLit) : iLit));
255  }
256  if ( Abc_ObjIsBo(pObj) )
257  {
258  pBox = Abc_ObjFanin0(pObj);
259  assert( Abc_ObjIsBox(pBox) );
260  Vec_PtrPush( vSupers, pBox );
261  pModel = Abc_ObjModel(pBox);
262  //printf( "Entering %s\n", Abc_NtkName(pModel) );
263  assert( Abc_ObjFanoutNum(pBox) == Abc_NtkPoNum(pModel) );
264  assert( pObj->iData >= 0 && pObj->iData < Abc_NtkPoNum(pModel) );
265  pFanin = Abc_NtkPo( pModel, pObj->iData );
266  iLit = Abc_NtkFlattenHierarchyGia_rec( pNew, vSupers, pFanin, vBuffers );
267  Vec_PtrPop( vSupers );
268  //if ( vBuffers ) Vec_PtrPush( vBuffers, pObj ); // save BO
269  if ( vBuffers ) Vec_PtrPush( vBuffers, pFanin ); // save PO
270  return (pObj->iTemp = (vBuffers ? Gia_ManAppendBuf(pNew, iLit) : iLit));
271  }
272  assert( Abc_ObjIsNode(pObj) );
273  Abc_ObjForEachFanin( pObj, pFanin, i )
274  Abc_NtkFlattenHierarchyGia_rec( pNew, vSupers, pFanin, vBuffers );
275  return (pObj->iTemp = Abc_NodeStrashToGia( pNew, pObj ));
276 }
277 Gia_Man_t * Abc_NtkFlattenHierarchyGia( Abc_Ntk_t * pNtk, Vec_Ptr_t ** pvBuffers, int fVerbose )
278 {
279  int fUseBufs = 1;
280  Gia_Man_t * pNew, * pTemp;
281  Abc_Ntk_t * pModel;
282  Abc_Obj_t * pTerm;
283  Vec_Ptr_t * vSupers;
284  Vec_Ptr_t * vBuffers = fUseBufs ? Vec_PtrAlloc(1000) : NULL;
285  int i, Counter = 0;
286  assert( Abc_NtkIsNetlist(pNtk) );
287 // Abc_NtkPrintBoxInfo( pNtk );
288 
289  // set the PI/PO numbers
290  Counter -= Abc_NtkPiNum(pNtk) + Abc_NtkPoNum(pNtk);
291  if ( !pNtk->pDesign )
292  Counter += Gia_ManFlattenLogicPrepare( pNtk );
293  else
294  Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
295  Counter += Gia_ManFlattenLogicPrepare( pModel );
296 
297  // start the manager
298  pNew = Gia_ManStart( Abc_NtkObjNumMax(pNtk) );
299  pNew->pName = Abc_UtilStrsav(pNtk->pName);
300  pNew->pSpec = Abc_UtilStrsav(pNtk->pSpec);
301 
302  // create PIs and buffers
303  Abc_NtkForEachPi( pNtk, pTerm, i )
304  pTerm->iTemp = Gia_ManAppendCi( pNew );
305 
306  // call recursively
307  vSupers = Vec_PtrAlloc( 100 );
308  Gia_ManHashAlloc( pNew );
309  Abc_NtkForEachPo( pNtk, pTerm, i )
310  Abc_NtkFlattenHierarchyGia_rec( pNew, vSupers, pTerm, vBuffers );
311  Gia_ManHashStop( pNew );
312  Vec_PtrFree( vSupers );
313  printf( "Hierarchy reader flattened %d instances of boxes and added %d barbufs (out of %d).\n",
314  pNtk->pDesign ? Vec_PtrSize(pNtk->pDesign->vModules)-1 : 0, Vec_PtrSize(vBuffers), Counter );
315 
316  // create buffers and POs
317  Abc_NtkForEachPo( pNtk, pTerm, i )
318  Gia_ManAppendCo( pNew, pTerm->iTemp );
319 
320  if ( pvBuffers )
321  *pvBuffers = vBuffers;
322  else
323  Vec_PtrFreeP( &vBuffers );
324 
325  // cleanup
326  pNew = Gia_ManCleanup( pTemp = pNew );
327  Gia_ManStop( pTemp );
328  return pNew;
329 }
330 
331 /**Function*************************************************************
332 
333  Synopsis [Inserts the result of mapping into logic hierarchy.]
334 
335  Description [When this procedure is called PIs/POs of pNtk
336  point to the corresponding nodes in network with barbufs.]
337 
338  SideEffects []
339 
340  SeeAlso []
341 
342 ***********************************************************************/
344 {
345  Abc_Obj_t * pFanin; int i;
346  if ( pObj == NULL )
347  return Abc_NtkCreateNodeConst0( pNtk );
348  assert( Abc_ObjNtk(pObj) == pNew );
349  if ( pObj->pCopy )
350  return pObj->pCopy;
351  Abc_ObjForEachFanin( pObj, pFanin, i )
352  Gia_ManInsertOne_rec( pNtk, pNew, pFanin );
353  pObj->pCopy = Abc_NtkDupObj( pNtk, pObj, 0 );
354  Abc_ObjForEachFanin( pObj, pFanin, i )
355  Abc_ObjAddFanin( pObj, pFanin );
356  return pObj->pCopy;
357 }
358 void Gia_ManInsertOne( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNew )
359 {
360  Abc_Obj_t * pObj, * pBox; int i, k;
361  assert( !Abc_NtkHasMapping(pNtk) );
362  assert( Abc_NtkHasMapping(pNew) );
363  // check that PIs point to barbufs
364  Abc_NtkForEachPi( pNtk, pObj, i )
365  assert( !pObj->pCopy || Abc_ObjNtk(pObj->pCopy) == pNew );
366  // make barbufs point to box outputs
367  Abc_NtkForEachBox( pNtk, pBox, i )
368  Abc_ObjForEachFanout( pBox, pObj, k )
369  {
370  pObj->pCopy = Abc_NtkPo(Abc_ObjModel(pBox), k)->pCopy;
371  assert( !pObj->pCopy || Abc_ObjNtk(pObj->pCopy) == pNew );
372  }
373  // remove internal nodes
374  Abc_NtkForEachNode( pNtk, pObj, i )
375  Abc_NtkDeleteObj( pObj );
376  // start traversal from box inputs
377  Abc_NtkForEachBox( pNtk, pBox, i )
378  Abc_ObjForEachFanin( pBox, pObj, k )
379  if ( Abc_ObjFaninNum(pObj) == 0 )
380  Abc_ObjAddFanin( pObj, Gia_ManInsertOne_rec(pNtk, pNew, Abc_NtkPi(Abc_ObjModel(pBox), k)->pCopy) );
381  // start traversal from primary outputs
382  Abc_NtkForEachPo( pNtk, pObj, i )
383  if ( Abc_ObjFaninNum(pObj) == 0 )
384  Abc_ObjAddFanin( pObj, Gia_ManInsertOne_rec(pNtk, pNew, pObj->pCopy) );
385  // update the functionality manager
386  pNtk->pManFunc = pNew->pManFunc;
387  pNtk->ntkFunc = pNew->ntkFunc;
388  assert( Abc_NtkHasMapping(pNtk) );
389 }
390 void Abc_NtkInsertHierarchyGia( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNew, int fVerbose )
391 {
392  Vec_Ptr_t * vBuffers;
393  Gia_Man_t * pGia = Abc_NtkFlattenHierarchyGia( pNtk, &vBuffers, 0 );
394  Abc_Ntk_t * pModel;
395  Abc_Obj_t * pObj;
396  int i;
397 
398  assert( Gia_ManPiNum(pGia) == Abc_NtkPiNum(pNtk) );
399  assert( Gia_ManPiNum(pGia) == Abc_NtkPiNum(pNew) );
400  assert( Gia_ManPoNum(pGia) == Abc_NtkPoNum(pNtk) );
401  assert( Gia_ManPoNum(pGia) == Abc_NtkPoNum(pNew) );
402  assert( Gia_ManBufNum(pGia) == Vec_PtrSize(vBuffers) );
403  assert( Gia_ManBufNum(pGia) == pNew->nBarBufs2 );
404  Gia_ManStop( pGia );
405 
406  // clean the networks
407  if ( !pNtk->pDesign )
408  Abc_NtkCleanCopy( pNtk );
409  else
410  Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
411  Abc_NtkCleanCopy( pModel );
412 
413  // annotate PIs and POs of each network with barbufs
414  Abc_NtkForEachPi( pNew, pObj, i )
415  Abc_NtkPi(pNtk, i)->pCopy = pObj;
416  Abc_NtkForEachPo( pNew, pObj, i )
417  Abc_NtkPo(pNtk, i)->pCopy = pObj;
418  Abc_NtkForEachBarBuf( pNew, pObj, i )
419  ((Abc_Obj_t *)Vec_PtrEntry(vBuffers, i))->pCopy = pObj;
420  Vec_PtrFree( vBuffers );
421 
422  // connect each model
423  Abc_NtkCleanCopy( pNew );
424  Gia_ManInsertOne( pNtk, pNew );
425  if ( pNtk->pDesign )
426  Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
427  if ( pModel != pNtk )
428  Gia_ManInsertOne( pModel, pNew );
429 }
430 
431 ////////////////////////////////////////////////////////////////////////
432 /// END OF FILE ///
433 ////////////////////////////////////////////////////////////////////////
434 
435 
437 
int iTemp
Definition: abc.h:149
ABC_NAMESPACE_IMPL_START void Abc_NodeStrashToGia_rec(Gia_Man_t *pNew, Hop_Obj_t *pObj)
DECLARATIONS ///.
Definition: abcHieGia.c:45
static Hop_Obj_t * Hop_ObjFanin1(Hop_Obj_t *pObj)
Definition: hop.h:183
static int Hop_ObjIsMarkA(Hop_Obj_t *pObj)
Definition: hop.h:164
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static void Hop_ObjSetMarkA(Hop_Obj_t *pObj)
Definition: hop.h:165
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition: abcObj.c:843
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
int iData
Definition: abc.h:146
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
Definition: hop.h:132
static int Abc_ObjIsBo(Abc_Obj_t *pObj)
Definition: abc.h:350
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
Definition: abc.h:356
ABC_DLL void Abc_NtkFillTemp(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:553
static int Hop_ObjIsNode(Hop_Obj_t *pObj)
Definition: hop.h:160
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
int iData
Definition: hop.h:69
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
int nBarBufs2
Definition: abc.h:175
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition: abcObj.c:337
Vec_Int_t * vBarBufs
Definition: gia.h:146
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
static int Hop_ObjChild0CopyI(Hop_Obj_t *pObj)
Definition: hop.h:188
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void * Vec_PtrPop(Vec_Ptr_t *p)
Definition: vecPtr.h:677
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
Definition: hop.h:65
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition: hopDfs.c:257
static Abc_Ntk_t * Abc_ObjModel(Abc_Obj_t *pObj)
Definition: abc.h:335
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
int Gia_ManFlattenLogicPrepare(Abc_Ntk_t *pNtk)
Definition: abcHieGia.c:214
void * pData
Definition: abc.h:203
Gia_Man_t * Abc_NtkFlattenHierarchyGia(Abc_Ntk_t *pNtk, Vec_Ptr_t **pvBuffers, int fVerbose)
Definition: abcHieGia.c:277
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
Abc_Obj_t * pCopy
Definition: abc.h:148
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition: abcObj.c:167
char * pName
Definition: gia.h:97
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Gia_ManAppendBuf(Gia_Man_t *p, int iLit)
Definition: gia.h:694
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Abc_NtkForEachBarBuf(pNtk, pNode, i)
Definition: abc.h:479
static int Counter
void Abc_NtkFlattenHierarchyGia2_rec(Gia_Man_t *pNew, Abc_Ntk_t *pNtk, int *pCounter, Vec_Int_t *vBufs)
Definition: abcHieGia.c:89
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
Definition: hop.h:182
void Gia_ManInsertOne(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNew)
Definition: abcHieGia.c:358
#define Abc_NtkForEachBox(pNtk, pObj, i)
Definition: abc.h:495
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
Gia_Man_t * Abc_NtkFlattenHierarchyGia2(Abc_Ntk_t *pNtk)
Definition: abcHieGia.c:134
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
char * pSpec
Definition: abc.h:159
static int Hop_ObjChild1CopyI(Hop_Obj_t *pObj)
Definition: hop.h:189
Abc_Ntk_t * pNtk
Definition: abc.h:130
static int Abc_ObjIsBi(Abc_Obj_t *pObj)
Definition: abc.h:349
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
int Abc_NodeStrashToGia(Gia_Man_t *pNew, Abc_Obj_t *pNode)
Definition: abcHieGia.c:56
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Abc_NtkFunc_t ntkFunc
Definition: abc.h:157
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
Definition: abcObj.c:604
Definition: gia.h:95
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
static int Abc_ObjIsNet(Abc_Obj_t *pObj)
Definition: abc.h:354
static void Vec_PtrFreeP(Vec_Ptr_t **p)
Definition: vecPtr.h:240
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
Definition: abc.h:348
ABC_DLL Vec_Ptr_t * Abc_NtkDfsWithBoxes(Abc_Ntk_t *pNtk)
Definition: abcDfs.c:768
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:507
Vec_Ptr_t * vModules
Definition: abc.h:223
#define assert(ex)
Definition: util_old.h:213
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
void Abc_NtkInsertHierarchyGia(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNew, int fVerbose)
Definition: abcHieGia.c:390
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static void Vec_IntPrint(Vec_Int_t *vVec)
Definition: vecInt.h:1803
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
static Abc_Ntk_t * Abc_ObjNtk(Abc_Obj_t *pObj)
Definition: abc.h:334
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:315
void * pData
Definition: abc.h:145
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
Definition: abc.h:372
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static Hop_Obj_t * Hop_Regular(Hop_Obj_t *p)
Definition: hop.h:126
Abc_Des_t * pDesign
Definition: abc.h:180
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
int Abc_NtkFlattenHierarchyGia_rec(Gia_Man_t *pNew, Vec_Ptr_t *vSupers, Abc_Obj_t *pObj, Vec_Ptr_t *vBuffers)
Definition: abcHieGia.c:233
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
char * pName
Definition: abc.h:158
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition: hopOper.c:63
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
Abc_Obj_t * Gia_ManInsertOne_rec(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNew, Abc_Obj_t *pObj)
Definition: abcHieGia.c:343
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142