abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cbaSimple.c File Reference
#include "cba.h"
#include "base/abc/abc.h"

Go to the source code of this file.

Enumerations

enum  Ptr_ObjType_t {
  PTR_OBJ_NONE, PTR_OBJ_CONST0, PTR_OBJ_PI, PTR_OBJ_PO,
  PTR_OBJ_FAN, PTR_OBJ_FLOP, PTR_OBJ_BOX, PTR_OBJ_NODE,
  PTR_OBJ_C0, PTR_OBJ_C1, PTR_OBJ_BUF, PTR_OBJ_INV,
  PTR_OBJ_AND, PTR_OBJ_OR, PTR_OBJ_XOR, PTR_OBJ_NAND,
  PTR_OBJ_NOR, PTR_OBJ_XNOR, PTR_OBJ_MUX, PTR_OBJ_MAJ,
  PTR_VOID
}
 DECLARATIONS ///. More...
 

Functions

char * Ptr_TypeToName (Ptr_ObjType_t Type)
 FUNCTION DEFINITIONS ///. More...
 
char * Ptr_TypeToSop (Ptr_ObjType_t Type)
 
Ptr_ObjType_t Ptr_SopToType (char *pSop)
 
Ptr_ObjType_t Ptr_HopToType (Abc_Obj_t *pObj)
 
static char * Ptr_ObjName (Abc_Obj_t *pObj)
 
static int Ptr_ManCheckArray (Vec_Ptr_t *vArray)
 
Vec_Ptr_tPtr_ManDumpNode (Abc_Obj_t *pObj)
 
Vec_Ptr_tPtr_ManDumpNodes (Abc_Ntk_t *pNtk)
 
Vec_Ptr_tPtr_ManDumpBox (Abc_Obj_t *pObj)
 
Vec_Ptr_tPtr_ManDumpBoxes (Abc_Ntk_t *pNtk)
 
Vec_Ptr_tPtr_ManDumpInputs (Abc_Ntk_t *pNtk)
 
Vec_Ptr_tPtr_ManDumpOutputs (Abc_Ntk_t *pNtk)
 
Vec_Ptr_tPtr_ManDumpNtk (Abc_Ntk_t *pNtk)
 
Vec_Ptr_tPtr_ManDumpDes (Abc_Ntk_t *pNtk)
 
void Ptr_ManDumpNodeToBlif (FILE *pFile, Vec_Ptr_t *vNode)
 
void Ptr_ManDumpNodesToBlif (FILE *pFile, Vec_Ptr_t *vNodes)
 
void Ptr_ManDumpBoxToBlif (FILE *pFile, Vec_Ptr_t *vBox)
 
void Ptr_ManDumpBoxesToBlif (FILE *pFile, Vec_Ptr_t *vBoxes)
 
