abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcTim.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcTim.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Testing hierarchy/timing manager.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcTim.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "base/abc/abc.h"
22 #include "aig/gia/giaAig.h"
23 #include "misc/tim/tim.h"
24 #include "opt/dar/dar.h"
25 #include "proof/dch/dch.h"
26 #include "base/main/main.h"
27 
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// DECLARATIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 #define TIM_TEST_BOX_RATIO 200
35 
36 // assume that every TIM_TEST_BOX_RATIO'th object is a white box
37 static inline int Abc_NodeIsWhiteBox( Abc_Obj_t * pObj ) { assert( Abc_ObjIsNode(pObj) ); return Abc_ObjId(pObj) % TIM_TEST_BOX_RATIO == 0 && Abc_ObjFaninNum(pObj) > 0 && Abc_ObjFaninNum(pObj) < 10; }
38 
39 ////////////////////////////////////////////////////////////////////////
40 /// FUNCTION DEFINITIONS ///
41 ////////////////////////////////////////////////////////////////////////
42 
43 /**Function*************************************************************
44 
45  Synopsis [Derives GIA for the output of the local function of one node.]
46 
47  Description []
48 
49  SideEffects []
50 
51  SeeAlso []
52 
53 ***********************************************************************/
55 {
56  assert( !Hop_IsComplement(pObj) );
57  if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
58  return;
61  pObj->iData = Gia_ManHashAnd( pGia, Hop_ObjChild0CopyI(pObj), Hop_ObjChild1CopyI(pObj) );
62  assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
63  Hop_ObjSetMarkA( pObj );
64 }
66 {
67  Hop_Man_t * pMan;
68  Hop_Obj_t * pRoot;
69  Abc_Obj_t * pFanin;
70  int i;
71  assert( Abc_ObjIsNode(pNode) );
72  assert( Abc_NtkIsAigLogic(pNode->pNtk) );
73  // get the local AIG manager and the local root node
74  pMan = (Hop_Man_t *)pNode->pNtk->pManFunc;
75  pRoot = (Hop_Obj_t *)pNode->pData;
76  // check the constant case
77  if ( Abc_NodeIsConst(pNode) || Hop_Regular(pRoot) == Hop_ManConst1(pMan) )
78  return !Hop_IsComplement(pRoot);
79  // set elementary variables
80  Abc_ObjForEachFanin( pNode, pFanin, i )
81  Hop_IthVar(pMan, i)->iData = pFanin->iTemp;
82  // strash the AIG of this node
85  // return the final node with complement if needed
86  return Abc_LitNotCond( Hop_Regular(pRoot)->iData, Hop_IsComplement(pRoot) );
87 }
88 
89 
90 #if 0
91 
92 /**Function*************************************************************
93 
94  Synopsis [Derives GIA manager using special pins to denote box boundaries.]
95 
96  Description []
97 
98  SideEffects []
99 
100  SeeAlso []
101 
102 ***********************************************************************/
103 Gia_Man_t * Abc_NtkTestPinDeriveGia( Abc_Ntk_t * pNtk, int fWhiteBoxOnly, int fVerbose )
104 {
105  Gia_Man_t * pTemp;
106  Gia_Man_t * pGia = NULL;
107  Vec_Ptr_t * vNodes;
108  Abc_Obj_t * pObj, * pFanin;
109  int i, k, iPinLit = 0;
110  // prepare logic network
111  assert( Abc_NtkIsLogic(pNtk) );
112  Abc_NtkToAig( pNtk );
113  // construct GIA
114  Abc_NtkFillTemp( pNtk );
115  pGia = Gia_ManStart( Abc_NtkObjNumMax(pNtk) );
116  Gia_ManHashAlloc( pGia );
117  // create primary inputs
118  Abc_NtkForEachCi( pNtk, pObj, i )
119  pObj->iTemp = Gia_ManAppendCi(pGia);
120  // create internal nodes in a topologic order from white boxes
121  vNodes = Abc_NtkDfs( pNtk, 0 );
122  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
123  {
124  // input side
125  if ( !fWhiteBoxOnly || Abc_NodeIsWhiteBox(pObj) )
126  {
127  // create special pintype for this node
128  iPinLit = Gia_ManAppendPinType( pGia, 1 );
129  // create input pins
130  Abc_ObjForEachFanin( pObj, pFanin, k )
131  pFanin->iTemp = Gia_ManAppendAnd( pGia, pFanin->iTemp, iPinLit );
132  }
133  // perform GIA construction
134  pObj->iTemp = Abc_NtkTestTimNodeStrash( pGia, pObj );
135  // output side
136  if ( !fWhiteBoxOnly || Abc_NodeIsWhiteBox(pObj) )
137  {
138  // create special pintype for this node
139  iPinLit = Gia_ManAppendPinType( pGia, 1 );
140  // create output pins
141  pObj->iTemp = Gia_ManAppendAnd( pGia, pObj->iTemp, iPinLit );
142  }
143  }
144  Vec_PtrFree( vNodes );
145  // create primary outputs
146  Abc_NtkForEachCo( pNtk, pObj, i )
147  pObj->iTemp = Gia_ManAppendCo( pGia, Abc_ObjFanin0(pObj)->iTemp );
148  // finalize GIA
149  Gia_ManHashStop( pGia );
150  Gia_ManSetRegNum( pGia, 0 );
151  // clean up GIA
152  pGia = Gia_ManCleanup( pTemp = pGia );
153  Gia_ManStop( pTemp );
154  return pGia;
155 }
156 
157 /**Function*************************************************************
158 
159  Synopsis []
160 
161  Description []
162 
163  SideEffects []
164 
165  SeeAlso []
166 
167 ***********************************************************************/
168 void Abc_NtkTestPinGia( Abc_Ntk_t * pNtk, int fWhiteBoxOnly, int fVerbose )
169 {
170  Gia_Man_t * pGia;
171  char * pFileName = "testpin.aig";
172  pGia = Abc_NtkTestPinDeriveGia( pNtk, fWhiteBoxOnly, fVerbose );
173  Gia_AigerWrite( pGia, pFileName, 0, 0 );
174  Gia_ManStop( pGia );
175  printf( "AIG with pins derived from mapped network \"%s\" was written into file \"%s\".\n",
176  Abc_NtkName(pNtk), pFileName );
177 }
178 
179 #endif
180 
181 /**Function*************************************************************
182 
183  Synopsis [Collect nodes reachable from this box.]
184 
185  Description []
186 
187  SideEffects []
188 
189  SeeAlso []
190 
191 ***********************************************************************/
192 void Abc_NtkTestTimCollectCone_rec( Abc_Obj_t * pObj, Vec_Ptr_t * vNodes )
193 {
194  Abc_Obj_t * pFanin;
195  int i;
196  if ( Abc_NodeIsTravIdCurrent( pObj ) )
197  return;
198  Abc_NodeSetTravIdCurrent( pObj );
199  if ( Abc_ObjIsCi(pObj) )
200  return;
201  assert( Abc_ObjIsNode( pObj ) );
202  Abc_ObjForEachFanin( pObj, pFanin, i )
203  Abc_NtkTestTimCollectCone_rec( pFanin, vNodes );
204  Vec_PtrPush( vNodes, pObj );
205 }
206 Vec_Ptr_t * Abc_NtkTestTimCollectCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj )
207 {
208  Vec_Ptr_t * vCone = Vec_PtrAlloc( 1000 );
209  if ( pObj != NULL )
210  {
211  // collect for one node
212  assert( Abc_ObjIsNode(pObj) );
213  assert( !Abc_NodeIsTravIdCurrent( pObj ) );
214  Abc_NtkTestTimCollectCone_rec( pObj, vCone );
215  // remove the node because it is a white box
216  Vec_PtrPop( vCone );
217  }
218  else
219  {
220  // collect for all COs
221  Abc_Obj_t * pObj;
222  int i;
223  Abc_NtkForEachCo( pNtk, pObj, i )
225  }
226  return vCone;
227 
228 }
229 
230 /**Function*************************************************************
231 
232  Synopsis [Create arrival times]
233 
234  Description []
235 
236  SideEffects []
237 
238  SeeAlso []
239 
240 ***********************************************************************/
242 {
243  Vec_Flt_t * p;
244  int i;
245  p = Vec_FltAlloc( nInputs );
246  for ( i = 0; i < nInputs; i++ )
247  Vec_FltPush( p, 1.0*(i % 10) );
248  return p;
249 }
251 {
252  Vec_Flt_t * p;
253  int i;
254  p = Vec_FltAlloc( nOutputs );
255  for ( i = 0; i < nOutputs; i++ )
256  Vec_FltPush( p, 100.0 + 1.0*i );
257  return p;
258 }
259 
260 /**Function*************************************************************
261 
262  Synopsis [Derives GIA manager together with the hierachy manager.]
263 
264  Description []
265 
266  SideEffects []
267 
268  SeeAlso []
269 
270 ***********************************************************************/
271 Gia_Man_t * Abc_NtkTestTimDeriveGia( Abc_Ntk_t * pNtk, int fVerbose )
272 {
273  Gia_Man_t * pTemp;
274  Gia_Man_t * pGia = NULL;
275  Gia_Man_t * pHoles = NULL;
276  Tim_Man_t * pTim = NULL;
277  Vec_Int_t * vGiaCoLits, * vGiaCoLits2;
278  Vec_Flt_t * vArrTimes, * vReqTimes;
279  Abc_Obj_t * pObj, * pFanin;
280  int i, k, Entry, curPi, curPo, BoxUniqueId;
281  int nBoxFaninMax = 0;
282  assert( Abc_NtkIsTopo(pNtk) );
283  Abc_NtkFillTemp( pNtk );
284 
285  // create white boxes
286  curPi = Abc_NtkCiNum(pNtk);
287  curPo = Abc_NtkCoNum(pNtk);
288  Abc_NtkForEachNode( pNtk, pObj, i )
289  {
290  pObj->fMarkA = Abc_NodeIsWhiteBox( pObj );
291  if ( !pObj->fMarkA )
292  continue;
293  nBoxFaninMax = Abc_MaxInt( nBoxFaninMax, Abc_ObjFaninNum(pObj) );
294  curPi++;
295  curPo += Abc_ObjFaninNum(pObj);
296  if ( fVerbose )
297  printf( "Selecting node %6d as white boxes with %d inputs and %d output.\n", i, Abc_ObjFaninNum(pObj), 1 );
298  }
299 
300  // construct GIA
301  pGia = Gia_ManStart( Abc_NtkObjNumMax(pNtk) );
302  pHoles = Gia_ManStart( 1000 );
303  for ( i = 0; i < curPi; i++ )
304  Gia_ManAppendCi(pGia);
305  for ( i = 0; i < nBoxFaninMax; i++ )
306  Gia_ManAppendCi(pHoles);
307  Gia_ManHashAlloc( pGia );
308  Gia_ManHashAlloc( pHoles );
309 
310  // construct the timing manager
311  pTim = Tim_ManStart( curPi, curPo );
312 
313  // assign primary inputs
314  curPi = 0;
315  curPo = 0;
316  Abc_NtkForEachCi( pNtk, pObj, i )
317  pObj->iTemp = Abc_Var2Lit( Gia_ObjId(pGia, Gia_ManCi(pGia, curPi++)), 0 );
318  // create internal nodes in a topologic order from white boxes
319  vGiaCoLits = Vec_IntAlloc( 1000 );
320  vGiaCoLits2 = Vec_IntAlloc( 1000 );
321  Abc_NtkForEachNode( pNtk, pObj, i )
322  {
323  if ( !pObj->fMarkA ) // not a white box
324  {
325  pObj->iTemp = Abc_NtkTestTimNodeStrash( pGia, pObj );
326  continue;
327  }
328  // create box
329  BoxUniqueId = Abc_ObjFaninNum(pObj); // in this case, the node size is the ID of its delay table
330  Tim_ManCreateBox( pTim, curPo, Abc_ObjFaninNum(pObj), curPi, 1, BoxUniqueId );
331  curPo += Abc_ObjFaninNum(pObj);
332 
333  // handle box inputs
334  Abc_ObjForEachFanin( pObj, pFanin, k )
335  {
336  // save CO drivers for the AIG
337  Vec_IntPush( vGiaCoLits, pFanin->iTemp );
338  // load CI nodes for the Holes
339  pFanin->iTemp = Abc_Var2Lit( Gia_ObjId(pHoles, Gia_ManCi(pHoles, k)), 0 );
340  }
341 
342  // handle logic of the box
343  pObj->iTemp = Abc_NtkTestTimNodeStrash( pHoles, pObj );
344 
345  // handle box outputs
346  // save CO drivers for the Holes
347  Vec_IntPush( vGiaCoLits2, pObj->iTemp );
348 // Gia_ManAppendCo( pHoles, pObj->iTemp );
349  // load CO drivers for the AIG
350  pObj->iTemp = Abc_Var2Lit( Gia_ObjId(pGia, Gia_ManCi(pGia, curPi++)), 0 );
351  }
352  Abc_NtkCleanMarkA( pNtk );
353  // create COs of the AIG
354  Abc_NtkForEachCo( pNtk, pObj, i )
355  Gia_ManAppendCo( pGia, Abc_ObjFanin0(pObj)->iTemp );
356  Vec_IntForEachEntry( vGiaCoLits, Entry, i )
357  Gia_ManAppendCo( pGia, Entry );
358  Vec_IntFree( vGiaCoLits );
359  // second AIG
360  Vec_IntForEachEntry( vGiaCoLits2, Entry, i )
361  Gia_ManAppendCo( pHoles, Entry );
362  Vec_IntFree( vGiaCoLits2 );
363  // check parameters
364  curPo += Abc_NtkPoNum( pNtk );
365  assert( curPi == Gia_ManPiNum(pGia) );
366  assert( curPo == Gia_ManPoNum(pGia) );
367  // finalize GIA
368  Gia_ManHashStop( pGia );
369  Gia_ManSetRegNum( pGia, 0 );
370  Gia_ManHashStop( pHoles );
371  Gia_ManSetRegNum( pHoles, 0 );
372 
373  // clean up GIA
374  pGia = Gia_ManCleanup( pTemp = pGia );
375  Gia_ManStop( pTemp );
376  pHoles = Gia_ManCleanup( pTemp = pHoles );
377  Gia_ManStop( pTemp );
378 
379  // attach the timing manager
380  assert( pGia->pManTime == NULL );
381  pGia->pManTime = pTim;
382 
383  // derive hierarchy manager from box info and input/output arrival/required info
384  vArrTimes = Abc_NtkTestCreateArrivals( Abc_NtkPiNum(pNtk) );
385  vReqTimes = Abc_NtkTestCreateRequired( Abc_NtkPoNum(pNtk) );
386 
387  Tim_ManPrint( (Tim_Man_t *)pGia->pManTime );
388  Tim_ManCreate( (Tim_Man_t *)pGia->pManTime, Abc_FrameReadLibBox(), vArrTimes, vReqTimes );
389  Tim_ManPrint( (Tim_Man_t *)pGia->pManTime );
390 
391  Vec_FltFree( vArrTimes );
392  Vec_FltFree( vReqTimes );
393 
394 Gia_AigerWrite( pHoles, "holes00.aig", 0, 0 );
395 
396  // return
397  pGia->pAigExtra = pHoles;
398  return pGia;
399 }
400 
401 
402 /**Function*************************************************************
403 
404  Synopsis [Performs synthesis with or without structural choices.]
405 
406  Description []
407 
408  SideEffects []
409 
410  SeeAlso []
411 
412 ***********************************************************************/
414 {
415  Gia_Man_t * pGia;
416  Aig_Man_t * pNew, * pTemp;
417  Dch_Pars_t Pars, * pPars = &Pars;
418  Dch_ManSetDefaultParams( pPars );
419  pNew = Gia_ManToAig( p, 0 );
420  if ( fChoices )
421  pNew = Dar_ManChoiceNew( pNew, pPars );
422  else
423  {
424  pNew = Dar_ManCompress2( pTemp = pNew, 1, 1, 1, 0, 0 );
425  Aig_ManStop( pTemp );
426  }
427  pGia = Gia_ManFromAig( pNew );
428  Aig_ManStop( pNew );
429  return pGia;
430 }
431 
432 /**Function*************************************************************
433 
434  Synopsis []
435 
436  Description []
437 
438  SideEffects []
439 
440  SeeAlso []
441 
442 ***********************************************************************/
444 {
445  Gia_Obj_t * pObj;
446  int i, iRepr, iNode, fProb = 0;
447  assert( p->pReprs );
448 
449  // mark nodes
451  Gia_ManForEachClass( p, iRepr )
452  Gia_ClassForEachObj1( p, iRepr, iNode )
453  {
454  if ( Gia_ObjIsHead(p, iNode) )
455  printf( "Member %d of choice class %d is a representative.\n", iNode, iRepr ), fProb = 1;
456  if ( Gia_ManObj( p, iNode )->fMark0 == 1 )
457  printf( "Node %d participates in more than one choice node.\n", iNode ), fProb = 1;
458  Gia_ManObj( p, iNode )->fMark0 = 1;
459  }
461 
462  Gia_ManForEachObj( p, pObj, i )
463  {
464  if ( Gia_ObjIsAnd(pObj) )
465  {
466  if ( Gia_ObjHasRepr(p, Gia_ObjFaninId0(pObj, i)) )
467  printf( "Fanin 0 of AND node %d has a repr.\n", i ), fProb = 1;
468  if ( Gia_ObjHasRepr(p, Gia_ObjFaninId1(pObj, i)) )
469  printf( "Fanin 1 of AND node %d has a repr.\n", i ), fProb = 1;
470  }
471  else if ( Gia_ObjIsCo(pObj) )
472  {
473  if ( Gia_ObjHasRepr(p, Gia_ObjFaninId0(pObj, i)) )
474  printf( "Fanin 0 of CO node %d has a repr.\n", i ), fProb = 1;
475  }
476  }
477 // if ( !fProb )
478 // printf( "GIA with choices is correct.\n" );
479 }
480 
481 /**Function*************************************************************
482 
483  Synopsis [Reverse the order of nodes in equiv classes.]
484 
485  Description [If the flag is 1, assumed current increasing order ]
486 
487  SideEffects []
488 
489  SeeAlso []
490 
491 ***********************************************************************/
492 void Gia_ManReverseClasses( Gia_Man_t * p, int fNowIncreasing )
493 {
494  Vec_Int_t * vCollected;
495  Vec_Int_t * vClass;
496  int i, k, iRepr, iNode, iPrev;
497  // collect classes
498  vCollected = Vec_IntAlloc( 100 );
499  Gia_ManForEachClass( p, iRepr )
500  Vec_IntPush( vCollected, iRepr );
501  // correct each class
502  vClass = Vec_IntAlloc( 100 );
503  Vec_IntForEachEntry( vCollected, iRepr, i )
504  {
505  Vec_IntClear( vClass );
506  Vec_IntPush( vClass, iRepr );
507  Gia_ClassForEachObj1( p, iRepr, iNode )
508  {
509  if ( fNowIncreasing )
510  assert( iRepr < iNode );
511  else
512  assert( iRepr > iNode );
513  Vec_IntPush( vClass, iNode );
514  }
515 // if ( !fNowIncreasing )
516 // Vec_IntSort( vClass, 1 );
517  // reverse the class
518  iPrev = 0;
519  iRepr = Vec_IntEntryLast( vClass );
520  Vec_IntForEachEntry( vClass, iNode, k )
521  {
522  if ( fNowIncreasing )
523  Gia_ObjSetReprRev( p, iNode, iNode == iRepr ? GIA_VOID : iRepr );
524  else
525  Gia_ObjSetRepr( p, iNode, iNode == iRepr ? GIA_VOID : iRepr );
526  Gia_ObjSetNext( p, iNode, iPrev );
527  iPrev = iNode;
528  }
529  }
530  Vec_IntFree( vCollected );
531  Vec_IntFree( vClass );
532  // verify
533  Gia_ManForEachClass( p, iRepr )
534  Gia_ClassForEachObj1( p, iRepr, iNode )
535  if ( fNowIncreasing )
536  assert( Gia_ObjRepr(p, iNode) == iRepr && iRepr > iNode );
537  else
538  assert( Gia_ObjRepr(p, iNode) == iRepr && iRepr < iNode );
539 }
540 
541 /**Function*************************************************************
542 
543  Synopsis [Tests the hierarchy-timing manager.]
544 
545  Description []
546 
547  SideEffects []
548 
549  SeeAlso []
550 
551 ***********************************************************************/
552 void Abc_NtkTestTimByWritingFile( Gia_Man_t * pGia, char * pFileName )
553 {
554  Gia_Man_t * pGia2;
555 
556  // normalize choices
557  if ( Gia_ManHasChoices(pGia) )
558  {
559  Gia_ManVerifyChoices( pGia );
560  Gia_ManReverseClasses( pGia, 0 );
561  }
562  // write file
563  Gia_AigerWrite( pGia, pFileName, 0, 0 );
564  // unnormalize choices
565  if ( Gia_ManHasChoices(pGia) )
566  Gia_ManReverseClasses( pGia, 1 );
567 
568  // read file
569  pGia2 = Gia_AigerRead( pFileName, 1, 1 );
570 
571  // normalize choices
572  if ( Gia_ManHasChoices(pGia2) )
573  {
574  Gia_ManVerifyChoices( pGia2 );
575  Gia_ManReverseClasses( pGia2, 1 );
576  }
577 
578  // compare resulting managers
579  if ( Gia_ManCompare( pGia, pGia2 ) )
580  printf( "Verification suceessful.\n" );
581 
582  Gia_ManStop( pGia2 );
583 }
584 
585 /**Function*************************************************************
586 
587  Synopsis [Tests construction and serialization.]
588 
589  Description []
590 
591  SideEffects []
592 
593  SeeAlso []
594 
595 ***********************************************************************/
596 void Abc_NtkTestTim( Abc_Ntk_t * pNtk, int fVerbose )
597 {
598  int fUseChoices = 0;
599  Gia_Man_t * pGia, * pTemp;
600 
601  // this test only works for a logic network (for example, network with LUT mapping)
602  assert( Abc_NtkIsLogic(pNtk) );
603  // make sure local functions of the nodes are in the AIG form
604  Abc_NtkToAig( pNtk );
605 
606  // create GIA manager (pGia) with hierarhy/timing manager attached (pGia->pManTime)
607  // while assuming that some nodes are white boxes (see Abc_NodeIsWhiteBox)
608  pGia = Abc_NtkTestTimDeriveGia( pNtk, fVerbose );
609  printf( "Created GIA manager for network with %d white boxes.\n", Tim_ManBoxNum((Tim_Man_t *)pGia->pManTime) );
610 
611  // print the timing manager
612  if ( fVerbose )
613  Tim_ManPrint( (Tim_Man_t *)pGia->pManTime );
614 
615  // test writing both managers into a file and reading them back
616  Abc_NtkTestTimByWritingFile( pGia, "test1.aig" );
617 
618  // perform synthesis
619  pGia = Abc_NtkTestTimPerformSynthesis( pTemp = pGia, fUseChoices );
620  Gia_ManStop( pTemp );
621 
622  // test writing both managers into a file and reading them back
623  Abc_NtkTestTimByWritingFile( pGia, "test2.aig" );
624 
625  Gia_ManStop( pGia );
626 }
627 
628 
629 
630 
631 ////////////////////////////////////////////////////////////////////////
632 /// END OF FILE ///
633 ////////////////////////////////////////////////////////////////////////
634 
635 
637 
int iTemp
Definition: abc.h:149
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: gia.h:592
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_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
Vec_Flt_t * Abc_NtkTestCreateRequired(int nOutputs)
Definition: abcTim.c:250
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
Aig_Man_t * Dar_ManChoiceNew(Aig_Man_t *pAig, Dch_Pars_t *pPars)
Definition: darScript.c:849
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
unsigned fMarkA
Definition: abc.h:134
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
Gia_Man_t * pAigExtra
Definition: gia.h:149
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
static Hop_Obj_t * Hop_ManConst1(Hop_Man_t *p)
Definition: hop.h:132
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Gia_Obj_t * Gia_ManCi(Gia_Man_t *p, int v)
Definition: gia.h:403
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
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
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
int Gia_ManCompare(Gia_Man_t *p1, Gia_Man_t *p2)
Definition: giaUtil.c:1511
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
int iData
Definition: hop.h:69
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
static void Vec_FltFree(Vec_Flt_t *p)
Definition: vecFlt.h:218
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition: giaUtil.c:215
static int Abc_Var2Lit(int Var, int fCompl)
Definition: abc_global.h:263
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static int Hop_ObjChild0CopyI(Hop_Obj_t *pObj)
Definition: hop.h:188
static int Gia_ObjIsHead(Gia_Man_t *p, int Id)
Definition: gia.h:916
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static Vec_Flt_t * Vec_FltAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecFlt.h:78
Vec_Ptr_t * Abc_NtkTestTimCollectCone(Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
Definition: abcTim.c:206
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static void * Vec_PtrPop(Vec_Ptr_t *p)
Definition: vecPtr.h:677
void Gia_ManReverseClasses(Gia_Man_t *p, int fNowIncreasing)
Definition: abcTim.c:492
static int Abc_NtkIsAigLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:266
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: hop.h:65
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
static void Vec_FltPush(Vec_Flt_t *p, float Entry)
Definition: vecFlt.h:528
Definition: gia.h:75
int Abc_NtkTestTimNodeStrash(Gia_Man_t *pGia, Abc_Obj_t *pNode)
Definition: abcTim.c:65
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition: hopDfs.c:257
static int Gia_ManHasChoices(Gia_Man_t *p)
Definition: gia.h:397
void Tim_ManCreate(Tim_Man_t *p, void *pLib, Vec_Flt_t *vInArrs, Vec_Flt_t *vOutReqs)
Definition: timMan.c:403
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable)
ITERATORS ///.
Definition: timBox.c:44
void Abc_NtkTestTimNodeStrash_rec(Gia_Man_t *pGia, Hop_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition: abcTim.c:54
void Tim_ManPrint(Tim_Man_t *p)
Definition: timMan.c:523
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition: giaAig.c:73
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:888
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL void Abc_NtkCleanMarkA(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:663
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Aig_Man_t * Dar_ManCompress2(Aig_Man_t *pAig, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose)
Definition: darScript.c:235
ABC_DLL int Abc_NtkIsTopo(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:2839
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
if(last==0)
Definition: sparse_int.h:34
ABC_DLL void * Abc_FrameReadLibBox()
Definition: mainFrame.c:55
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
#define Gia_ClassForEachObj1(p, i, iObj)
Definition: gia.h:933
Gia_Man_t * Abc_NtkTestTimDeriveGia(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcTim.c:271
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition: giaAig.c:277
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
Definition: timMan.c:45
void * pManTime
Definition: gia.h:165
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
int Tim_ManBoxNum(Tim_Man_t *p)
Definition: timMan.c:702
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
Definition: hop.h:182
void Abc_NtkTestTim(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcTim.c:596
static void Gia_ObjSetReprRev(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:889
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
Gia_Man_t * Abc_NtkTestTimPerformSynthesis(Gia_Man_t *p, int fChoices)
Definition: abcTim.c:413
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void Gia_ObjSetNext(Gia_Man_t *p, int Id, int Num)
Definition: gia.h:913
void Abc_NtkTestTimByWritingFile(Gia_Man_t *pGia, char *pFileName)
Definition: abcTim.c:552
static int Vec_IntEntryLast(Vec_Int_t *p)
Definition: bblif.c:319
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
static int Hop_ObjChild1CopyI(Hop_Obj_t *pObj)
Definition: hop.h:189
#define GIA_VOID
Definition: gia.h:45
Abc_Ntk_t * pNtk
Definition: abc.h:130
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
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
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
unsigned fMark0
Definition: gia.h:79
Definition: gia.h:95
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: gia.h:984
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
#define Gia_ManForEachClass(p, i)
Definition: gia.h:927
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
Gia_Rpr_t * pReprs
Definition: gia.h:121
static int Abc_NodeIsWhiteBox(Abc_Obj_t *pObj)
Definition: abcTim.c:37
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition: giaHash.c:99
void * pData
Definition: abc.h:145
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#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
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
Definition: gia.h:461
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
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
void Gia_ManVerifyChoices(Gia_Man_t *p)
Definition: abcTim.c:443
Vec_Flt_t * Abc_NtkTestCreateArrivals(int nInputs)
Definition: abcTim.c:241
static int Gia_ObjRepr(Gia_Man_t *p, int Id)
Definition: gia.h:887
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
Definition: gia.h:460
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
static int Gia_ObjHasRepr(Gia_Man_t *p, int Id)
Definition: gia.h:891
void Abc_NtkTestTimCollectCone_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition: abcTim.c:192
#define TIM_TEST_BOX_RATIO
DECLARATIONS ///.
Definition: abcTim.c:34