abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cba.h File Reference
#include "aig/gia/gia.h"
#include "misc/extra/extra.h"
#include "misc/util/utilNam.h"
#include "misc/mem/mem.h"
#include "misc/util/utilTruth.h"
#include "misc/vec/vecWec.h"

Go to the source code of this file.

Data Structures

struct  Cba_Man_t_
 
struct  Cba_Ntk_t_
 

Macros

#define Cba_ManForEachNtk(p, pNtk, i)   for ( i = 1; (i <= Cba_ManNtkNum(p)) && (((pNtk) = Cba_ManNtk(p, i)), 1); i++ )
 MACRO DEFINITIONS ///. More...
 
#define Cba_NtkForEachObjType(p, Type, i)   for ( i = 0; (i < Cba_NtkObjNum(p)) && (((Type) = Cba_ObjType(p, i)), 1); i++ )
 
#define Cba_NtkForEachObjTypeFuncFanins(p, Type, Func, vFanins, i)   for ( i = 0; (i < Cba_NtkObjNum(p)) && (((Type) = Cba_ObjType(p, i)), 1) && (((Func) = Cba_ObjFuncId(p, i)), 1) && (((vFanins) = Cba_ObjFanins(p, i)), 1); i++ )
 

Typedefs

typedef struct Cba_Man_t_ Cba_Man_t
 
typedef struct Cba_Ntk_t_ Cba_Ntk_t
 

Enumerations

enum  Cba_ObjType_t {
  CBA_OBJ_NONE = 0, CBA_OBJ_BARBUF, CBA_OBJ_PI, CBA_OBJ_PO,
  CBA_OBJ_PIO, CBA_OBJ_NODE, CBA_OBJ_BOX, CBA_OBJ_PIN,
  CBA_OBJ_LATCH, CBA_OBJ_UNKNOWN
}
 INCLUDES ///. More...
 
enum  Cba_NodeType_t {
  CBA_NODE_NONE = 0, CBA_NODE_CONST, CBA_NODE_BUF, CBA_NODE_INV,
  CBA_NODE_AND, CBA_NODE_NAND, CBA_NODE_OR, CBA_NODE_NOR,
  CBA_NODE_XOR, CBA_NODE_XNOR, CBA_NODE_MUX, CBA_NODE_MAJ,
  CBA_NODE_KNOWN, CBA_NODE_UNKNOWN
}
 

Functions

static char * Cba_ManName (Cba_Man_t *p)
 
static int Cba_ManNtkNum (Cba_Man_t *p)
 
static Cba_Ntk_tCba_ManNtk (Cba_Man_t *p, int i)
 
static Cba_Ntk_tCba_ManRoot (Cba_Man_t *p)
 
static char * Cba_NtkName (Cba_Ntk_t *p)
 
static int Cba_NtkObjNum (Cba_Ntk_t *p)
 
static char * Cba_NtkStr (Cba_Ntk_t *p, int i)
 
static char * Cba_NtkModelStr (Cba_Ntk_t *p, int i)
 
static char * Cba_NtkFuncStr (Cba_Ntk_t *p, int i)
 
static Cba_ObjType_t Cba_ObjType (Cba_Ntk_t *p, int i)
 
static int Cba_ObjFuncId (Cba_Ntk_t *p, int i)
 
static int Cba_ObjInstId (Cba_Ntk_t *p, int i)
 
static Vec_Int_tCba_ObjFanins (Cba_Ntk_t *p, int i)
 
static int Cba_ObjNameId (Cba_Ntk_t *p, int i)
 
static int Cba_ObjRangeId (Cba_Ntk_t *p, int i)
 
static int Cba_ObjCopyId (Cba_Ntk_t *p, int i)
 
static char * Cba_ObjFuncStr (Cba_Ntk_t *p, int i)
 
static char * Cba_ObjInstStr (Cba_Ntk_t *p, int i)
 
static char * Cba_ObjNameStr (Cba_Ntk_t *p, int i)
 
static char * Cba_ObjRangeStr (Cba_Ntk_t *p, int i)
 
static Cba_Ntk_tCba_NtkAlloc (Cba_Man_t *p, char *pName)
 FUNCTION DECLARATIONS ///. More...
 
