abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cbaSimple.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [cbaSimple.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Verilog parser.]
8 
9  Synopsis [Parses several flavors of word-level Verilog.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - November 29, 2014.]
16 
17  Revision [$Id: cbaSimple.c,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "cba.h"
22 #include "base/abc/abc.h"
23 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 /*
31 design = array containing design name (as the first entry in the array) followed by pointers to modules
32 module = array containing module name (as the first entry in the array) followed by pointers to four arrays:
33  {array of input names; array of output names; array of nodes; array of boxes}
34 node = array containing output name, followed by node type, followed by input names
35 box = array containing model name, instance name, followed by pairs of formal/actual names for each port
36 */
37 
38 typedef enum {
39  PTR_OBJ_NONE, // 0: non-existent object
40  PTR_OBJ_CONST0, // 1: constant node
41  PTR_OBJ_PI, // 2: primary input
42  PTR_OBJ_PO, // 3: primary output
43  PTR_OBJ_FAN, // 4: box output
44  PTR_OBJ_FLOP, // 5: flip-flop
45  PTR_OBJ_BOX, // 6: box
46  PTR_OBJ_NODE, // 7: logic node
47 
48  PTR_OBJ_C0, // 8: logic node
49  PTR_OBJ_C1, // 9: logic node
50  PTR_OBJ_BUF, // 0: logic node
51  PTR_OBJ_INV, // 1: logic node
52  PTR_OBJ_AND, // 2: logic node
53  PTR_OBJ_OR, // 3: logic node
54  PTR_OBJ_XOR, // 4: logic node
55  PTR_OBJ_NAND, // 5: logic node
56  PTR_OBJ_NOR, // 6: logic node
57  PTR_OBJ_XNOR, // 7: logic node
58  PTR_OBJ_MUX, // 8: logic node
59  PTR_OBJ_MAJ, // 9: logic node
60 
61  PTR_VOID // 0: placeholder
63 
64 
65 ////////////////////////////////////////////////////////////////////////
66 /// FUNCTION DEFINITIONS ///
67 ////////////////////////////////////////////////////////////////////////
68 
69 /**Function*************************************************************
70 
71  Synopsis [Node type conversions.]
72 
73  Description []
74 
75  SideEffects []
76 
77  SeeAlso []
78 
79 ***********************************************************************/
81 {
82  if ( Type == PTR_OBJ_BUF ) return "buf";
83  if ( Type == PTR_OBJ_INV ) return "not";
84  if ( Type == PTR_OBJ_AND ) return "and";
85  if ( Type == PTR_OBJ_OR ) return "or";
86  if ( Type == PTR_OBJ_XOR ) return "xor";
87  if ( Type == PTR_OBJ_XNOR ) return "xnor";
88  assert( 0 );
89  return "???";
90 }
92 {
93  if ( Type == PTR_OBJ_BUF ) return "1 1\n";
94  if ( Type == PTR_OBJ_INV ) return "0 1\n";
95  if ( Type == PTR_OBJ_AND ) return "11 1\n";
96  if ( Type == PTR_OBJ_OR ) return "00 0\n";
97  if ( Type == PTR_OBJ_XOR ) return "01 1\n10 1\n";
98  if ( Type == PTR_OBJ_XNOR ) return "00 1\n11 1\n";
99  assert( 0 );
100  return "???";
101 }
103 {
104  if ( !strcmp(pSop, "1 1\n") ) return PTR_OBJ_BUF;
105  if ( !strcmp(pSop, "0 1\n") ) return PTR_OBJ_INV;
106  if ( !strcmp(pSop, "11 1\n") ) return PTR_OBJ_AND;
107  if ( !strcmp(pSop, "00 0\n") ) return PTR_OBJ_OR;
108  if ( !strcmp(pSop, "-1 1\n1- 1\n") ) return PTR_OBJ_OR;
109  if ( !strcmp(pSop, "1- 1\n-1 1\n") ) return PTR_OBJ_OR;
110  if ( !strcmp(pSop, "01 1\n10 1\n") ) return PTR_OBJ_XOR;
111  if ( !strcmp(pSop, "10 1\n01 1\n") ) return PTR_OBJ_XOR;
112  if ( !strcmp(pSop, "11 1\n00 1\n") ) return PTR_OBJ_XNOR;
113  if ( !strcmp(pSop, "00 1\n11 1\n") ) return PTR_OBJ_XNOR;
114  assert( 0 );
115  return PTR_OBJ_NONE;
116 }
118 {
119  static word uTruth, uTruths6[3] = {
120  ABC_CONST(0xAAAAAAAAAAAAAAAA),
121  ABC_CONST(0xCCCCCCCCCCCCCCCC),
122  ABC_CONST(0xF0F0F0F0F0F0F0F0),
123  };
124  assert( Abc_ObjIsNode(pObj) );
125  uTruth = Hop_ManComputeTruth6( (Hop_Man_t *)Abc_ObjNtk(pObj)->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj) );
126  if ( uTruth == uTruths6[0] ) return PTR_OBJ_BUF;
127  if ( uTruth == ~uTruths6[0] ) return PTR_OBJ_INV;
128  if ( uTruth == (uTruths6[0] & uTruths6[1]) ) return PTR_OBJ_AND;
129  if ( uTruth == (uTruths6[0] | uTruths6[1]) ) return PTR_OBJ_OR;
130  if ( uTruth == (uTruths6[0] ^ uTruths6[1]) ) return PTR_OBJ_XOR;
131  if ( uTruth == (uTruths6[0] ^~uTruths6[1]) ) return PTR_OBJ_XNOR;
132  assert( 0 );
133  return PTR_OBJ_NONE;
134 }
135 
136 /**Function*************************************************************
137 
138  Synopsis [Dumping hierarchical Abc_Ntk_t in Ptr form.]
139 
140  Description []
141 
142  SideEffects []
143 
144  SeeAlso []
145 
146 ***********************************************************************/
147 static inline char * Ptr_ObjName( Abc_Obj_t * pObj )
148 {
149  if ( Abc_ObjIsNet(pObj) || Abc_ObjIsBox(pObj) )
150  return Abc_ObjName(pObj);
151  if ( Abc_ObjIsCi(pObj) || Abc_ObjIsNode(pObj) )
152  return Ptr_ObjName(Abc_ObjFanout0(pObj));
153  if ( Abc_ObjIsCo(pObj) )
154  return Ptr_ObjName(Abc_ObjFanin0(pObj));
155  assert( 0 );
156  return NULL;
157 }
158 static int Ptr_ManCheckArray( Vec_Ptr_t * vArray )
159 {
160  if ( Vec_PtrSize(vArray) == 0 )
161  return 1;
162  if ( Abc_MaxInt(8, Vec_PtrSize(vArray)) == Vec_PtrCap(vArray) )
163  return 1;
164  assert( 0 );
165  return 0;
166 }
168 {
169  Abc_Obj_t * pFanin; int i;
170  Vec_Ptr_t * vNode = Vec_PtrAlloc( 2 + Abc_ObjFaninNum(pObj) );
171  assert( Abc_ObjIsNode(pObj) );
172  Vec_PtrPush( vNode, Ptr_ObjName(pObj) );
173  Vec_PtrPush( vNode, Abc_Int2Ptr(Ptr_HopToType(pObj)) );
174  Abc_ObjForEachFanin( pObj, pFanin, i )
175  Vec_PtrPush( vNode, Ptr_ObjName(pFanin) );
176  assert( Ptr_ManCheckArray(vNode) );
177  return vNode;
178 }
180 {
181  Abc_Obj_t * pObj; int i;
182  Vec_Ptr_t * vNodes = Vec_PtrAlloc( Abc_NtkNodeNum(pNtk) );
183  Abc_NtkForEachNode( pNtk, pObj, i )
184  Vec_PtrPush( vNodes, Ptr_ManDumpNode(pObj) );
185  assert( Ptr_ManCheckArray(vNodes) );
186  return vNodes;
187 }
188 
190 {
191  Abc_Obj_t * pNext; int i;
192  Abc_Ntk_t * pModel = Abc_ObjModel(pObj);
193  Vec_Ptr_t * vBox = Vec_PtrAlloc( 2 + 2 * Abc_ObjFaninNum(pObj) + 2 * Abc_ObjFanoutNum(pObj) );
194  assert( Abc_ObjIsBox(pObj) );
195  Vec_PtrPush( vBox, Abc_NtkName(pModel) );
196  Vec_PtrPush( vBox, Ptr_ObjName(pObj) );
197  Abc_ObjForEachFanin( pObj, pNext, i )
198  {
199  Vec_PtrPush( vBox, Ptr_ObjName(Abc_NtkPi(pModel, i)) );
200  Vec_PtrPush( vBox, Ptr_ObjName(pNext) );
201  }
202  Abc_ObjForEachFanout( pObj, pNext, i )
203  {
204  Vec_PtrPush( vBox, Ptr_ObjName(Abc_NtkPo(pModel, i)) );
205  Vec_PtrPush( vBox, Ptr_ObjName(pNext) );
206  }
207  assert( Ptr_ManCheckArray(vBox) );
208  return vBox;
209 }
211 {
212  Abc_Obj_t * pObj; int i;
213  Vec_Ptr_t * vBoxes = Vec_PtrAlloc( Abc_NtkBoxNum(pNtk) );
214  Abc_NtkForEachBox( pNtk, pObj, i )
215  Vec_PtrPush( vBoxes, Ptr_ManDumpBox(pObj) );
216  assert( Ptr_ManCheckArray(vBoxes) );
217  return vBoxes;
218 }
219 
221 {
222  Abc_Obj_t * pObj; int i;
223  Vec_Ptr_t * vSigs = Vec_PtrAlloc( Abc_NtkPiNum(pNtk) );
224  Abc_NtkForEachPi( pNtk, pObj, i )
225  Vec_PtrPush( vSigs, Ptr_ObjName(pObj) );
226  assert( Ptr_ManCheckArray(vSigs) );
227  return vSigs;
228 }
230 {
231  Abc_Obj_t * pObj; int i;
232  Vec_Ptr_t * vSigs = Vec_PtrAlloc( Abc_NtkPoNum(pNtk) );
233  Abc_NtkForEachPo( pNtk, pObj, i )
234  Vec_PtrPush( vSigs, Ptr_ObjName(pObj) );
235  assert( Ptr_ManCheckArray(vSigs) );
236  return vSigs;
237 }
239 {
240  Vec_Ptr_t * vNtk = Vec_PtrAlloc( 5 );
241  Vec_PtrPush( vNtk, Abc_NtkName(pNtk) );
242  Vec_PtrPush( vNtk, Ptr_ManDumpInputs(pNtk) );
243  Vec_PtrPush( vNtk, Ptr_ManDumpOutputs(pNtk) );
244  Vec_PtrPush( vNtk, Ptr_ManDumpNodes(pNtk) );
245  Vec_PtrPush( vNtk, Ptr_ManDumpBoxes(pNtk) );
246  assert( Ptr_ManCheckArray(vNtk) );
247  return vNtk;
248 }
250 {
251  Vec_Ptr_t * vDes;
252  Abc_Ntk_t * pTemp; int i;
253  vDes = Vec_PtrAlloc( 1 + Vec_PtrSize(pNtk->pDesign->vModules) );
254  Vec_PtrPush( vDes, pNtk->pDesign->pName );
255  Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pTemp, i )
256  Vec_PtrPush( vDes, Ptr_ManDumpNtk(pTemp) );
257  assert( Ptr_ManCheckArray(vDes) );
258  return vDes;
259 }
260 
261 /**Function*************************************************************
262 
263  Synopsis [Dumping Ptr into a Verilog file.]
264 
265  Description []
266 
267  SideEffects []
268 
269  SeeAlso []
270 
271 ***********************************************************************/
272 void Ptr_ManDumpNodeToBlif( FILE * pFile, Vec_Ptr_t * vNode )
273 {
274  char * pName; int i;
275  fprintf( pFile, ".names" );
276  Vec_PtrForEachEntryStart( char *, vNode, pName, i, 2 )
277  fprintf( pFile, " %s", pName );
278  fprintf( pFile, " %s\n", (char *)Vec_PtrEntry(vNode, 0) );
279  fprintf( pFile, "%s", Ptr_TypeToSop( (Ptr_ObjType_t)Abc_Ptr2Int(Vec_PtrEntry(vNode, 1)) ) );
280 }
281 void Ptr_ManDumpNodesToBlif( FILE * pFile, Vec_Ptr_t * vNodes )
282 {
283  Vec_Ptr_t * vNode; int i;
284  Vec_PtrForEachEntry( Vec_Ptr_t *, vNodes, vNode, i )
285  Ptr_ManDumpNodeToBlif( pFile, vNode );
286 }
287 
288 void Ptr_ManDumpBoxToBlif( FILE * pFile, Vec_Ptr_t * vBox )
289 {
290  char * pName; int i;
291  fprintf( pFile, "%s", (char *)Vec_PtrEntry(vBox, 0) );
292  Vec_PtrForEachEntryStart( char *, vBox, pName, i, 2 )
293  fprintf( pFile, " %s=%s", pName, (char *)Vec_PtrEntry(vBox, i+1) ), i++;
294  fprintf( pFile, "\n" );
295 }
296 void Ptr_ManDumpBoxesToBlif( FILE * pFile, Vec_Ptr_t * vBoxes )
297 {
298  Vec_Ptr_t * vBox; int i;
299  Vec_PtrForEachEntry( Vec_Ptr_t *, vBoxes, vBox, i )
300  Ptr_ManDumpBoxToBlif( pFile, vBox );
301 }
302 
303 void Ptr_ManDumpSignalsToBlif( FILE * pFile, Vec_Ptr_t * vSigs, int fSkipLastComma )
304 {
305  char * pSig; int i;
306  Vec_PtrForEachEntry( char *, vSigs, pSig, i )
307  fprintf( pFile, " %s", pSig );
308 }
309 void Ptr_ManDumpModuleToBlif( FILE * pFile, Vec_Ptr_t * vNtk )
310 {
311  fprintf( pFile, ".model %s\n", (char *)Vec_PtrEntry(vNtk, 0) );
312  fprintf( pFile, ".inputs" );
313  Ptr_ManDumpSignalsToBlif( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1), 0 );
314  fprintf( pFile, "\n" );
315  fprintf( pFile, ".outputs" );
316  Ptr_ManDumpSignalsToBlif( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2), 1 );
317  fprintf( pFile, "\n\n" );
318  Ptr_ManDumpNodesToBlif( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 3) );
319  fprintf( pFile, "\n" );
320  Ptr_ManDumpBoxesToBlif( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 4) );
321  fprintf( pFile, "\n" );
322  fprintf( pFile, ".end\n\n" );
323 }
324 void Ptr_ManDumpToBlif( char * pFileName, Vec_Ptr_t * vDes )
325 {
326  FILE * pFile;
327  Vec_Ptr_t * vNtk; int i;
328  pFile = fopen( pFileName, "wb" );
329  if ( pFile == NULL )
330  {
331  printf( "Cannot open output file \"%s\".\n", pFileName );
332  return;
333  }
334  fprintf( pFile, "// Design \"%s\" written by ABC on %s\n\n", (char *)Vec_PtrEntry(vDes, 0), Extra_TimeStamp() );
335  Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
336  Ptr_ManDumpModuleToBlif( pFile, vNtk );
337  fclose( pFile );
338 }
339 
340 /**Function*************************************************************
341 
342  Synopsis [Dumping Ptr into a Verilog file.]
343 
344  Description []
345 
346  SideEffects []
347 
348  SeeAlso []
349 
350 ***********************************************************************/
351 void Ptr_ManDumpNodeToFile( FILE * pFile, Vec_Ptr_t * vNode )
352 {
353  char * pName; int i;
354  fprintf( pFile, "%s", Ptr_TypeToName( (Ptr_ObjType_t)Abc_Ptr2Int(Vec_PtrEntry(vNode, 1)) ) );
355  fprintf( pFile, "( %s", (char *)Vec_PtrEntry(vNode, 0) );
356  Vec_PtrForEachEntryStart( char *, vNode, pName, i, 2 )
357  fprintf( pFile, ", %s", pName );
358  fprintf( pFile, " );\n" );
359 }
360 void Ptr_ManDumpNodesToFile( FILE * pFile, Vec_Ptr_t * vNodes )
361 {
362  Vec_Ptr_t * vNode; int i;
363  Vec_PtrForEachEntry( Vec_Ptr_t *, vNodes, vNode, i )
364  Ptr_ManDumpNodeToFile( pFile, vNode );
365 }
366 
367 void Ptr_ManDumpBoxToFile( FILE * pFile, Vec_Ptr_t * vBox )
368 {
369  char * pName; int i;
370  fprintf( pFile, "%s %s (", (char *)Vec_PtrEntry(vBox, 0), (char *)Vec_PtrEntry(vBox, 1) );
371  Vec_PtrForEachEntryStart( char *, vBox, pName, i, 2 )
372  fprintf( pFile, " .%s(%s)%s", pName, (char *)Vec_PtrEntry(vBox, i+1), i >= Vec_PtrSize(vBox)-2 ? "" : "," ), i++;
373  fprintf( pFile, " );\n" );
374 }
375 void Ptr_ManDumpBoxesToFile( FILE * pFile, Vec_Ptr_t * vBoxes )
376 {
377  Vec_Ptr_t * vBox; int i;
378  Vec_PtrForEachEntry( Vec_Ptr_t *, vBoxes, vBox, i )
379  Ptr_ManDumpBoxToFile( pFile, vBox );
380 }
381 
382 void Ptr_ManDumpSignalsToFile( FILE * pFile, Vec_Ptr_t * vSigs, int fSkipLastComma )
383 {
384  char * pSig; int i;
385  Vec_PtrForEachEntry( char *, vSigs, pSig, i )
386  fprintf( pFile, " %s%s", pSig, (fSkipLastComma && i == Vec_PtrSize(vSigs)-1) ? "" : "," );
387 }
388 void Ptr_ManDumpModuleToFile( FILE * pFile, Vec_Ptr_t * vNtk )
389 {
390  fprintf( pFile, "module %s\n", (char *)Vec_PtrEntry(vNtk, 0) );
391  fprintf( pFile, "(\n" );
392  Ptr_ManDumpSignalsToFile( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1), 0 );
393  fprintf( pFile, "\n" );
394  Ptr_ManDumpSignalsToFile( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2), 1 );
395  fprintf( pFile, "\n);\ninput" );
396  Ptr_ManDumpSignalsToFile( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1), 1 );
397  fprintf( pFile, ";\noutput" );
398  Ptr_ManDumpSignalsToFile( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2), 1 );
399  fprintf( pFile, ";\n\n" );
400  Ptr_ManDumpNodesToFile( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 3) );
401  fprintf( pFile, "\n" );
402  Ptr_ManDumpBoxesToFile( pFile, (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 4) );
403  fprintf( pFile, "endmodule\n\n" );
404 }
405 void Ptr_ManDumpToFile( char * pFileName, Vec_Ptr_t * vDes )
406 {
407  FILE * pFile;
408  Vec_Ptr_t * vNtk; int i;
409  pFile = fopen( pFileName, "wb" );
410  if ( pFile == NULL )
411  {
412  printf( "Cannot open output file \"%s\".\n", pFileName );
413  return;
414  }
415  fprintf( pFile, "// Design \"%s\" written by ABC on %s\n\n", (char *)Vec_PtrEntry(vDes, 0), Extra_TimeStamp() );
416  Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
417  Ptr_ManDumpModuleToFile( pFile, vNtk );
418  fclose( pFile );
419 }
420 
421 
422 /**Function*************************************************************
423 
424  Synopsis [Count memory used by Ptr.]
425 
426  Description []
427 
428  SideEffects []
429 
430  SeeAlso []
431 
432 ***********************************************************************/
433 int Ptr_ManMemArray( Vec_Ptr_t * vArray )
434 {
435  return (int)Vec_PtrMemory(vArray);
436 }
437 int Ptr_ManMemArrayArray( Vec_Ptr_t * vArrayArray )
438 {
439  Vec_Ptr_t * vArray; int i, nBytes = 0;
440  Vec_PtrForEachEntry( Vec_Ptr_t *, vArrayArray, vArray, i )
441  nBytes += Ptr_ManMemArray(vArray);
442  return nBytes;
443 }
445 {
446  int nBytes = (int)Vec_PtrMemory(vNtk);
447  nBytes += Ptr_ManMemArray( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1) );
448  nBytes += Ptr_ManMemArray( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2) );
449  nBytes += Ptr_ManMemArrayArray( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 3) );
450  nBytes += Ptr_ManMemArrayArray( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 4) );
451  return nBytes;
452 }
454 {
455  Vec_Ptr_t * vNtk; int i, nBytes = (int)Vec_PtrMemory(vDes);
456  Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
457  nBytes += Ptr_ManMemNtk(vNtk);
458  return nBytes;
459 }
460 
461 /**Function*************************************************************
462 
463  Synopsis [Free Ptr.]
464 
465  Description []
466 
467  SideEffects []
468 
469  SeeAlso []
470 
471 ***********************************************************************/
472 void Ptr_ManFreeNtk( Vec_Ptr_t * vNtk )
473 {
474  Vec_PtrFree( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1) );
475  Vec_PtrFree( (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2) );
476  Vec_VecFree( (Vec_Vec_t *)Vec_PtrEntry(vNtk, 3) );
477  Vec_VecFree( (Vec_Vec_t *)Vec_PtrEntry(vNtk, 4) );
478  Vec_PtrFree( vNtk );
479 }
480 void Ptr_ManFreeDes( Vec_Ptr_t * vDes )
481 {
482  Vec_Ptr_t * vNtk; int i;
483  Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
484  Ptr_ManFreeNtk( vNtk );
485  Vec_PtrFree( vDes );
486 }
487 
488 /**Function*************************************************************
489 
490  Synopsis [Count memory use used by Ptr.]
491 
492  Description []
493 
494  SideEffects []
495 
496  SeeAlso []
497 
498 ***********************************************************************/
500 {
501  abctime clk = Abc_Clock();
502  Vec_Ptr_t * vDes = Ptr_ManDumpDes( pNtk );
503  printf( "Converting to Ptr: Memory = %6.3f MB ", 1.0*Ptr_ManMemDes(vDes)/(1<<20) );
504  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
505  Ptr_ManDumpToFile( Extra_FileNameGenericAppend(pNtk->pDesign->pName, "_out.v"), vDes );
506  printf( "Finished writing output file \"%s\".\n", Extra_FileNameGenericAppend(pNtk->pDesign->pName, "_out.v") );
507  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
508  Ptr_ManFreeDes( vDes );
509  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
510 }
511 
512 
513 
514 ////////////////////////////////////////////////////////////////////////
515 /// END OF FILE ///
516 ////////////////////////////////////////////////////////////////////////
517 
518 
520 
int Ptr_ManMemNtk(Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:444
Vec_Ptr_t * Ptr_ManDumpNode(Abc_Obj_t *pObj)
Definition: cbaSimple.c:167
void Ptr_ManDumpModuleToBlif(FILE *pFile, Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:309
void Ptr_ManDumpNodesToBlif(FILE *pFile, Vec_Ptr_t *vNodes)
Definition: cbaSimple.c:281
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Ptr_ManDumpToFile(char *pFileName, Vec_Ptr_t *vDes)
Definition: cbaSimple.c:405
static int Abc_Ptr2Int(void *p)
Definition: abc_global.h:272
void Ptr_ManDumpToBlif(char *pFileName, Vec_Ptr_t *vDes)
Definition: cbaSimple.c:324
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
void Ptr_ManDumpSignalsToBlif(FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
Definition: cbaSimple.c:303
void Ptr_ManExperiment(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:499
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
Vec_Ptr_t * Ptr_ManDumpBoxes(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:210
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
Definition: abc.h:289
char * Ptr_TypeToSop(Ptr_ObjType_t Type)
Definition: cbaSimple.c:91
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
char * pName
Definition: abc.h:220
word Hop_ManComputeTruth6(Hop_Man_t *p, Hop_Obj_t *pObj, int nVars)
Definition: hopTruth.c:256
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
Definition: hop.h:65
int Ptr_ManMemArrayArray(Vec_Ptr_t *vArrayArray)
Definition: cbaSimple.c:437
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
static Abc_Ntk_t * Abc_ObjModel(Abc_Obj_t *pObj)
Definition: abc.h:335
int strcmp()
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
void Ptr_ManFreeNtk(Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:472
Vec_Ptr_t * Ptr_ManDumpBox(Abc_Obj_t *pObj)
Definition: cbaSimple.c:189
void Ptr_ManDumpModuleToFile(FILE *pFile, Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:388
void Ptr_ManDumpBoxToFile(FILE *pFile, Vec_Ptr_t *vBox)
Definition: cbaSimple.c:367
Vec_Ptr_t * Ptr_ManDumpInputs(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:220
void Ptr_ManDumpBoxesToBlif(FILE *pFile, Vec_Ptr_t *vBoxes)
Definition: cbaSimple.c:296
void Ptr_ManDumpSignalsToFile(FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
Definition: cbaSimple.c:382
Ptr_ObjType_t Ptr_HopToType(Abc_Obj_t *pObj)
Definition: cbaSimple.c:117
Ptr_ObjType_t Ptr_SopToType(char *pSop)
Definition: cbaSimple.c:102
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
Vec_Ptr_t * Ptr_ManDumpNodes(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:179
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
void Ptr_ManDumpNodesToFile(FILE *pFile, Vec_Ptr_t *vNodes)
Definition: cbaSimple.c:360
char * Ptr_TypeToName(Ptr_ObjType_t Type)
FUNCTION DEFINITIONS ///.
Definition: cbaSimple.c:80
static double Vec_PtrMemory(Vec_Ptr_t *p)
Definition: vecPtr.h:327
#define Abc_NtkForEachBox(pNtk, pObj, i)
Definition: abc.h:495
static int Vec_PtrCap(Vec_Ptr_t *p)
Definition: vecPtr.h:311
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Vec_Ptr_t * Ptr_ManDumpDes(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:249
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static char * Ptr_ObjName(Abc_Obj_t *pObj)
Definition: cbaSimple.c:147
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
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
void Ptr_ManDumpNodeToFile(FILE *pFile, Vec_Ptr_t *vNode)
Definition: cbaSimple.c:351
Ptr_ObjType_t
DECLARATIONS ///.
Definition: cbaSimple.c:38
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
int Ptr_ManMemDes(Vec_Ptr_t *vDes)
Definition: cbaSimple.c:453
#define ABC_CONST(number)
PARAMETERS ///.
Definition: abc_global.h:206
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
void Ptr_ManFreeDes(Vec_Ptr_t *vDes)
Definition: cbaSimple.c:480
char * Extra_TimeStamp()
static int Abc_ObjIsNet(Abc_Obj_t *pObj)
Definition: abc.h:354
Vec_Ptr_t * Ptr_ManDumpNtk(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:238
int Ptr_ManMemArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:433
Vec_Ptr_t * vModules
Definition: abc.h:223
#define assert(ex)
Definition: util_old.h:213
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static void * Abc_Int2Ptr(int i)
Definition: abc_global.h:273
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:315
static Abc_Ntk_t * Abc_ObjNtk(Abc_Obj_t *pObj)
Definition: abc.h:334
void * pData
Definition: abc.h:145
Vec_Ptr_t * Ptr_ManDumpOutputs(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:229
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Ptr_ManDumpBoxToBlif(FILE *pFile, Vec_Ptr_t *vBox)
Definition: cbaSimple.c:288
ABC_INT64_T abctime
Definition: abc_global.h:278
Abc_Des_t * pDesign
Definition: abc.h:180
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
void Ptr_ManDumpBoxesToFile(FILE *pFile, Vec_Ptr_t *vBoxes)
Definition: cbaSimple.c:375
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Ptr_ManDumpNodeToBlif(FILE *pFile, Vec_Ptr_t *vNode)
Definition: cbaSimple.c:272