void Ptr_ManDumpSignalsToBlif (FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
 
void Ptr_ManDumpModuleToBlif (FILE *pFile, Vec_Ptr_t *vNtk)
 
void Ptr_ManDumpToBlif (char *pFileName, Vec_Ptr_t *vDes)
 
void Ptr_ManDumpNodeToFile (FILE *pFile, Vec_Ptr_t *vNode)
 
void Ptr_ManDumpNodesToFile (FILE *pFile, Vec_Ptr_t *vNodes)
 
void Ptr_ManDumpBoxToFile (FILE *pFile, Vec_Ptr_t *vBox)
 
void Ptr_ManDumpBoxesToFile (FILE *pFile, Vec_Ptr_t *vBoxes)
 
void Ptr_ManDumpSignalsToFile (FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
 
void Ptr_ManDumpModuleToFile (FILE *pFile, Vec_Ptr_t *vNtk)
 
void Ptr_ManDumpToFile (char *pFileName, Vec_Ptr_t *vDes)
 
int Ptr_ManMemArray (Vec_Ptr_t *vArray)
 
int Ptr_ManMemArrayArray (Vec_Ptr_t *vArrayArray)
 
int Ptr_ManMemNtk (Vec_Ptr_t *vNtk)
 
int Ptr_ManMemDes (Vec_Ptr_t *vDes)
 
void Ptr_ManFreeNtk (Vec_Ptr_t *vNtk)
 
void Ptr_ManFreeDes (Vec_Ptr_t *vDes)
 
void Ptr_ManExperiment (Abc_Ntk_t *pNtk)
 

Enumeration Type Documentation

DECLARATIONS ///.

CFile****************************************************************

FileName [cbaSimple.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Verilog parser.]

Synopsis [Parses several flavors of word-level Verilog.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 29, 2014.]

Revision [

Id:
cbaSimple.c,v 1.00 2014/11/29 00:00:00 alanmi Exp

]

Enumerator
PTR_OBJ_NONE 
PTR_OBJ_CONST0 
PTR_OBJ_PI 
PTR_OBJ_PO 
PTR_OBJ_FAN 
PTR_OBJ_FLOP 
PTR_OBJ_BOX 
PTR_OBJ_NODE 
PTR_OBJ_C0 
PTR_OBJ_C1 
PTR_OBJ_BUF 
PTR_OBJ_INV 
PTR_OBJ_AND 
PTR_OBJ_OR 
PTR_OBJ_XOR 
PTR_OBJ_NAND 
PTR_OBJ_NOR 
PTR_OBJ_XNOR 
PTR_OBJ_MUX 
PTR_OBJ_MAJ 
PTR_VOID 

Definition at line 38 of file cbaSimple.c.

38  {
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
Ptr_ObjType_t
DECLARATIONS ///.
Definition: cbaSimple.c:38

Function Documentation

Ptr_ObjType_t Ptr_HopToType ( Abc_Obj_t pObj)

Definition at line 117 of file cbaSimple.c.

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 }
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
word Hop_ManComputeTruth6(Hop_Man_t *p, Hop_Obj_t *pObj, int nVars)
Definition: hopTruth.c:256
Definition: hop.h:65
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
#define ABC_CONST(number)
PARAMETERS ///.
Definition: abc_global.h:206
#define assert(ex)
Definition: util_old.h:213
static Abc_Ntk_t * Abc_ObjNtk(Abc_Obj_t *pObj)
Definition: abc.h:334
void * pData
Definition: abc.h:145
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
static int Ptr_ManCheckArray ( Vec_Ptr_t vArray)
static

Definition at line 158 of file cbaSimple.c.

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 }
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 int Vec_PtrCap(Vec_Ptr_t *p)
Definition: vecPtr.h:311
#define assert(ex)
Definition: util_old.h:213
Vec_Ptr_t* Ptr_ManDumpBox ( Abc_Obj_t pObj)

Definition at line 189 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
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
static Abc_Ntk_t * Abc_ObjModel(Abc_Obj_t *pObj)
Definition: abc.h:335
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
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 Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:315
Vec_Ptr_t* Ptr_ManDumpBoxes ( Abc_Ntk_t pNtk)

Definition at line 210 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
Definition: abc.h:289
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
Vec_Ptr_t * Ptr_ManDumpBox(Abc_Obj_t *pObj)
Definition: cbaSimple.c:189
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
#define Abc_NtkForEachBox(pNtk, pObj, i)
Definition: abc.h:495
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define assert(ex)
Definition: util_old.h:213
void Ptr_ManDumpBoxesToBlif ( FILE *  pFile,
Vec_Ptr_t vBoxes 
)

Definition at line 296 of file cbaSimple.c.

297 {
298  Vec_Ptr_t * vBox; int i;
299  Vec_PtrForEachEntry( Vec_Ptr_t *, vBoxes, vBox, i )
300  Ptr_ManDumpBoxToBlif( pFile, vBox );
301 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#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
void Ptr_ManDumpBoxesToFile ( FILE *  pFile,
Vec_Ptr_t vBoxes 
)

Definition at line 375 of file cbaSimple.c.

376 {
377  Vec_Ptr_t * vBox; int i;
378  Vec_PtrForEachEntry( Vec_Ptr_t *, vBoxes, vBox, i )
379  Ptr_ManDumpBoxToFile( pFile, vBox );
380 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Ptr_ManDumpBoxToFile(FILE *pFile, Vec_Ptr_t *vBox)
Definition: cbaSimple.c:367
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Ptr_ManDumpBoxToBlif ( FILE *  pFile,
Vec_Ptr_t vBox 
)

Definition at line 288 of file cbaSimple.c.

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 }
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
void Ptr_ManDumpBoxToFile ( FILE *  pFile,
Vec_Ptr_t vBox 
)

Definition at line 367 of file cbaSimple.c.

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 }
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Vec_Ptr_t* Ptr_ManDumpDes ( Abc_Ntk_t pNtk)

Definition at line 249 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
char * pName
Definition: abc.h:220
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Vec_Ptr_t * Ptr_ManDumpNtk(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:238
Vec_Ptr_t * vModules
Definition: abc.h:223
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Abc_Des_t * pDesign
Definition: abc.h:180
Vec_Ptr_t* Ptr_ManDumpInputs ( Abc_Ntk_t pNtk)

Definition at line 220 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
static char * Ptr_ObjName(Abc_Obj_t *pObj)
Definition: cbaSimple.c:147
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
#define assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
void Ptr_ManDumpModuleToBlif ( FILE *  pFile,
Vec_Ptr_t vNtk 
)

Definition at line 309 of file cbaSimple.c.

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 }
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_ManDumpSignalsToBlif(FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
Definition: cbaSimple.c:303
void Ptr_ManDumpBoxesToBlif(FILE *pFile, Vec_Ptr_t *vBoxes)
Definition: cbaSimple.c:296
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
void Ptr_ManDumpModuleToFile ( FILE *  pFile,
Vec_Ptr_t vNtk 
)

Definition at line 388 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Ptr_ManDumpSignalsToFile(FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
Definition: cbaSimple.c:382
void Ptr_ManDumpNodesToFile(FILE *pFile, Vec_Ptr_t *vNodes)
Definition: cbaSimple.c:360
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
void Ptr_ManDumpBoxesToFile(FILE *pFile, Vec_Ptr_t *vBoxes)
Definition: cbaSimple.c:375
Vec_Ptr_t* Ptr_ManDumpNode ( Abc_Obj_t pObj)

Definition at line 167 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
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
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
Ptr_ObjType_t Ptr_HopToType(Abc_Obj_t *pObj)
Definition: cbaSimple.c:117
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
static char * Ptr_ObjName(Abc_Obj_t *pObj)
Definition: cbaSimple.c:147
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
#define assert(ex)
Definition: util_old.h:213
static void * Abc_Int2Ptr(int i)
Definition: abc_global.h:273
Vec_Ptr_t* Ptr_ManDumpNodes ( Abc_Ntk_t pNtk)

Definition at line 179 of file cbaSimple.c.

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 }
Vec_Ptr_t * Ptr_ManDumpNode(Abc_Obj_t *pObj)
Definition: cbaSimple.c:167
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define assert(ex)
Definition: util_old.h:213
void Ptr_ManDumpNodesToBlif ( FILE *  pFile,
Vec_Ptr_t vNodes 
)

Definition at line 281 of file cbaSimple.c.

282 {
283  Vec_Ptr_t * vNode; int i;
284  Vec_PtrForEachEntry( Vec_Ptr_t *, vNodes, vNode, i )
285  Ptr_ManDumpNodeToBlif( pFile, vNode );
286 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Ptr_ManDumpNodeToBlif(FILE *pFile, Vec_Ptr_t *vNode)
Definition: cbaSimple.c:272
void Ptr_ManDumpNodesToFile ( FILE *  pFile,
Vec_Ptr_t vNodes 
)

Definition at line 360 of file cbaSimple.c.

361 {
362  Vec_Ptr_t * vNode; int i;
363  Vec_PtrForEachEntry( Vec_Ptr_t *, vNodes, vNode, i )
364  Ptr_ManDumpNodeToFile( pFile, vNode );
365 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Ptr_ManDumpNodeToFile(FILE *pFile, Vec_Ptr_t *vNode)
Definition: cbaSimple.c:351
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Ptr_ManDumpNodeToBlif ( FILE *  pFile,
Vec_Ptr_t vNode 
)

Function*************************************************************

Synopsis [Dumping Ptr into a Verilog file.]

Description []

SideEffects []

SeeAlso []

Definition at line 272 of file cbaSimple.c.

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 }
static int Abc_Ptr2Int(void *p)
Definition: abc_global.h:272
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
char * Ptr_TypeToSop(Ptr_ObjType_t Type)
Definition: cbaSimple.c:91
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Ptr_ObjType_t
DECLARATIONS ///.
Definition: cbaSimple.c:38
void Ptr_ManDumpNodeToFile ( FILE *  pFile,
Vec_Ptr_t vNode 
)

Function*************************************************************

Synopsis [Dumping Ptr into a Verilog file.]

Description []

SideEffects []

SeeAlso []

Definition at line 351 of file cbaSimple.c.

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 }
static int Abc_Ptr2Int(void *p)
Definition: abc_global.h:272
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
char * Ptr_TypeToName(Ptr_ObjType_t Type)
FUNCTION DEFINITIONS ///.
Definition: cbaSimple.c:80
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Ptr_ObjType_t
DECLARATIONS ///.
Definition: cbaSimple.c:38
Vec_Ptr_t* Ptr_ManDumpNtk ( Abc_Ntk_t pNtk)

Definition at line 238 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Vec_Ptr_t * Ptr_ManDumpBoxes(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:210
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
Vec_Ptr_t * Ptr_ManDumpInputs(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:220
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
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define assert(ex)
Definition: util_old.h:213
Vec_Ptr_t * Ptr_ManDumpOutputs(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:229
Vec_Ptr_t* Ptr_ManDumpOutputs ( Abc_Ntk_t pNtk)

Definition at line 229 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:158
static char * Ptr_ObjName(Abc_Obj_t *pObj)
Definition: cbaSimple.c:147
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 assert(ex)
Definition: util_old.h:213
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
void Ptr_ManDumpSignalsToBlif ( FILE *  pFile,
Vec_Ptr_t vSigs,
int  fSkipLastComma 
)

Definition at line 303 of file cbaSimple.c.

304 {
305  char * pSig; int i;
306  Vec_PtrForEachEntry( char *, vSigs, pSig, i )
307  fprintf( pFile, " %s", pSig );
308 }
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Ptr_ManDumpSignalsToFile ( FILE *  pFile,
Vec_Ptr_t vSigs,
int  fSkipLastComma 
)

Definition at line 382 of file cbaSimple.c.

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 }
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Ptr_ManDumpToBlif ( char *  pFileName,
Vec_Ptr_t vDes 
)

Definition at line 324 of file cbaSimple.c.

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 }
void Ptr_ManDumpModuleToBlif(FILE *pFile, Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:309
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
char * Extra_TimeStamp()
void Ptr_ManDumpToFile ( char *  pFileName,
Vec_Ptr_t vDes 
)

Definition at line 405 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
void Ptr_ManDumpModuleToFile(FILE *pFile, Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:388
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
char * Extra_TimeStamp()
void Ptr_ManExperiment ( Abc_Ntk_t pNtk)

Function*************************************************************

Synopsis [Count memory use used by Ptr.]

Description []

SideEffects []

SeeAlso []

Definition at line 499 of file cbaSimple.c.

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 }
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
char * pName
Definition: abc.h:220
static abctime Abc_Clock()
Definition: abc_global.h:279
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
Vec_Ptr_t * Ptr_ManDumpDes(Abc_Ntk_t *pNtk)
Definition: cbaSimple.c:249
int Ptr_ManMemDes(Vec_Ptr_t *vDes)
Definition: cbaSimple.c:453
void Ptr_ManFreeDes(Vec_Ptr_t *vDes)
Definition: cbaSimple.c:480
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
ABC_INT64_T abctime
Definition: abc_global.h:278
Abc_Des_t * pDesign
Definition: abc.h:180
void Ptr_ManFreeDes ( Vec_Ptr_t vDes)

Definition at line 480 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
void Ptr_ManFreeNtk(Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:472
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Ptr_ManFreeNtk ( Vec_Ptr_t vNtk)

Function*************************************************************

Synopsis [Free Ptr.]

Description []

SideEffects []

SeeAlso []

Definition at line 472 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Ptr_ManMemArray ( Vec_Ptr_t vArray)

Function*************************************************************

Synopsis [Count memory used by Ptr.]

Description []

SideEffects []

SeeAlso []

Definition at line 433 of file cbaSimple.c.

434 {
435  return (int)Vec_PtrMemory(vArray);
436 }
static double Vec_PtrMemory(Vec_Ptr_t *p)
Definition: vecPtr.h:327
int Ptr_ManMemArrayArray ( Vec_Ptr_t vArrayArray)

Definition at line 437 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int Ptr_ManMemArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:433
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
int Ptr_ManMemDes ( Vec_Ptr_t vDes)

Definition at line 453 of file cbaSimple.c.

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 }
int Ptr_ManMemNtk(Vec_Ptr_t *vNtk)
Definition: cbaSimple.c:444
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition: vecPtr.h:57
static double Vec_PtrMemory(Vec_Ptr_t *p)
Definition: vecPtr.h:327
int Ptr_ManMemNtk ( Vec_Ptr_t vNtk)

Definition at line 444 of file cbaSimple.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int Ptr_ManMemArrayArray(Vec_Ptr_t *vArrayArray)
Definition: cbaSimple.c:437
static double Vec_PtrMemory(Vec_Ptr_t *p)
Definition: vecPtr.h:327
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
int Ptr_ManMemArray(Vec_Ptr_t *vArray)
Definition: cbaSimple.c:433
static char* Ptr_ObjName ( Abc_Obj_t pObj)
inlinestatic

Function*************************************************************

Synopsis [Dumping hierarchical Abc_Ntk_t in Ptr form.]

Description []

SideEffects []

SeeAlso []

Definition at line 147 of file cbaSimple.c.

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 }
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
static char * Ptr_ObjName(Abc_Obj_t *pObj)
Definition: cbaSimple.c:147
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
static int Abc_ObjIsNet(Abc_Obj_t *pObj)
Definition: abc.h:354
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
Definition: abc.h:357
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
Ptr_ObjType_t Ptr_SopToType ( char *  pSop)

Definition at line 102 of file cbaSimple.c.

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 }
int strcmp()
#define assert(ex)
Definition: util_old.h:213
char* Ptr_TypeToName ( Ptr_ObjType_t  Type)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Node type conversions.]

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file cbaSimple.c.

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 }
#define assert(ex)
Definition: util_old.h:213
char* Ptr_TypeToSop ( Ptr_ObjType_t  Type)

Definition at line 91 of file cbaSimple.c.

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 }
#define assert(ex)
Definition: util_old.h:213