static void Cba_NtkFree (Cba_Ntk_t *p)
 
static int Cba_NtkMemory (Cba_Ntk_t *p)
 
static Cba_Man_tCba_ManAlloc (char *pFileName)
 
static void Cba_ManFree (Cba_Man_t *p)
 
static int Cba_ManMemory (Cba_Man_t *p)
 
Cba_Man_tCba_PrsReadBlif (char *pFileName)
 
void Cba_PrsWriteBlif (char *pFileName, Cba_Man_t *pDes)
 
Cba_Man_tCba_PrsReadVerilog (char *pFileName)
 
void Cba_PrsWriteVerilog (char *pFileName, Cba_Man_t *pDes)
 

Macro Definition Documentation

#define Cba_ManForEachNtk (   p,
  pNtk,
 
)    for ( i = 1; (i <= Cba_ManNtkNum(p)) && (((pNtk) = Cba_ManNtk(p, i)), 1); i++ )

MACRO DEFINITIONS ///.

ITERATORS ///

Definition at line 155 of file cba.h.

#define Cba_NtkForEachObjType (   p,
  Type,
 
)    for ( i = 0; (i < Cba_NtkObjNum(p)) && (((Type) = Cba_ObjType(p, i)), 1); i++ )

Definition at line 158 of file cba.h.

#define Cba_NtkForEachObjTypeFuncFanins (   p,
  Type,
  Func,
  vFanins,
 
)    for ( i = 0; (i < Cba_NtkObjNum(p)) && (((Type) = Cba_ObjType(p, i)), 1) && (((Func) = Cba_ObjFuncId(p, i)), 1) && (((vFanins) = Cba_ObjFanins(p, i)), 1); i++ )

Definition at line 160 of file cba.h.

Typedef Documentation

typedef struct Cba_Man_t_ Cba_Man_t

Definition at line 81 of file cba.h.

typedef struct Cba_Ntk_t_ Cba_Ntk_t

Definition at line 98 of file cba.h.

Enumeration Type Documentation

Enumerator
CBA_NODE_NONE 
CBA_NODE_CONST 
CBA_NODE_BUF 
CBA_NODE_INV 
CBA_NODE_AND 
CBA_NODE_NAND 
CBA_NODE_OR 
CBA_NODE_NOR 
CBA_NODE_XOR 
CBA_NODE_XNOR 
CBA_NODE_MUX 
CBA_NODE_MAJ 
CBA_NODE_KNOWN 
CBA_NODE_UNKNOWN 

Definition at line 62 of file cba.h.

62  {
63  CBA_NODE_NONE = 0, // 0: unused
64  CBA_NODE_CONST, // 1: constant
65  CBA_NODE_BUF, // 2: buffer
66  CBA_NODE_INV, // 3: inverter
67  CBA_NODE_AND, // 4: AND
68  CBA_NODE_NAND, // 5: NAND
69  CBA_NODE_OR, // 6: OR
70  CBA_NODE_NOR, // 7: NOR
71  CBA_NODE_XOR, // 8: XOR
72  CBA_NODE_XNOR, // 9 .XNOR
73  CBA_NODE_MUX, // 10: MUX
74  CBA_NODE_MAJ, // 11: MAJ
75  CBA_NODE_KNOWN, // 12: unknown
76  CBA_NODE_UNKNOWN // 13: unknown
Cba_NodeType_t
Definition: cba.h:62

INCLUDES ///.

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

FileName [cba.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Verilog parser.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

Id:
cba.h,v 1.00 2014/11/29 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///

Enumerator
CBA_OBJ_NONE 
CBA_OBJ_BARBUF 
CBA_OBJ_PI 
CBA_OBJ_PO 
CBA_OBJ_PIO 
CBA_OBJ_NODE 
CBA_OBJ_BOX 
CBA_OBJ_PIN 
CBA_OBJ_LATCH 
CBA_OBJ_UNKNOWN 

Definition at line 48 of file cba.h.

48  {
49  CBA_OBJ_NONE = 0, // 0: unused
50  CBA_OBJ_BARBUF, // 1: barrier buffer
51  CBA_OBJ_PI, // 2: input
52  CBA_OBJ_PO, // 3: output
53  CBA_OBJ_PIO, // 4: input
54  CBA_OBJ_NODE, // 5: node
55  CBA_OBJ_BOX, // 6: box
56  CBA_OBJ_PIN, // 7: box output
57  CBA_OBJ_LATCH, // 8: latch
58  CBA_OBJ_UNKNOWN // 9: unknown
59 } Cba_ObjType_t;
Definition: cba.h:52
Definition: cba.h:51
Cba_ObjType_t
INCLUDES ///.
Definition: cba.h:48

Function Documentation

static Cba_Man_t* Cba_ManAlloc ( char *  pFileName)
inlinestatic

Definition at line 199 of file cba.h.

200 {
201  Cba_Man_t * p;
202  p = ABC_CALLOC( Cba_Man_t, 1 );
203  // design names
204  p->pName = Extra_FileDesignName( pFileName );
205  p->pSpec = Abc_UtilStrsav( pFileName );
206  p->pNames = Abc_NamStart( 1000, 20 );
207  p->pModels = Abc_NamStart( 1000, 20 );
208  p->pFuncs = Abc_NamStart( 1000, 20 );
209  // internal data
210  p->pMem = Mem_FlexStart();
211  Vec_PtrPush( &p->vNtks, NULL );
212  return p;
213 }
Abc_Nam_t * pModels
Definition: cba.h:88
Vec_Ptr_t vNtks
Definition: cba.h:93
char * pName
Definition: cba.h:85
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Mem_Flex_t * pMem
Definition: cba.h:92
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
Abc_Nam_t * pNames
Definition: cba.h:87
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
Definition: utilNam.c:78
Mem_Flex_t * Mem_FlexStart()
Definition: mem.c:311
char * pSpec
Definition: cba.h:86
Definition: cba.h:82
Abc_Nam_t * pFuncs
Definition: cba.h:89
char * Extra_FileDesignName(char *pFileName)
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
static void Cba_ManFree ( Cba_Man_t p)
inlinestatic

Definition at line 214 of file cba.h.

215 {
216  Cba_Ntk_t * pNtk; int i;
217  Cba_ManForEachNtk( p, pNtk, i )
218  Cba_NtkFree( pNtk );
219  ABC_FREE( p->vNtks.pArray );
220  Mem_FlexStop( p->pMem, 0 );
221  // design names
222  Abc_NamStop( p->pNames );
223  Abc_NamStop( p->pModels );
224  Abc_NamStop( p->pFuncs );
225  ABC_FREE( p->pName );
226  ABC_FREE( p->pSpec );
227  ABC_FREE( p );
228 }
Definition: cba.h:99
void Abc_NamStop(Abc_Nam_t *p)
Definition: utilNam.c:110
static void Cba_NtkFree(Cba_Ntk_t *p)
Definition: cba.h:176
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
Definition: mem.c:343
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define Cba_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
Definition: cba.h:155
static int Cba_ManMemory ( Cba_Man_t p)
inlinestatic

Definition at line 229 of file cba.h.

230 {
231  Cba_Ntk_t * pNtk; int i;
232  int nMem = sizeof(Cba_Man_t);
233  nMem += Abc_NamMemUsed(p->pNames);
234  nMem += Abc_NamMemUsed(p->pModels);
235  nMem += Abc_NamMemUsed(p->pFuncs);
236  nMem += Mem_FlexReadMemUsage(p->pMem);
237  nMem += (int)Vec_PtrMemory(&p->vNtks);
238  Cba_ManForEachNtk( p, pNtk, i )
239  nMem += Cba_NtkMemory( pNtk );
240  return nMem;
241 }
Definition: cba.h:99
Abc_Nam_t * pModels
Definition: cba.h:88
Vec_Ptr_t vNtks
Definition: cba.h:93
Mem_Flex_t * pMem
Definition: cba.h:92
Abc_Nam_t * pNames
Definition: cba.h:87
int Abc_NamMemUsed(Abc_Nam_t *p)
Definition: utilNam.c:202
struct Cba_Man_t_ Cba_Man_t
Definition: cba.h:81
static double Vec_PtrMemory(Vec_Ptr_t *p)
Definition: vecPtr.h:327
Abc_Nam_t * pFuncs
Definition: cba.h:89
int Mem_FlexReadMemUsage(Mem_Flex_t *p)
Definition: mem.c:445
static int Cba_NtkMemory(Cba_Ntk_t *p)
Definition: cba.h:194
#define Cba_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
Definition: cba.h:155
static char* Cba_ManName ( Cba_Man_t p)
inlinestatic

Definition at line 120 of file cba.h.

120 { return p->pName; }
char * pName
Definition: cba.h:85
static Cba_Ntk_t* Cba_ManNtk ( Cba_Man_t p,
int  i 
)
inlinestatic

Definition at line 122 of file cba.h.

122 { assert( i > 0 ); return (Cba_Ntk_t *)Vec_PtrEntry(&p->vNtks, i); }
Definition: cba.h:99
Vec_Ptr_t vNtks
Definition: cba.h:93
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
#define assert(ex)
Definition: util_old.h:213
static int Cba_ManNtkNum ( Cba_Man_t p)
inlinestatic

Definition at line 121 of file cba.h.

121 { return Vec_PtrSize(&p->vNtks) - 1; }
Vec_Ptr_t vNtks
Definition: cba.h:93
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static Cba_Ntk_t* Cba_ManRoot ( Cba_Man_t p)
inlinestatic

Definition at line 123 of file cba.h.

123 { return Cba_ManNtk(p, p->iRoot); }
int iRoot
Definition: cba.h:94
static Cba_Ntk_t * Cba_ManNtk(Cba_Man_t *p, int i)
Definition: cba.h:122
static Cba_Ntk_t* Cba_NtkAlloc ( Cba_Man_t p,
char *  pName 
)
inlinestatic

FUNCTION DECLARATIONS ///.

Definition at line 168 of file cba.h.

169 {
170  Cba_Ntk_t * pNtk = ABC_CALLOC( Cba_Ntk_t, 1 );
171  pNtk->pDesign = p;
172  pNtk->pName = Abc_UtilStrsav(pName);
173  Vec_PtrPush( &p->vNtks, pNtk );
174  return pNtk;
175 }
Definition: cba.h:99
Vec_Ptr_t vNtks
Definition: cba.h:93
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
char * pName
Definition: cba.h:101
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
Cba_Man_t * pDesign
Definition: cba.h:102
static void Cba_NtkFree ( Cba_Ntk_t p)
inlinestatic

Definition at line 176 of file cba.h.

177 {
178 // Vec_IntErase( &p->vInouts );
179 // Vec_IntErase( &p->vInputs );
180 // Vec_IntErase( &p->vOutputs );
181 // Vec_IntErase( &p->vWires );
182 
183 // Vec_IntErase( &p->vTypes );
184 // Vec_IntErase( &p->vFuncs );
185 // Vec_IntErase( &p->vInstIds );
186  ABC_FREE( p->vFanins.pArray );
187 
188  Vec_IntErase( &p->vNameIds );
189  Vec_IntErase( &p->vRanges );
190  Vec_IntErase( &p->vCopies );
191  ABC_FREE( p->pName );
192  ABC_FREE( p );
193 }
static void Vec_IntErase(Vec_Int_t *p)
Definition: vecInt.h:266
char * pName
Definition: cba.h:101
Vec_Wec_t vFanins
Definition: cba.h:112
Vec_Int_t vRanges
Definition: cba.h:115
#define ABC_FREE(obj)
Definition: abc_global.h:232
Vec_Int_t vCopies
Definition: cba.h:116
Vec_Int_t vNameIds
Definition: cba.h:114
static char* Cba_NtkFuncStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 129 of file cba.h.

129 { return Abc_NamStr(p->pDesign->pFuncs, i); }
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition: utilNam.c:479
Abc_Nam_t * pFuncs
Definition: cba.h:89
Cba_Man_t * pDesign
Definition: cba.h:102
static int Cba_NtkMemory ( Cba_Ntk_t p)
inlinestatic

Definition at line 194 of file cba.h.

195 {
196  return Vec_WecMemory(&p->vFanins);
197 }
static double Vec_WecMemory(Vec_Wec_t *p)
Definition: vecWec.h:308
Vec_Wec_t vFanins
Definition: cba.h:112
static char* Cba_NtkModelStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 128 of file cba.h.

128 { return Abc_NamStr(p->pDesign->pModels, i); }
Abc_Nam_t * pModels
Definition: cba.h:88
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition: utilNam.c:479
Cba_Man_t * pDesign
Definition: cba.h:102
static char* Cba_NtkName ( Cba_Ntk_t p)
inlinestatic

Definition at line 125 of file cba.h.

125 { return p->pName; }
char * pName
Definition: cba.h:101
static int Cba_NtkObjNum ( Cba_Ntk_t p)
inlinestatic

Definition at line 126 of file cba.h.

126 { return Vec_WecSize(&p->vFanins); }
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
Vec_Wec_t vFanins
Definition: cba.h:112
static char* Cba_NtkStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 127 of file cba.h.

127 { return Abc_NamStr(p->pDesign->pNames, i); }
Abc_Nam_t * pNames
Definition: cba.h:87
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition: utilNam.c:479
Cba_Man_t * pDesign
Definition: cba.h:102
static int Cba_ObjCopyId ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 138 of file cba.h.

138 { return Vec_IntEntry(&p->vCopies, i); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vCopies
Definition: cba.h:116
static Vec_Int_t* Cba_ObjFanins ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 134 of file cba.h.

134 { return Vec_WecEntry(&p->vFanins, i); }
Vec_Wec_t vFanins
Definition: cba.h:112
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static int Cba_ObjFuncId ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 132 of file cba.h.

132 { return Vec_IntEntry(&p->vFuncs, i); }
Vec_Int_t vFuncs
Definition: cba.h:110
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static char* Cba_ObjFuncStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 140 of file cba.h.

140 { return Cba_NtkStr(p, Cba_ObjFuncId(p, i)); }
static int Cba_ObjFuncId(Cba_Ntk_t *p, int i)
Definition: cba.h:132
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
Definition: cba.h:127
static int Cba_ObjInstId ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 133 of file cba.h.

133 { return Vec_IntEntry(&p->vInstIds, i); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vInstIds
Definition: cba.h:111
static char* Cba_ObjInstStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 141 of file cba.h.

141 { return Cba_NtkStr(p, Cba_ObjInstId(p, i)); }
static int Cba_ObjInstId(Cba_Ntk_t *p, int i)
Definition: cba.h:133
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
Definition: cba.h:127
static int Cba_ObjNameId ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 136 of file cba.h.

136 { return Vec_IntEntry(&p->vNameIds, i); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vNameIds
Definition: cba.h:114
static char* Cba_ObjNameStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 142 of file cba.h.

142 { return Cba_NtkStr(p, Cba_ObjNameId(p, i)); }
static int Cba_ObjNameId(Cba_Ntk_t *p, int i)
Definition: cba.h:136
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
Definition: cba.h:127
static int Cba_ObjRangeId ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 137 of file cba.h.

137 { return Vec_IntEntry(&p->vRanges, i); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vRanges
Definition: cba.h:115
static char* Cba_ObjRangeStr ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 143 of file cba.h.

143 { return Cba_NtkStr(p, Cba_ObjRangeId(p, i)); }
static int Cba_ObjRangeId(Cba_Ntk_t *p, int i)
Definition: cba.h:137
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
Definition: cba.h:127
static Cba_ObjType_t Cba_ObjType ( Cba_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 131 of file cba.h.

131 { return Vec_IntEntry(&p->vTypes, i); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vTypes
Definition: cba.h:109
Cba_Man_t* Cba_PrsReadBlif ( char *  pFileName)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 400 of file cbaReadBlif.c.

401 {
402  Cba_Man_t * pDesign = NULL;
403  Cba_Prs_t * p = Cba_PrsAlloc( pFileName );
404  if ( p == NULL )
405  return NULL;
407  Cba_PrsReadLines( p );
408  if ( Cba_PrsErrorPrint(p) )
409  ABC_SWAP( Cba_Man_t *, pDesign, p->pDesign );
410  Cba_PrsFree( p );
411  return pDesign;
412 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Cba_PrsReadLines(Cba_Prs_t *p)
Definition: cbaReadBlif.c:374
#define ABC_SWAP(Type, a, b)
Definition: abc_global.h:218
Cba_Man_t * pDesign
Definition: cbaPrs.h:60
static Cba_Prs_t * Cba_PrsAlloc(char *pFileName)
Definition: cbaPrs.h:168
static int Cba_PrsErrorPrint(Cba_Prs_t *p)
Definition: cbaPrs.h:104
Definition: cba.h:82
static void Cba_PrsAddBlifDirectives(Cba_Prs_t *p)
Definition: cbaReadBlif.c:61
static void Cba_PrsFree(Cba_Prs_t *p)
Definition: cbaPrs.h:183
Cba_Man_t* Cba_PrsReadVerilog ( char *  pFileName)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 714 of file cbaReadVer.c.

715 {
716  Cba_Man_t * pDesign = NULL;
717  Cba_Prs_t * p = Cba_PrsAlloc( pFileName );
718  if ( p == NULL )
719  return NULL;
721  Cba_PrsReadDesign( p );
722  Cba_PrsPrintModules( p );
723  if ( Cba_PrsErrorPrint(p) )
724  ABC_SWAP( Cba_Man_t *, pDesign, p->pDesign );
725  Cba_PrsFree( p );
726  return pDesign;
727 }
void Cba_PrsPrintModules(Cba_Prs_t *p)
Definition: cbaReadVer.c:686
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Cba_PrsReadDesign(Cba_Prs_t *p)
Definition: cbaReadVer.c:655
#define ABC_SWAP(Type, a, b)
Definition: abc_global.h:218
Cba_Man_t * pDesign
Definition: cbaPrs.h:60
static Cba_Prs_t * Cba_PrsAlloc(char *pFileName)
Definition: cbaPrs.h:168
static int Cba_PrsErrorPrint(Cba_Prs_t *p)
Definition: cbaPrs.h:104
Definition: cba.h:82
static void Cba_PrsFree(Cba_Prs_t *p)
Definition: cbaPrs.h:183
static void Cba_PrsAddVerilogDirectives(Cba_Prs_t *p)
Definition: cbaReadVer.c:65
void Cba_PrsWriteBlif ( char *  pFileName,
Cba_Man_t pDes 
)

Definition at line 105 of file cbaWriteBlif.c.

106 {
107  FILE * pFile;
108  Cba_Ntk_t * pNtk;
109  int i;
110  pFile = fopen( pFileName, "wb" );
111  if ( pFile == NULL )
112  {
113  printf( "Cannot open output file \"%s\".\n", pFileName );
114  return;
115  }
116  fprintf( pFile, "// Design \"%s\" written by ABC on %s\n\n", Cba_ManName(pDes), Extra_TimeStamp() );
117  Cba_ManForEachNtk( pDes, pNtk, i )
118  Cba_PrsWriteBlifNtk( pFile, pNtk );
119  fclose( pFile );
120 }
Definition: cba.h:99
static char * Cba_ManName(Cba_Man_t *p)
Definition: cba.h:120
void Cba_PrsWriteBlifNtk(FILE *pFile, Cba_Ntk_t *p)
Definition: cbaWriteBlif.c:87
char * Extra_TimeStamp()
#define Cba_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
Definition: cba.h:155
void Cba_PrsWriteVerilog ( char *  pFileName,
Cba_Man_t pDes 
)

Definition at line 207 of file cbaWriteVer.c.

208 {
209  FILE * pFile;
210  Cba_Ntk_t * pNtk;
211  int i;
212  pFile = fopen( pFileName, "wb" );
213  if ( pFile == NULL )
214  {
215  printf( "Cannot open output file \"%s\".\n", pFileName );
216  return;
217  }
218  fprintf( pFile, "// Design \"%s\" written by ABC on %s\n\n", Cba_ManName(pDes), Extra_TimeStamp() );
219  Cba_ManForEachNtk( pDes, pNtk, i )
220  Cba_PrsWriteVerilogNtk( pFile, pNtk );
221  fclose( pFile );
222 }
Definition: cba.h:99
void Cba_PrsWriteVerilogNtk(FILE *pFile, Cba_Ntk_t *p)
Definition: cbaWriteVer.c:181
static char * Cba_ManName(Cba_Man_t *p)
Definition: cba.h:120
char * Extra_TimeStamp()
#define Cba_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
Definition: cba.h:155