abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
wlc.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"

Go to the source code of this file.

Data Structures

struct  Wlc_Obj_t_
 
struct  Wlc_Ntk_t_
 

Macros

#define Wlc_NtkForEachObj(p, pObj, i)   for ( i = 1; (i < Wlc_NtkObjNumMax(p)) && (((pObj) = Wlc_NtkObj(p, i)), 1); i++ )
 MACRO DEFINITIONS ///. More...
 
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)   for ( i = 0; (i < Vec_IntSize(vVec)) && (((pObj) = Wlc_NtkObj(p, Vec_IntEntry(vVec, i))), 1); i++ )
 
#define Wlc_NtkForEachPi(p, pPi, i)   for ( i = 0; (i < Wlc_NtkPiNum(p)) && (((pPi) = Wlc_NtkPi(p, i)), 1); i++ )
 
#define Wlc_NtkForEachPo(p, pPo, i)   for ( i = 0; (i < Wlc_NtkPoNum(p)) && (((pPo) = Wlc_NtkPo(p, i)), 1); i++ )
 
#define Wlc_NtkForEachCi(p, pCi, i)   for ( i = 0; (i < Wlc_NtkCiNum(p)) && (((pCi) = Wlc_NtkCi(p, i)), 1); i++ )
 
#define Wlc_NtkForEachCo(p, pCo, i)   for ( i = 0; (i < Wlc_NtkCoNum(p)) && (((pCo) = Wlc_NtkCo(p, i)), 1); i++ )
 
#define Wlc_NtkForEachFf(p, pFf, i)   for ( i = 0; (i < Vec_IntSize(&p->vFfs)) && (((pFf) = Wlc_NtkFf(p, i)), 1); i++ )
 
#define Wlc_ObjForEachFanin(pObj, iFanin, i)   for ( i = 0; (i < Wlc_ObjFaninNum(pObj)) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i++ )
 
#define Wlc_ObjForEachFaninReverse(pObj, iFanin, i)   for ( i = Wlc_ObjFaninNum(pObj) - 1; (i >= 0) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i-- )
 

Typedefs

typedef struct Wlc_Obj_t_ Wlc_Obj_t
 BASIC TYPES ///. More...
 
typedef struct Wlc_Ntk_t_ Wlc_Ntk_t
 

Enumerations

enum  Wlc_ObjType_t {
  WLC_OBJ_NONE = 0, WLC_OBJ_PI, WLC_OBJ_PO, WLC_OBJ_FO,
  WLC_OBJ_FI, WLC_OBJ_FF, WLC_OBJ_CONST, WLC_OBJ_BUF,
  WLC_OBJ_MUX, WLC_OBJ_SHIFT_R, WLC_OBJ_SHIFT_RA, WLC_OBJ_SHIFT_L,
  WLC_OBJ_SHIFT_LA, WLC_OBJ_ROTATE_R, WLC_OBJ_ROTATE_L, WLC_OBJ_BIT_NOT,
  WLC_OBJ_BIT_AND, WLC_OBJ_BIT_OR, WLC_OBJ_BIT_XOR, WLC_OBJ_BIT_SELECT,
  WLC_OBJ_BIT_CONCAT, WLC_OBJ_BIT_ZEROPAD, WLC_OBJ_BIT_SIGNEXT, WLC_OBJ_LOGIC_NOT,
  WLC_OBJ_LOGIC_AND, WLC_OBJ_LOGIC_OR, WLC_OBJ_COMP_EQU, WLC_OBJ_COMP_NOTEQU,
  WLC_OBJ_COMP_LESS, WLC_OBJ_COMP_MORE, WLC_OBJ_COMP_LESSEQU, WLC_OBJ_COMP_MOREEQU,
  WLC_OBJ_REDUCT_AND, WLC_OBJ_REDUCT_OR, WLC_OBJ_REDUCT_XOR, WLC_OBJ_ARI_ADD,
  WLC_OBJ_ARI_SUB, WLC_OBJ_ARI_MULTI, WLC_OBJ_ARI_DIVIDE, WLC_OBJ_ARI_MODULUS,
  WLC_OBJ_ARI_POWER, WLC_OBJ_ARI_MINUS, WLC_OBJ_TABLE, WLC_OBJ_NUMBER
}
 INCLUDES ///. More...
 

Functions

static int Wlc_NtkObjNum (Wlc_Ntk_t *p)
 
static int Wlc_NtkObjNumMax (Wlc_Ntk_t *p)
 
static int Wlc_NtkPiNum (Wlc_Ntk_t *p)
 
static int Wlc_NtkPoNum (Wlc_Ntk_t *p)
 
static int Wlc_NtkCiNum (Wlc_Ntk_t *p)
 
static int Wlc_NtkCoNum (Wlc_Ntk_t *p)
 
static int Wlc_NtkFfNum (Wlc_Ntk_t *p)
 
static Wlc_Obj_tWlc_NtkObj (Wlc_Ntk_t *p, int Id)
 
static Wlc_Obj_tWlc_NtkPi (Wlc_Ntk_t *p, int i)
 
static Wlc_Obj_tWlc_NtkPo (Wlc_Ntk_t *p, int i)
 
static Wlc_Obj_tWlc_NtkCi (Wlc_Ntk_t *p, int i)
 
static Wlc_Obj_tWlc_NtkCo (Wlc_Ntk_t *p, int i)
 
static Wlc_Obj_tWlc_NtkFf (Wlc_Ntk_t *p, int i)
 
static int Wlc_ObjIsPi (Wlc_Obj_t *p)
 
static int Wlc_ObjIsPo (Wlc_Obj_t *p)
 
static int Wlc_ObjIsCi (Wlc_Obj_t *p)
 
static int Wlc_ObjIsCo (Wlc_Obj_t *p)
 
static int Wlc_ObjId (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static int Wlc_ObjCiId (Wlc_Obj_t *p)
 
static int Wlc_ObjFaninNum (Wlc_Obj_t *p)
 
static int Wlc_ObjHasArray (Wlc_Obj_t *p)
 
static int * Wlc_ObjFanins (Wlc_Obj_t *p)
 
static int Wlc_ObjFaninId (Wlc_Obj_t *p, int i)
 
static int Wlc_ObjFaninId0 (Wlc_Obj_t *p)
 
static int Wlc_ObjFaninId1 (Wlc_Obj_t *p)
 
static int Wlc_ObjFaninId2 (Wlc_Obj_t *p)
 
static Wlc_Obj_tWlc_ObjFanin (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int i)
 
static Wlc_Obj_tWlc_ObjFanin0 (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static Wlc_Obj_tWlc_ObjFanin1 (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static Wlc_Obj_tWlc_ObjFanin2 (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static int Wlc_ObjRange (Wlc_Obj_t *p)
 
static int Wlc_ObjRangeEnd (Wlc_Obj_t *p)
 
static int Wlc_ObjRangeBeg (Wlc_Obj_t *p)
 
static int Wlc_ObjIsSigned (Wlc_Obj_t *p)
 
static int Wlc_ObjIsSignedFanin01 (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static int Wlc_ObjSign (Wlc_Obj_t *p)
 
static int * Wlc_ObjConstValue (Wlc_Obj_t *p)
 
static int Wlc_ObjTableId (Wlc_Obj_t *p)
 
static wordWlc_ObjTable (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static void Wlc_NtkCleanCopy (Wlc_Ntk_t *p)
 
static int Wlc_NtkHasCopy (Wlc_Ntk_t *p)
 
static void Wlc_ObjSetCopy (Wlc_Ntk_t *p, int iObj, int i)
 
static int Wlc_ObjCopy (Wlc_Ntk_t *p, int iObj)
 
static Wlc_Obj_tWlc_ObjCopyObj (Wlc_Ntk_t *pNew, Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
static void Wlc_NtkCleanNameId (Wlc_Ntk_t *p)
 
static int Wlc_NtkHasNameId (Wlc_Ntk_t *p)
 
static void Wlc_ObjSetNameId (Wlc_Ntk_t *p, int iObj, int i)
 
static int Wlc_ObjNameId (Wlc_Ntk_t *p, int iObj)
 
static Wlc_Obj_tWlc_ObjFoToFi (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
int Wlc_NtkPairIsUifable (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Wlc_Obj_t *pObj2)
 FUNCTION DECLARATIONS ///. More...
 
Vec_Int_tWlc_NtkCollectMultipliers (Wlc_Ntk_t *p)
 
Vec_Int_tWlc_NtkFindUifableMultiplierPairs (Wlc_Ntk_t *p)
 
Wlc_Ntk_tWlc_NtkAbstractNodes (Wlc_Ntk_t *pNtk, Vec_Int_t *vNodes)
 
Wlc_Ntk_tWlc_NtkUifNodePairs (Wlc_Ntk_t *pNtk, Vec_Int_t *vPairs)
 
Gia_Man_tWlc_NtkBitBlast (Wlc_Ntk_t *p, Vec_Int_t *vBoxIds)
 
Wlc_Ntk_tWlc_NtkAlloc (char *pName, int nObjsAlloc)
 FUNCTION DEFINITIONS ///. More...
 
int Wlc_ObjAlloc (Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg)
 
int Wlc_ObjCreate (Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg, Vec_Int_t *vFanins)
 
void Wlc_ObjSetCi (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
void Wlc_ObjSetCo (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int fFlopInput)
 
char * Wlc_ObjName (Wlc_Ntk_t *p, int iObj)
 
void Wlc_ObjUpdateType (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int Type)
 
void Wlc_ObjAddFanins (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vFanins)
 
void Wlc_NtkFree (Wlc_Ntk_t *p)
 
void Wlc_NtkPrintNodes (Wlc_Ntk_t *p, int Type)
 
void Wlc_NtkPrintStats (Wlc_Ntk_t *p, int fDistrib, int fVerbose)
 
Wlc_Ntk_tWlc_NtkDupDfs (Wlc_Ntk_t *p)
 
void Wlc_NtkTransferNames (Wlc_Ntk_t *pNew, Wlc_Ntk_t *p)
 
Wlc_Ntk_tWlc_ReadVer (char *pFileName)
 
void Wlc_WriteVer (Wlc_Ntk_t *p, char *pFileName)
 

Macro Definition Documentation

#define Wlc_NtkForEachCi (   p,
  pCi,
 
)    for ( i = 0; (i < Wlc_NtkCiNum(p)) && (((pCi) = Wlc_NtkCi(p, i)), 1); i++ )

Definition at line 214 of file wlc.h.

#define Wlc_NtkForEachCo (   p,
  pCo,
 
)    for ( i = 0; (i < Wlc_NtkCoNum(p)) && (((pCo) = Wlc_NtkCo(p, i)), 1); i++ )

Definition at line 216 of file wlc.h.

#define Wlc_NtkForEachFf (   p,
  pFf,
 
)    for ( i = 0; (i < Vec_IntSize(&p->vFfs)) && (((pFf) = Wlc_NtkFf(p, i)), 1); i++ )

Definition at line 218 of file wlc.h.

#define Wlc_NtkForEachObj (   p,
  pObj,
 
)    for ( i = 1; (i < Wlc_NtkObjNumMax(p)) && (((pObj) = Wlc_NtkObj(p, i)), 1); i++ )

MACRO DEFINITIONS ///.

ITERATORS ///

Definition at line 206 of file wlc.h.

#define Wlc_NtkForEachObjVec (   vVec,
  p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(vVec)) && (((pObj) = Wlc_NtkObj(p, Vec_IntEntry(vVec, i))), 1); i++ )

Definition at line 208 of file wlc.h.

#define Wlc_NtkForEachPi (   p,
  pPi,
 
)    for ( i = 0; (i < Wlc_NtkPiNum(p)) && (((pPi) = Wlc_NtkPi(p, i)), 1); i++ )

Definition at line 210 of file wlc.h.

#define Wlc_NtkForEachPo (   p,
  pPo,
 
)    for ( i = 0; (i < Wlc_NtkPoNum(p)) && (((pPo) = Wlc_NtkPo(p, i)), 1); i++ )

Definition at line 212 of file wlc.h.

#define Wlc_ObjForEachFanin (   pObj,
  iFanin,
 
)    for ( i = 0; (i < Wlc_ObjFaninNum(pObj)) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i++ )

Definition at line 221 of file wlc.h.

#define Wlc_ObjForEachFaninReverse (   pObj,
  iFanin,
 
)    for ( i = Wlc_ObjFaninNum(pObj) - 1; (i >= 0) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i-- )

Definition at line 223 of file wlc.h.

Typedef Documentation

typedef struct Wlc_Ntk_t_ Wlc_Ntk_t

Definition at line 114 of file wlc.h.

typedef struct Wlc_Obj_t_ Wlc_Obj_t

BASIC TYPES ///.

Definition at line 99 of file wlc.h.

Enumeration Type Documentation

INCLUDES ///.

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

FileName [wlc.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 - August 22, 2014.]

Revision [

Id:
wlc.h,v 1.00 2014/09/12 00:00:00 alanmi Exp

]PARAMETERS ///

Enumerator
WLC_OBJ_NONE 
WLC_OBJ_PI 
WLC_OBJ_PO 
WLC_OBJ_FO 
WLC_OBJ_FI 
WLC_OBJ_FF 
WLC_OBJ_CONST 
WLC_OBJ_BUF 
WLC_OBJ_MUX 
WLC_OBJ_SHIFT_R 
WLC_OBJ_SHIFT_RA 
WLC_OBJ_SHIFT_L 
WLC_OBJ_SHIFT_LA 
WLC_OBJ_ROTATE_R 
WLC_OBJ_ROTATE_L 
WLC_OBJ_BIT_NOT 
WLC_OBJ_BIT_AND 
WLC_OBJ_BIT_OR 
WLC_OBJ_BIT_XOR 
WLC_OBJ_BIT_SELECT 
WLC_OBJ_BIT_CONCAT 
WLC_OBJ_BIT_ZEROPAD 
WLC_OBJ_BIT_SIGNEXT 
WLC_OBJ_LOGIC_NOT 
WLC_OBJ_LOGIC_AND 
WLC_OBJ_LOGIC_OR 
WLC_OBJ_COMP_EQU 
WLC_OBJ_COMP_NOTEQU 
WLC_OBJ_COMP_LESS 
WLC_OBJ_COMP_MORE 
WLC_OBJ_COMP_LESSEQU 
WLC_OBJ_COMP_MOREEQU 
WLC_OBJ_REDUCT_AND 
WLC_OBJ_REDUCT_OR 
WLC_OBJ_REDUCT_XOR 
WLC_OBJ_ARI_ADD 
WLC_OBJ_ARI_SUB 
WLC_OBJ_ARI_MULTI 
WLC_OBJ_ARI_DIVIDE 
WLC_OBJ_ARI_MODULUS 
WLC_OBJ_ARI_POWER 
WLC_OBJ_ARI_MINUS 
WLC_OBJ_TABLE 
WLC_OBJ_NUMBER 

Definition at line 43 of file wlc.h.

43  {
44  WLC_OBJ_NONE = 0, // 00: unknown
45  WLC_OBJ_PI, // 01: primary input
46  WLC_OBJ_PO, // 02: primary output (unused)
47  WLC_OBJ_FO, // 03: flop output
48  WLC_OBJ_FI, // 04: flop input (unused)
49  WLC_OBJ_FF, // 05: flop (unused)
50  WLC_OBJ_CONST, // 06: constant
51  WLC_OBJ_BUF, // 07: buffer
52  WLC_OBJ_MUX, // 08: multiplexer
53  WLC_OBJ_SHIFT_R, // 09: shift right
54  WLC_OBJ_SHIFT_RA, // 10: shift right (arithmetic)
55  WLC_OBJ_SHIFT_L, // 11: shift left
56  WLC_OBJ_SHIFT_LA, // 12: shift left (arithmetic)
57  WLC_OBJ_ROTATE_R, // 13: rotate right
58  WLC_OBJ_ROTATE_L, // 14: rotate left
59  WLC_OBJ_BIT_NOT, // 15: bitwise NOT
60  WLC_OBJ_BIT_AND, // 16: bitwise AND
61  WLC_OBJ_BIT_OR, // 17: bitwise OR
62  WLC_OBJ_BIT_XOR, // 18: bitwise XOR
63  WLC_OBJ_BIT_SELECT, // 19: bit selection
64  WLC_OBJ_BIT_CONCAT, // 20: bit concatenation
65  WLC_OBJ_BIT_ZEROPAD, // 21: zero padding
66  WLC_OBJ_BIT_SIGNEXT, // 22: sign extension
67  WLC_OBJ_LOGIC_NOT, // 23: logic NOT
68  WLC_OBJ_LOGIC_AND, // 24: logic AND
69  WLC_OBJ_LOGIC_OR, // 25: logic OR
70  WLC_OBJ_COMP_EQU, // 26: compare equal
71  WLC_OBJ_COMP_NOTEQU, // 27: compare not equal
72  WLC_OBJ_COMP_LESS, // 28: compare less
73  WLC_OBJ_COMP_MORE, // 29: compare more
74  WLC_OBJ_COMP_LESSEQU, // 30: compare less or equal
75  WLC_OBJ_COMP_MOREEQU, // 31: compare more or equal
76  WLC_OBJ_REDUCT_AND, // 32: reduction AND
77  WLC_OBJ_REDUCT_OR, // 33: reduction OR
78  WLC_OBJ_REDUCT_XOR, // 34: reduction XOR
79  WLC_OBJ_ARI_ADD, // 35: arithmetic addition
80  WLC_OBJ_ARI_SUB, // 36: arithmetic subtraction
81  WLC_OBJ_ARI_MULTI, // 37: arithmetic multiplier
82  WLC_OBJ_ARI_DIVIDE, // 38: arithmetic division
83  WLC_OBJ_ARI_MODULUS, // 39: arithmetic modulus
84  WLC_OBJ_ARI_POWER, // 40: arithmetic power
85  WLC_OBJ_ARI_MINUS, // 41: arithmetic minus
86  WLC_OBJ_TABLE, // 42: bit table
87  WLC_OBJ_NUMBER // 43: unused
Definition: wlc.h:49
Definition: wlc.h:48
Wlc_ObjType_t
INCLUDES ///.
Definition: wlc.h:43
Definition: wlc.h:47
Definition: wlc.h:45
Definition: wlc.h:46

Function Documentation

Wlc_Ntk_t* Wlc_NtkAbstractNodes ( Wlc_Ntk_t p,
Vec_Int_t vNodesInit 
)

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

Synopsis [Abstracts nodes by replacing their outputs with new PIs.]

Description [If array is NULL, abstract all multipliers.]

SideEffects []

SeeAlso []

Definition at line 137 of file wlcAbs.c.

138 {
139  Vec_Int_t * vNodes = vNodesInit;
140  Wlc_Ntk_t * pNew;
141  Wlc_Obj_t * pObj;
142  int i, k, iObj, iFanin;
143  // get multipliers if not given
144  if ( vNodes == NULL )
145  vNodes = Wlc_NtkCollectMultipliers( p );
146  if ( vNodes == NULL )
147  return NULL;
148  // mark nodes
149  Wlc_NtkForEachObjVec( vNodes, p, pObj, i )
150  pObj->Mark = 1;
151  // iterate through the nodes in the DFS order
152  Wlc_NtkCleanCopy( p );
153  Wlc_NtkForEachObj( p, pObj, i )
154  {
155  if ( i == Vec_IntSize(&p->vCopies) )
156  break;
157  if ( pObj->Mark ) {
158  // clean
159  pObj->Mark = 0;
160  // add fresh PI with the same number of bits
161  iObj = Wlc_ObjAlloc( p, WLC_OBJ_PI, Wlc_ObjIsSigned(pObj), Wlc_ObjRange(pObj) - 1, 0 );
162  }
163  else {
164  // update fanins
165  Wlc_ObjForEachFanin( pObj, iFanin, k )
166  Wlc_ObjFanins(pObj)[k] = Wlc_ObjCopy(p, iFanin);
167  // node to remain
168  iObj = i;
169  }
170  Wlc_ObjSetCopy( p, i, iObj );
171  }
172  // POs do not change in this procedure
173  if ( vNodes != vNodesInit )
174  Vec_IntFree( vNodes );
175  // reconstruct topological order
176  pNew = Wlc_NtkDupDfs( p );
177  Wlc_NtkTransferNames( pNew, p );
178  return pNew;
179 }
static int Wlc_ObjIsSigned(Wlc_Obj_t *p)
Definition: wlc.h:178
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
Definition: wlc.h:221
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
Definition: wlc.h:208
void Wlc_NtkTransferNames(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p)
Definition: wlcNtk.c:475
Vec_Int_t * Wlc_NtkCollectMultipliers(Wlc_Ntk_t *p)
Definition: wlcAbs.c:76
static int Wlc_ObjRange(Wlc_Obj_t *p)
Definition: wlc.h:175
static void Wlc_NtkCleanCopy(Wlc_Ntk_t *p)
Definition: wlc.h:185
int Wlc_ObjAlloc(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition: wlcNtk.c:141
static void Wlc_ObjSetCopy(Wlc_Ntk_t *p, int iObj, int i)
Definition: wlc.h:187
if(last==0)
Definition: sparse_int.h:34
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: wlc.h:206
Definition: wlc.h:45
Wlc_Ntk_t * Wlc_NtkDupDfs(Wlc_Ntk_t *p)
Definition: wlcNtk.c:457
static int Wlc_ObjCopy(Wlc_Ntk_t *p, int iObj)
Definition: wlc.h:188
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
Wlc_Ntk_t* Wlc_NtkAlloc ( char *  pName,
int  nObjsAlloc 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Working with models.]

Description []

SideEffects []

SeeAlso []

Definition at line 94 of file wlcNtk.c.

95 {
96  Wlc_Ntk_t * p;
97  p = ABC_CALLOC( Wlc_Ntk_t, 1 );
98  p->pName = Extra_FileNameGeneric( pName );
99  Vec_IntGrow( &p->vPis, 111 );
100  Vec_IntGrow( &p->vPos, 111 );
101  Vec_IntGrow( &p->vCis, 111 );
102  Vec_IntGrow( &p->vCos, 111 );
103  Vec_IntGrow( &p->vFfs, 111 );
104  p->pMemFanin = Mem_FlexStart();
105  p->nObjsAlloc = nObjsAlloc;
106  p->pObjs = ABC_CALLOC( Wlc_Obj_t, p->nObjsAlloc );
107  p->iObj = 1;
108  return p;
109 }
Mem_Flex_t * pMemFanin
Definition: wlc.h:129
Vec_Int_t vCis
Definition: wlc.h:120
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Wlc_Obj_t * pObjs
Definition: wlc.h:126
int iObj
Definition: wlc.h:127
Vec_Int_t vPis
Definition: wlc.h:118
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
Definition: bblif.c:336
Mem_Flex_t * Mem_FlexStart()
Definition: mem.c:311
char * pName
Definition: wlc.h:117
char * Extra_FileNameGeneric(char *FileName)
int nObjsAlloc
Definition: wlc.h:128
Vec_Int_t vPos
Definition: wlc.h:119
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
Vec_Int_t vCos
Definition: wlc.h:121
Vec_Int_t vFfs
Definition: wlc.h:122
Gia_Man_t* Wlc_NtkBitBlast ( Wlc_Ntk_t p,
Vec_Int_t vBoxIds 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 405 of file wlcBlast.c.

406 {
407  int fVerbose = 0;
408  Tim_Man_t * pManTime = NULL;
409  Gia_Man_t * pTemp, * pNew, * pExtra = NULL;
410  Wlc_Obj_t * pObj, * pPrev = NULL;
411  Vec_Int_t * vBits, * vTemp0, * vTemp1, * vTemp2, * vRes;
412  int nBits = Wlc_NtkPrepareBits( p );
413  int nRange, nRange0, nRange1, nRange2;
414  int i, k, b, iFanin, iLit, nAndPrev, * pFans0, * pFans1, * pFans2;
415  int nFFins = 0, nFFouts = 0, curPi = 0, curPo = 0;
416  int nBitCis = 0, nBitCos = 0;
417  vBits = Vec_IntAlloc( nBits );
418  vTemp0 = Vec_IntAlloc( 1000 );
419  vTemp1 = Vec_IntAlloc( 1000 );
420  vTemp2 = Vec_IntAlloc( 1000 );
421  vRes = Vec_IntAlloc( 1000 );
422  // clean AND-gate counters
423  memset( p->nAnds, 0, sizeof(int) * WLC_OBJ_NUMBER );
424  // create AIG manager
425  pNew = Gia_ManStart( 5 * Wlc_NtkObjNum(p) + 1000 );
426  pNew->pName = Abc_UtilStrsav( p->pName );
427  Gia_ManHashAlloc( pNew );
428  // prepare for AIG with boxes
429  if ( vBoxIds )
430  {
431  int nNewCis = 0, nNewCos = 0;
432  Wlc_NtkForEachObj( p, pObj, i )
433  pObj->Mark = 0;
434  // count bit-width of regular CIs/COs
435  Wlc_NtkForEachCi( p, pObj, i )
436  nBitCis += Wlc_ObjRange( pObj );
437  Wlc_NtkForEachCo( p, pObj, i )
438  nBitCos += Wlc_ObjRange( pObj );
439  // count bit-width of additional CIs/COs due to selected multipliers
440  assert( Vec_IntSize(vBoxIds) > 0 );
441  Wlc_NtkForEachObjVec( vBoxIds, p, pObj, i )
442  {
443  // currently works only for multipliers
444  assert( pObj->Type == WLC_OBJ_ARI_MULTI );
445  nNewCis += Wlc_ObjRange( pObj );
446  nNewCos += Wlc_ObjRange( Wlc_ObjFanin0(p, pObj) );
447  nNewCos += Wlc_ObjRange( Wlc_ObjFanin1(p, pObj) );
448  pObj->Mark = 1;
449  }
450  // create hierarchy manager
451  pManTime = Tim_ManStart( nBitCis + nNewCis, nBitCos + nNewCos );
452  curPi = nBitCis;
453  curPo = 0;
454  // create AIG manager for logic of the boxes
455  pExtra = Gia_ManStart( Wlc_NtkObjNum(p) );
456  Gia_ManHashAlloc( pExtra );
457  }
458  // blast in the topological order
459  Wlc_NtkForEachObj( p, pObj, i )
460  {
461 // char * pName = Wlc_ObjName(p, i);
462  nAndPrev = Gia_ManAndNum(pNew);
463  nRange = Wlc_ObjRange( pObj );
464  nRange0 = Wlc_ObjFaninNum(pObj) > 0 ? Wlc_ObjRange( Wlc_ObjFanin0(p, pObj) ) : -1;
465  nRange1 = Wlc_ObjFaninNum(pObj) > 1 ? Wlc_ObjRange( Wlc_ObjFanin1(p, pObj) ) : -1;
466  nRange2 = Wlc_ObjFaninNum(pObj) > 2 ? Wlc_ObjRange( Wlc_ObjFanin2(p, pObj) ) : -1;
467  pFans0 = Wlc_ObjFaninNum(pObj) > 0 ? Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjFaninId0(pObj)) ) : NULL;
468  pFans1 = Wlc_ObjFaninNum(pObj) > 1 ? Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjFaninId1(pObj)) ) : NULL;
469  pFans2 = Wlc_ObjFaninNum(pObj) > 2 ? Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjFaninId2(pObj)) ) : NULL;
470  Vec_IntClear( vRes );
471  assert( nRange > 0 );
472  if ( vBoxIds && pObj->Mark )
473  {
474  pObj->Mark = 0;
475 
476  // create new box
477  Tim_ManCreateBox( pManTime, curPo, nRange0 + nRange1, curPi, nRange, -1 );
478  curPi += nRange;
479  curPo += nRange0 + nRange1;
480 
481  // create combinational outputs in the normal manager
482  for ( k = 0; k < nRange0; k++ )
483  Gia_ManAppendCo( pNew, pFans0[k] );
484  for ( k = 0; k < nRange1; k++ )
485  Gia_ManAppendCo( pNew, pFans1[k] );
486 
487  // make sure there is enough primary inputs in the manager
488  for ( k = Gia_ManPiNum(pExtra); k < nRange0 + nRange1; k++ )
489  Gia_ManAppendCi( pExtra );
490  // create combinational inputs
491  Vec_IntClear( vTemp0 );
492  for ( k = 0; k < nRange0; k++ )
493  Vec_IntPush( vTemp0, Gia_Obj2Lit(pExtra, Gia_ManPi(pExtra, k)) );
494  Vec_IntClear( vTemp1 );
495  for ( k = 0; k < nRange1; k++ )
496  Vec_IntPush( vTemp1, Gia_Obj2Lit(pExtra, Gia_ManPi(pExtra, nRange0+k)) );
497  // get new fanin arrays
498  pFans0 = Vec_IntArray( vTemp0 );
499  pFans1 = Vec_IntArray( vTemp1 );
500  // bit-blast the multiplier in the external manager
501  {
502  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
503  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
504  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
505  Wlc_BlastMultiplier( pExtra, pArg0, pArg1, nRange, vTemp2, vRes );
506  Vec_IntShrink( vRes, nRange );
507  }
508  // create outputs in the external manager
509  for ( k = 0; k < nRange; k++ )
510  Gia_ManAppendCo( pExtra, Vec_IntEntry(vRes, k) );
511 
512  // create combinational inputs in the normal manager
513  Vec_IntClear( vRes );
514  for ( k = 0; k < nRange; k++ )
515  Vec_IntPush( vRes, Gia_ManAppendCi(pNew) );
516  }
517  else if ( Wlc_ObjIsCi(pObj) )
518  {
519  for ( k = 0; k < nRange; k++ )
520  Vec_IntPush( vRes, Gia_ManAppendCi(pNew) );
521  if ( pObj->Type == WLC_OBJ_FO )
522  nFFouts += Vec_IntSize(vRes);
523  }
524  else if ( pObj->Type == WLC_OBJ_BUF )
525  {
526  int nRangeMax = Abc_MaxInt( nRange0, nRange );
527  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjFanin0(p, pObj)->Signed );
528  for ( k = 0; k < nRange; k++ )
529  Vec_IntPush( vRes, pArg0[k] );
530  }
531  else if ( pObj->Type == WLC_OBJ_CONST )
532  {
533  word * pTruth = (word *)Wlc_ObjFanins(pObj);
534  for ( k = 0; k < nRange; k++ )
535  Vec_IntPush( vRes, Abc_TtGetBit(pTruth, k) );
536  }
537  else if ( pObj->Type == WLC_OBJ_MUX )
538  {
539  assert( 1 + (1 << nRange0) == Wlc_ObjFaninNum(pObj) );
540  for ( b = 0; b < nRange; b++ )
541  {
542  Vec_IntClear( vTemp0 );
543  Wlc_ObjForEachFanin( pObj, iFanin, k )
544  {
545  if ( !k ) continue;
546  //assert( nRange == Wlc_ObjRange(Wlc_NtkObj(p, iFanin)) );
547  pFans1 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, iFanin) );
548  Vec_IntPush( vTemp0, b < Wlc_ObjRange(Wlc_NtkObj(p, iFanin)) ? pFans1[b] : 0 );
549  }
550  Vec_IntPush( vRes, Wlc_NtkMuxTree_rec(pNew, pFans0, nRange0, vTemp0, 0) );
551  }
552  }
553  else if ( pObj->Type == WLC_OBJ_SHIFT_R || pObj->Type == WLC_OBJ_SHIFT_RA ||
554  pObj->Type == WLC_OBJ_SHIFT_L || pObj->Type == WLC_OBJ_SHIFT_LA )
555  {
556  int nRangeMax = Abc_MaxInt( nRange, nRange0 );
557  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjFanin0(p, pObj)->Signed );
558  if ( pObj->Type == WLC_OBJ_SHIFT_R || pObj->Type == WLC_OBJ_SHIFT_RA )
559  Wlc_BlastShiftRight( pNew, pArg0, nRangeMax, pFans1, nRange1, Wlc_ObjFanin0(p, pObj)->Signed && pObj->Type == WLC_OBJ_SHIFT_RA, vRes );
560  else
561  Wlc_BlastShiftLeft( pNew, pArg0, nRangeMax, pFans1, nRange1, 0, vRes );
562  Vec_IntShrink( vRes, nRange );
563  }
564  else if ( pObj->Type == WLC_OBJ_ROTATE_R )
565  {
566  assert( nRange0 == nRange );
567  Wlc_BlastRotateRight( pNew, pFans0, nRange0, pFans1, nRange1, vRes );
568  }
569  else if ( pObj->Type == WLC_OBJ_ROTATE_L )
570  {
571  assert( nRange0 == nRange );
572  Wlc_BlastRotateLeft( pNew, pFans0, nRange0, pFans1, nRange1, vRes );
573  }
574  else if ( pObj->Type == WLC_OBJ_BIT_NOT )
575  {
576  int nRangeMax = Abc_MaxInt( nRange, nRange0 );
577  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjFanin0(p, pObj)->Signed );
578  for ( k = 0; k < nRange; k++ )
579  Vec_IntPush( vRes, Abc_LitNot(pArg0[k]) );
580  }
581  else if ( pObj->Type == WLC_OBJ_BIT_AND )
582  {
583  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
584  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
585  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
586  for ( k = 0; k < nRange; k++ )
587  Vec_IntPush( vRes, Gia_ManHashAnd(pNew, pArg0[k], pArg1[k]) );
588  }
589  else if ( pObj->Type == WLC_OBJ_BIT_OR )
590  {
591  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
592  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
593  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
594  for ( k = 0; k < nRange; k++ )
595  Vec_IntPush( vRes, Gia_ManHashOr(pNew, pArg0[k], pArg1[k]) );
596  }
597  else if ( pObj->Type == WLC_OBJ_BIT_XOR )
598  {
599  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
600  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
601  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
602  for ( k = 0; k < nRange; k++ )
603  Vec_IntPush( vRes, Gia_ManHashXor(pNew, pArg0[k], pArg1[k]) );
604  }
605  else if ( pObj->Type == WLC_OBJ_BIT_SELECT )
606  {
607  Wlc_Obj_t * pFanin = Wlc_ObjFanin0(p, pObj);
608  int End = Wlc_ObjRangeEnd(pObj);
609  int Beg = Wlc_ObjRangeBeg(pObj);
610  assert( nRange == End - Beg + 1 );
611  assert( (int)pFanin->Beg <= Beg && End <= (int)pFanin->End );
612  for ( k = Beg; k <= End; k++ )
613  Vec_IntPush( vRes, pFans0[k - pFanin->Beg] );
614  }
615  else if ( pObj->Type == WLC_OBJ_BIT_CONCAT )
616  {
617  int iFanin, nTotal = 0;
618  Wlc_ObjForEachFanin( pObj, iFanin, k )
619  nTotal += Wlc_ObjRange( Wlc_NtkObj(p, iFanin) );
620  assert( nRange == nTotal );
621  Wlc_ObjForEachFaninReverse( pObj, iFanin, k )
622  {
623  nRange0 = Wlc_ObjRange( Wlc_NtkObj(p, iFanin) );
624  pFans0 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, iFanin) );
625  for ( b = 0; b < nRange0; b++ )
626  Vec_IntPush( vRes, pFans0[b] );
627  }
628  }
629  else if ( pObj->Type == WLC_OBJ_BIT_ZEROPAD || pObj->Type == WLC_OBJ_BIT_SIGNEXT )
630  {
631  int Pad = pObj->Type == WLC_OBJ_BIT_ZEROPAD ? 0 : pFans0[nRange0-1];
632  assert( nRange0 < nRange );
633  for ( k = 0; k < nRange0; k++ )
634  Vec_IntPush( vRes, pFans0[k] );
635  for ( ; k < nRange; k++ )
636  Vec_IntPush( vRes, Pad );
637  }
638  else if ( pObj->Type == WLC_OBJ_LOGIC_NOT )
639  {
640  iLit = Wlc_BlastReduction( pNew, pFans0, nRange0, WLC_OBJ_REDUCT_OR );
641  Vec_IntFill( vRes, 1, Abc_LitNot(iLit) );
642  for ( k = 1; k < nRange; k++ )
643  Vec_IntPush( vRes, 0 );
644  }
645  else if ( pObj->Type == WLC_OBJ_LOGIC_AND )
646  {
647  int iLit0 = Wlc_BlastReduction( pNew, pFans0, nRange0, WLC_OBJ_REDUCT_OR );
648  int iLit1 = Wlc_BlastReduction( pNew, pFans1, nRange1, WLC_OBJ_REDUCT_OR );
649  Vec_IntFill( vRes, 1, Gia_ManHashAnd(pNew, iLit0, iLit1) );
650  for ( k = 1; k < nRange; k++ )
651  Vec_IntPush( vRes, 0 );
652  }
653  else if ( pObj->Type == WLC_OBJ_LOGIC_OR )
654  {
655  int iLit0 = Wlc_BlastReduction( pNew, pFans0, nRange0, WLC_OBJ_REDUCT_OR );
656  int iLit1 = Wlc_BlastReduction( pNew, pFans1, nRange1, WLC_OBJ_REDUCT_OR );
657  Vec_IntFill( vRes, 1, Gia_ManHashOr(pNew, iLit0, iLit1) );
658  for ( k = 1; k < nRange; k++ )
659  Vec_IntPush( vRes, 0 );
660  }
661  else if ( pObj->Type == WLC_OBJ_COMP_EQU || pObj->Type == WLC_OBJ_COMP_NOTEQU )
662  {
663  int iLit = 0, nRangeMax = Abc_MaxInt( nRange0, nRange1 );
664  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
665  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
666  for ( k = 0; k < nRangeMax; k++ )
667  iLit = Gia_ManHashOr( pNew, iLit, Gia_ManHashXor(pNew, pArg0[k], pArg1[k]) );
668  Vec_IntFill( vRes, 1, Abc_LitNotCond(iLit, pObj->Type == WLC_OBJ_COMP_EQU) );
669  for ( k = 1; k < nRange; k++ )
670  Vec_IntPush( vRes, 0 );
671  }
672  else if ( pObj->Type == WLC_OBJ_COMP_LESS || pObj->Type == WLC_OBJ_COMP_MOREEQU ||
673  pObj->Type == WLC_OBJ_COMP_MORE || pObj->Type == WLC_OBJ_COMP_LESSEQU )
674  {
675  int nRangeMax = Abc_MaxInt( nRange0, nRange1 );
676  int fSigned = Wlc_ObjIsSignedFanin01(p, pObj);
677  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, fSigned );
678  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, fSigned );
679  int fSwap = (pObj->Type == WLC_OBJ_COMP_MORE || pObj->Type == WLC_OBJ_COMP_LESSEQU);
680  int fCompl = (pObj->Type == WLC_OBJ_COMP_MOREEQU || pObj->Type == WLC_OBJ_COMP_LESSEQU);
681  if ( fSwap ) ABC_SWAP( int *, pArg0, pArg1 );
682  if ( fSigned )
683  iLit = Wlc_BlastLessSigned( pNew, pArg0, pArg1, nRangeMax );
684  else
685  iLit = Wlc_BlastLess( pNew, pArg0, pArg1, nRangeMax );
686  iLit = Abc_LitNotCond( iLit, fCompl );
687  Vec_IntFill( vRes, 1, iLit );
688  for ( k = 1; k < nRange; k++ )
689  Vec_IntPush( vRes, 0 );
690  }
691  else if ( pObj->Type == WLC_OBJ_REDUCT_AND || pObj->Type == WLC_OBJ_REDUCT_OR || pObj->Type == WLC_OBJ_REDUCT_XOR )
692  {
693  Vec_IntPush( vRes, Wlc_BlastReduction( pNew, pFans0, nRange0, pObj->Type ) );
694  for ( k = 1; k < nRange; k++ )
695  Vec_IntPush( vRes, 0 );
696  }
697  else if ( pObj->Type == WLC_OBJ_ARI_ADD || pObj->Type == WLC_OBJ_ARI_SUB )
698  {
699  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
700  int * pArg0 = Wlc_VecLoadFanins( vRes, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
701  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
702  if ( pObj->Type == WLC_OBJ_ARI_ADD )
703  Wlc_BlastAdder( pNew, pArg0, pArg1, nRange ); // result is in pFan0 (vRes)
704  else
705  Wlc_BlastSubtract( pNew, pArg0, pArg1, nRange ); // result is in pFan0 (vRes)
706  Vec_IntShrink( vRes, nRange );
707  }
708  else if ( pObj->Type == WLC_OBJ_ARI_MULTI )
709  {
710  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
711  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
712  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, Wlc_ObjIsSignedFanin01(p, pObj) );
713  Wlc_BlastMultiplier( pNew, pArg0, pArg1, nRange, vTemp2, vRes );
714  Vec_IntShrink( vRes, nRange );
715  }
716  else if ( pObj->Type == WLC_OBJ_ARI_DIVIDE || pObj->Type == WLC_OBJ_ARI_MODULUS )
717  {
718  int nRangeMax = Abc_MaxInt( nRange, Abc_MaxInt(nRange0, nRange1) );
719  int fSigned = Wlc_ObjIsSignedFanin01(p, pObj);
720  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, fSigned );
721  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, fSigned );
722  if ( fSigned )
723  Wlc_BlastDividerSigned( pNew, pArg0, nRangeMax, pArg1, nRangeMax, pObj->Type == WLC_OBJ_ARI_DIVIDE, vRes );
724  else
725  Wlc_BlastDivider( pNew, pArg0, nRangeMax, pArg1, nRangeMax, pObj->Type == WLC_OBJ_ARI_DIVIDE, vRes );
726  Vec_IntShrink( vRes, nRange );
727  Wlc_BlastZeroCondition( pNew, pFans1, nRange1, vRes );
728  }
729  else if ( pObj->Type == WLC_OBJ_ARI_MINUS )
730  {
731  int nRangeMax = Abc_MaxInt( nRange0, nRange );
732  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjFanin0(p, pObj)->Signed );
733  Wlc_BlastMinus( pNew, pArg0, nRangeMax, vRes );
734  Vec_IntShrink( vRes, nRange );
735  }
736  else if ( pObj->Type == WLC_OBJ_ARI_POWER )
737  {
738  int nRangeMax = Abc_MaxInt(nRange0, nRange);
739  int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, Wlc_ObjFanin0(p, pObj)->Signed );
740  int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRange1, Wlc_ObjFanin1(p, pObj)->Signed );
741  Wlc_BlastPower( pNew, pArg0, nRangeMax, pArg1, nRange1, vTemp2, vRes );
742  Vec_IntShrink( vRes, nRange );
743  }
744  else if ( pObj->Type == WLC_OBJ_TABLE )
745  Wlc_BlastTable( pNew, Wlc_ObjTable(p, pObj), pFans0, nRange0, nRange, vRes );
746  else assert( 0 );
747  assert( Vec_IntSize(vBits) == Wlc_ObjCopy(p, i) );
748  Vec_IntAppend( vBits, vRes );
749  pPrev = pObj;
750  p->nAnds[pObj->Type] += Gia_ManAndNum(pNew) - nAndPrev;
751  }
752  p->nAnds[0] = Gia_ManAndNum(pNew);
753  assert( nBits == Vec_IntSize(vBits) );
754  Vec_IntFree( vTemp0 );
755  Vec_IntFree( vTemp1 );
756  Vec_IntFree( vTemp2 );
757  Vec_IntFree( vRes );
758  // create COs
759  Wlc_NtkForEachCo( p, pObj, i )
760  {
761  nRange = Wlc_ObjRange( pObj );
762  pFans0 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjId(p, pObj)) );
763  if ( fVerbose )
764  printf( "%s(%d) ", Wlc_ObjName(p, Wlc_ObjId(p, pObj)), Gia_ManCoNum(pNew) );
765  for ( k = 0; k < nRange; k++ )
766  Gia_ManAppendCo( pNew, pFans0[k] );
767  if ( pObj->fIsFi )
768  nFFins += nRange;
769  }
770  if ( fVerbose )
771  printf( "\n" );
772  Vec_IntFree( vBits );
773  Vec_IntErase( &p->vCopies );
774  // set the number of registers
775  assert( nFFins == nFFouts );
776  Gia_ManSetRegNum( pNew, nFFins );
777  // finalize AIG
778  pNew = Gia_ManCleanup( pTemp = pNew );
779  Gia_ManStop( pTemp );
780  // finalize AIG with boxes
781  if ( vBoxIds )
782  {
783  curPo += nBitCos;
784  assert( curPi == Tim_ManCiNum(pManTime) );
785  assert( curPo == Tim_ManCoNum(pManTime) );
786  // finalize the extra AIG
787  pExtra = Gia_ManCleanup( pTemp = pExtra );
788  Gia_ManStop( pTemp );
789  assert( Gia_ManPoNum(pExtra) == Gia_ManCiNum(pNew) - nBitCis );
790  // attach
791  pNew->pAigExtra = pExtra;
792  pNew->pManTime = pManTime;
793  // normalize AIG
794  pNew = Gia_ManDupNormalize( pTemp = pNew );
795  Gia_ManTransferTiming( pNew, pTemp );
796  Gia_ManStop( pTemp );
797  //Tim_ManPrint( pManTime );
798  }
799  return pNew;
800 }
char * memset()
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
int Tim_ManCoNum(Tim_Man_t *p)
Definition: timMan.c:684
void Wlc_BlastPower(Gia_Man_t *pNew, int *pNum, int nNum, int *pExp, int nExp, Vec_Int_t *vTemp, Vec_Int_t *vRes)
Definition: wlcBlast.c:369
#define Wlc_NtkForEachCo(p, pCo, i)
Definition: wlc.h:216
void Wlc_BlastDividerSigned(Gia_Man_t *pNew, int *pNum, int nNum, int *pDiv, int nDiv, int fQuo, Vec_Int_t *vRes)
Definition: wlcBlast.c:303
void Wlc_BlastAdder(Gia_Man_t *pNew, int *pAdd0, int *pAdd1, int nBits)
Definition: wlcBlast.c:210
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
Definition: wlcNtk.c:167
static Wlc_Obj_t * Wlc_ObjFanin2(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:173
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
void Wlc_BlastTable(Gia_Man_t *pNew, word *pTable, int *pFans, int nFans, int nOuts, Vec_Int_t *vRes)
Definition: wlcBlast.c:344
static int Wlc_ObjFaninId1(Wlc_Obj_t *p)
Definition: wlc.h:168
Gia_Man_t * pAigExtra
Definition: gia.h:149
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
Definition: wlc.h:221
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:658
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Wlc_NtkObjNum(Wlc_Ntk_t *p)
Definition: wlc.h:141
ABC_NAMESPACE_IMPL_START int Wlc_NtkPrepareBits(Wlc_Ntk_t *p)
DECLARATIONS ///.
Definition: wlcBlast.c:46
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
Definition: wlc.h:208
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
void Wlc_BlastDivider(Gia_Man_t *pNew, int *pNum, int nNum, int *pDiv, int nDiv, int fQuo, Vec_Int_t *vRes)
Definition: wlcBlast.c:256
static int Wlc_ObjRangeEnd(Wlc_Obj_t *p)
Definition: wlc.h:176
static Wlc_Obj_t * Wlc_ObjFanin0(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:171
static void Vec_IntErase(Vec_Int_t *p)
Definition: vecInt.h:266
void Wlc_BlastRotateLeft(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, Vec_Int_t *vRes)
Definition: wlcBlast.c:153
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
void Wlc_BlastShiftRight(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, int fSticky, Vec_Int_t *vRes)
Definition: wlcBlast.c:105
void Wlc_BlastZeroCondition(Gia_Man_t *pNew, int *pDiv, int nDiv, Vec_Int_t *vRes)
Definition: wlcBlast.c:338
int Wlc_BlastReduction(Gia_Man_t *pNew, int *pFans, int nFans, int Type)
Definition: wlcBlast.c:167
int Wlc_BlastLessSigned(Gia_Man_t *pNew, int *pArg0, int *pArg1, int nBits)
Definition: wlcBlast.c:205
static int Abc_TtGetBit(word *p, int i)
MACRO DEFINITIONS ///.
Definition: utilTruth.h:149
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static int Wlc_ObjRange(Wlc_Obj_t *p)
Definition: wlc.h:175
int * Wlc_VecLoadFanins(Vec_Int_t *vOut, int *pFanins, int nFanins, int nTotal, int fSigned)
Definition: wlcBlast.c:65
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
int Wlc_BlastLess(Gia_Man_t *pNew, int *pArg0, int *pArg1, int nBits)
Definition: wlcBlast.c:193
#define ABC_SWAP(Type, a, b)
Definition: abc_global.h:218
static word * Wlc_ObjTable(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:183
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable)
ITERATORS ///.
Definition: timBox.c:44
unsigned Beg
Definition: wlc.h:109
static int Wlc_ObjFaninId0(Wlc_Obj_t *p)
Definition: wlc.h:167
#define Wlc_ObjForEachFaninReverse(pObj, iFanin, i)
Definition: wlc.h:223
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
void Wlc_BlastMultiplier(Gia_Man_t *pNew, int *pArg0, int *pArg1, int nBits, Vec_Int_t *vTemp, Vec_Int_t *vRes)
Definition: wlcBlast.c:243
void Wlc_BlastRotateRight(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, Vec_Int_t *vRes)
Definition: wlcBlast.c:143
static Gia_Obj_t * Gia_ManPi(Gia_Man_t *p, int v)
Definition: gia.h:405
#define Wlc_NtkForEachCi(p, pCi, i)
Definition: wlc.h:214
char * pName
Definition: gia.h:97
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Wlc_ObjFaninNum(Wlc_Obj_t *p)
Definition: wlc.h:163
Gia_Man_t * Gia_ManDupNormalize(Gia_Man_t *p)
Definition: giaTim.c:134
char * pName
Definition: wlc.h:117
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
int Tim_ManCiNum(Tim_Man_t *p)
Definition: timMan.c:680
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
unsigned Type
Definition: wlc.h:102
static int Wlc_ObjIsCi(Wlc_Obj_t *p)
Definition: wlc.h:158
void Wlc_BlastSubtract(Gia_Man_t *pNew, int *pAdd0, int *pAdd1, int nBits)
Definition: wlcBlast.c:223
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
int Wlc_NtkMuxTree_rec(Gia_Man_t *pNew, int *pCtrl, int nCtrl, Vec_Int_t *vData, int Shift)
Definition: wlcBlast.c:84
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
static void Vec_IntAppend(Vec_Int_t *vVec1, Vec_Int_t *vVec2)
void * pManTime
Definition: gia.h:165
int nAnds[WLC_OBJ_NUMBER]
Definition: wlc.h:124
void Gia_ManTransferTiming(Gia_Man_t *p, Gia_Man_t *pGia)
Definition: giaIf.c:1912
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: wlc.h:206
void Wlc_BlastMinus(Gia_Man_t *pNew, int *pNum, int nNum, Vec_Int_t *vRes)
Definition: wlcBlast.c:233
static int Wlc_ObjRangeBeg(Wlc_Obj_t *p)
Definition: wlc.h:177
Definition: wlc.h:47
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
static int Wlc_ObjCopy(Wlc_Ntk_t *p, int iObj)
Definition: wlc.h:188
static int Abc_LitNot(int Lit)
Definition: abc_global.h:266
unsigned End
Definition: wlc.h:108
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
void Wlc_BlastShiftLeft(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, int fSticky, Vec_Int_t *vRes)
Definition: wlcBlast.c:124
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
Definition: bblif.c:435
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
Definition: gia.h:95
static Wlc_Obj_t * Wlc_ObjFanin1(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:172
#define assert(ex)
Definition: util_old.h:213
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
Definition: vecInt.h:417
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
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Wlc_ObjFaninId2(Wlc_Obj_t *p)
Definition: wlc.h:169
static int Wlc_ObjIsSignedFanin01(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:179
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
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:611
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
static int Gia_Obj2Lit(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:433
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
static Wlc_Obj_t* Wlc_NtkCi ( Wlc_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 152 of file wlc.h.

152 { return Wlc_NtkObj( p, Vec_IntEntry(&p->vCis, i) ); }
Vec_Int_t vCis
Definition: wlc.h:120
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Wlc_NtkCiNum ( Wlc_Ntk_t p)
inlinestatic

Definition at line 145 of file wlc.h.

145 { return Vec_IntSize(&p->vCis); }
Vec_Int_t vCis
Definition: wlc.h:120
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Wlc_NtkCleanCopy ( Wlc_Ntk_t p)
inlinestatic

Definition at line 185 of file wlc.h.

185 { Vec_IntFill( &p->vCopies, p->nObjsAlloc, 0 ); }
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
Vec_Int_t vCopies
Definition: wlc.h:138
int nObjsAlloc
Definition: wlc.h:128
static void Wlc_NtkCleanNameId ( Wlc_Ntk_t p)
inlinestatic

Definition at line 191 of file wlc.h.

191 { Vec_IntFill( &p->vNameIds, p->nObjsAlloc, 0 ); }
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
int nObjsAlloc
Definition: wlc.h:128
Vec_Int_t vNameIds
Definition: wlc.h:134
static Wlc_Obj_t* Wlc_NtkCo ( Wlc_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 153 of file wlc.h.

153 { return Wlc_NtkObj( p, Vec_IntEntry(&p->vCos, i) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vCos
Definition: wlc.h:121
Vec_Int_t* Wlc_NtkCollectMultipliers ( Wlc_Ntk_t p)

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

Synopsis [Collect IDs of the multipliers.]

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file wlcAbs.c.

77 {
78  Wlc_Obj_t * pObj; int i;
79  Vec_Int_t * vBoxIds = Vec_IntAlloc( 100 );
80  Wlc_NtkForEachObj( p, pObj, i )
81  if ( pObj->Type == WLC_OBJ_ARI_MULTI )
82  Vec_IntPush( vBoxIds, i );
83  if ( Vec_IntSize( vBoxIds ) > 0 )
84  return vBoxIds;
85  Vec_IntFree( vBoxIds );
86  return NULL;
87 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: wlc.h:206
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static int Wlc_NtkCoNum ( Wlc_Ntk_t p)
inlinestatic

Definition at line 146 of file wlc.h.

146 { return Vec_IntSize(&p->vCos); }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t vCos
Definition: wlc.h:121
Wlc_Ntk_t* Wlc_NtkDupDfs ( Wlc_Ntk_t p)

Definition at line 457 of file wlcNtk.c.

458 {
459  Wlc_Ntk_t * pNew;
460  Wlc_Obj_t * pObj;
461  Vec_Int_t * vFanins;
462  int i;
463  Wlc_NtkCleanCopy( p );
464  vFanins = Vec_IntAlloc( 100 );
465  pNew = Wlc_NtkAlloc( p->pName, p->nObjsAlloc );
466  Wlc_NtkForEachCi( p, pObj, i )
467  Wlc_ObjDup( pNew, p, Wlc_ObjId(p, pObj), vFanins );
468  Wlc_NtkForEachCo( p, pObj, i )
469  Wlc_NtkDupDfs_rec( pNew, p, Wlc_ObjId(p, pObj), vFanins );
470  Wlc_NtkForEachCo( p, pObj, i )
471  Wlc_ObjSetCo( pNew, Wlc_ObjCopyObj(pNew, p, pObj), pObj->fIsFi );
472  Vec_IntFree( vFanins );
473  return pNew;
474 }
#define Wlc_NtkForEachCo(p, pCo, i)
Definition: wlc.h:216
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int Wlc_ObjDup(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
Definition: wlcNtk.c:436
static void Wlc_NtkCleanCopy(Wlc_Ntk_t *p)
Definition: wlc.h:185
void Wlc_NtkDupDfs_rec(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
Definition: wlcNtk.c:446
#define Wlc_NtkForEachCi(p, pCi, i)
Definition: wlc.h:214
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
char * pName
Definition: wlc.h:117
static Wlc_Obj_t * Wlc_ObjCopyObj(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:189
int nObjsAlloc
Definition: wlc.h:128
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
Wlc_Ntk_t * Wlc_NtkAlloc(char *pName, int nObjsAlloc)
FUNCTION DEFINITIONS ///.
Definition: wlcNtk.c:94
void Wlc_ObjSetCo(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int fFlopInput)
Definition: wlcNtk.c:130
static Wlc_Obj_t* Wlc_NtkFf ( Wlc_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 154 of file wlc.h.

154 { return Wlc_NtkObj( p, Vec_IntEntry(&p->vFfs, i) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vFfs
Definition: wlc.h:122
static int Wlc_NtkFfNum ( Wlc_Ntk_t p)
inlinestatic

Definition at line 147 of file wlc.h.

147 { return Vec_IntSize(&p->vCis) - Vec_IntSize(&p->vPis); }
Vec_Int_t vCis
Definition: wlc.h:120
Vec_Int_t vPis
Definition: wlc.h:118
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t* Wlc_NtkFindUifableMultiplierPairs ( Wlc_Ntk_t p)

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

Synopsis [Returns all pairs of uifable multipliers.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file wlcAbs.c.

101 {
102  Vec_Int_t * vMultis = Wlc_NtkCollectMultipliers( p );
103  Vec_Int_t * vPairs = Vec_IntAlloc( 2 );
104  Wlc_Obj_t * pObj, * pObj2; int i, k;
105  // iterate through unique pairs
106  Wlc_NtkForEachObjVec( vMultis, p, pObj, i )
107  Wlc_NtkForEachObjVec( vMultis, p, pObj2, k )
108  {
109  if ( k == i )
110  break;
111  if ( Wlc_NtkPairIsUifable( p, pObj, pObj2 ) )
112  {
113  Vec_IntPush( vPairs, Wlc_ObjId(p, pObj) );
114  Vec_IntPush( vPairs, Wlc_ObjId(p, pObj2) );
115  }
116  }
117  Vec_IntFree( vMultis );
118  if ( Vec_IntSize( vPairs ) > 0 )
119  return vPairs;
120  Vec_IntFree( vPairs );
121  return NULL;
122 }
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
Definition: wlc.h:208
Vec_Int_t * Wlc_NtkCollectMultipliers(Wlc_Ntk_t *p)
Definition: wlcAbs.c:76
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
ABC_NAMESPACE_IMPL_START int Wlc_NtkPairIsUifable(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Wlc_Obj_t *pObj2)
DECLARATIONS ///.
Definition: wlcAbs.c:44
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Wlc_NtkFree ( Wlc_Ntk_t p)

Definition at line 195 of file wlcNtk.c.

196 {
197  if ( p->pManName )
198  Abc_NamStop( p->pManName );
199  if ( p->pMemFanin )
200  Mem_FlexStop( p->pMemFanin, 0 );
201  if ( p->pMemTable )
202  Mem_FlexStop( p->pMemTable, 0 );
203  Vec_PtrFreeP( &p->vTables );
204  ABC_FREE( p->vPis.pArray );
205  ABC_FREE( p->vPos.pArray );
206  ABC_FREE( p->vCis.pArray );
207  ABC_FREE( p->vCos.pArray );
208  ABC_FREE( p->vFfs.pArray );
209  ABC_FREE( p->vTravIds.pArray );
210  ABC_FREE( p->vNameIds.pArray );
211  ABC_FREE( p->vCopies.pArray );
212  ABC_FREE( p->pObjs );
213  ABC_FREE( p->pName );
214  ABC_FREE( p );
215 }
Mem_Flex_t * pMemFanin
Definition: wlc.h:129
Mem_Flex_t * pMemTable
Definition: wlc.h:130
void Abc_NamStop(Abc_Nam_t *p)
Definition: utilNam.c:110
Vec_Int_t vCis
Definition: wlc.h:120
Vec_Ptr_t * vTables
Definition: wlc.h:131
Wlc_Obj_t * pObjs
Definition: wlc.h:126
Vec_Int_t vPis
Definition: wlc.h:118
char * pName
Definition: wlc.h:117
Vec_Int_t vCopies
Definition: wlc.h:138
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
Definition: mem.c:343
Vec_Int_t vTravIds
Definition: wlc.h:137
Vec_Int_t vPos
Definition: wlc.h:119
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_PtrFreeP(Vec_Ptr_t **p)
Definition: vecPtr.h:240
Vec_Int_t vNameIds
Definition: wlc.h:134
Vec_Int_t vCos
Definition: wlc.h:121
Vec_Int_t vFfs
Definition: wlc.h:122
Abc_Nam_t * pManName
Definition: wlc.h:133
static int Wlc_NtkHasCopy ( Wlc_Ntk_t p)
inlinestatic

Definition at line 186 of file wlc.h.

186 { return Vec_IntSize( &p->vCopies ) > 0; }
Vec_Int_t vCopies
Definition: wlc.h:138
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Wlc_NtkHasNameId ( Wlc_Ntk_t p)
inlinestatic

Definition at line 192 of file wlc.h.

192 { return Vec_IntSize( &p->vNameIds ) > 0; }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t vNameIds
Definition: wlc.h:134
static Wlc_Obj_t* Wlc_NtkObj ( Wlc_Ntk_t p,
int  Id 
)
inlinestatic

Definition at line 149 of file wlc.h.

149 { assert(Id > 0 && Id < p->nObjsAlloc); return p->pObjs + Id; }
Wlc_Obj_t * pObjs
Definition: wlc.h:126
#define assert(ex)
Definition: util_old.h:213
static int Wlc_NtkObjNum ( Wlc_Ntk_t p)
inlinestatic

Definition at line 141 of file wlc.h.

141 { return p->iObj - 1; }
int iObj
Definition: wlc.h:127
static int Wlc_NtkObjNumMax ( Wlc_Ntk_t p)
inlinestatic

Definition at line 142 of file wlc.h.

142 { return p->iObj; }
int iObj
Definition: wlc.h:127
int Wlc_NtkPairIsUifable ( Wlc_Ntk_t p,
Wlc_Obj_t pObj,
Wlc_Obj_t pObj2 
)

FUNCTION DECLARATIONS ///.

FUNCTION DECLARATIONS ///.

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

FileName [wlcAbs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Verilog parser.]

Synopsis [Abstraction for word-level networks.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - August 22, 2014.]

Revision [

Id:
wlcAbs.c,v 1.00 2014/09/12 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Check if two objects have the same input/output signatures.]

Description []

SideEffects []

SeeAlso []

Definition at line 44 of file wlcAbs.c.

45 {
46  Wlc_Obj_t * pFanin, * pFanin2; int k;
47  if ( Wlc_ObjRange(pObj) != Wlc_ObjRange(pObj2) )
48  return 0;
49  if ( Wlc_ObjIsSigned(pObj) != Wlc_ObjIsSigned(pObj2) )
50  return 0;
51  if ( Wlc_ObjFaninNum(pObj) != Wlc_ObjFaninNum(pObj2) )
52  return 0;
53  for ( k = 0; k < Wlc_ObjFaninNum(pObj); k++ )
54  {
55  pFanin = Wlc_ObjFanin(p, pObj, k);
56  pFanin2 = Wlc_ObjFanin(p, pObj2, k);
57  if ( Wlc_ObjRange(pFanin) != Wlc_ObjRange(pFanin2) )
58  return 0;
59  if ( Wlc_ObjIsSigned(pFanin) != Wlc_ObjIsSigned(pFanin2) )
60  return 0;
61  }
62  return 1;
63 }
static int Wlc_ObjIsSigned(Wlc_Obj_t *p)
Definition: wlc.h:178
static Wlc_Obj_t * Wlc_ObjFanin(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, int i)
Definition: wlc.h:170
static int Wlc_ObjRange(Wlc_Obj_t *p)
Definition: wlc.h:175
static int Wlc_ObjFaninNum(Wlc_Obj_t *p)
Definition: wlc.h:163
static Wlc_Obj_t* Wlc_NtkPi ( Wlc_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 150 of file wlc.h.

150 { return Wlc_NtkObj( p, Vec_IntEntry(&p->vPis, i) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
Vec_Int_t vPis
Definition: wlc.h:118
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Wlc_NtkPiNum ( Wlc_Ntk_t p)
inlinestatic

Definition at line 143 of file wlc.h.

143 { return Vec_IntSize(&p->vPis); }
Vec_Int_t vPis
Definition: wlc.h:118
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Wlc_Obj_t* Wlc_NtkPo ( Wlc_Ntk_t p,
int  i 
)
inlinestatic

Definition at line 151 of file wlc.h.

151 { return Wlc_NtkObj( p, Vec_IntEntry(&p->vPos, i) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vPos
Definition: wlc.h:119
static int Wlc_NtkPoNum ( Wlc_Ntk_t p)
inlinestatic

Definition at line 144 of file wlc.h.

144 { return Vec_IntSize(&p->vPos); }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t vPos
Definition: wlc.h:119
void Wlc_NtkPrintNodes ( Wlc_Ntk_t p,
int  Type 
)

Definition at line 354 of file wlcNtk.c.

355 {
356  Wlc_Obj_t * pObj;
357  int i, Counter = 0;
358  printf( "Operation %s\n", Wlc_Names[Type] );
359  Wlc_NtkForEachObj( p, pObj, i )
360  {
361  if ( (int)pObj->Type != Type )
362  continue;
363  printf( "%8d :", Counter++ );
364  printf( "%8d : ", i );
365  printf( "%3d%s = ", Wlc_ObjRange(pObj), Wlc_ObjIsSigned(pObj) ? "s" : " " );
366  printf( "%3d%s %s ", Wlc_ObjRange(Wlc_ObjFanin0(p, pObj)), Wlc_ObjIsSigned(Wlc_ObjFanin0(p, pObj)) ? "s" : " ", Wlc_Names[Type] );
367  printf( "%3d%s ", Wlc_ObjRange(Wlc_ObjFanin1(p, pObj)), Wlc_ObjIsSigned(Wlc_ObjFanin1(p, pObj)) ? "s" : " " );
368  printf( " : " );
369  printf( "%-12s = ", Wlc_ObjName(p, i) );
370  printf( "%-12s %s ", Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)), Wlc_Names[Type] );
371  printf( "%-12s ", Wlc_ObjName(p, Wlc_ObjFaninId1(pObj)) );
372  printf( "\n" );
373  }
374 }
static ABC_NAMESPACE_IMPL_START char * Wlc_Names[WLC_OBJ_NUMBER+1]
DECLARATIONS ///.
Definition: wlcNtk.c:32
static int Wlc_ObjFaninId1(Wlc_Obj_t *p)
Definition: wlc.h:168
static int Wlc_ObjIsSigned(Wlc_Obj_t *p)
Definition: wlc.h:178
static Wlc_Obj_t * Wlc_ObjFanin0(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:171
static int Wlc_ObjRange(Wlc_Obj_t *p)
Definition: wlc.h:175
static int Wlc_ObjFaninId0(Wlc_Obj_t *p)
Definition: wlc.h:167
unsigned Type
Definition: wlc.h:102
static int Counter
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition: wlc.h:206
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
Definition: wlcNtk.c:167
static Wlc_Obj_t * Wlc_ObjFanin1(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:172
void Wlc_NtkPrintStats ( Wlc_Ntk_t p,
int  fDistrib,
int  fVerbose 
)

Definition at line 375 of file wlcNtk.c.

376 {
377  int i;
378  printf( "%-20s : ", p->pName );
379  printf( "PI = %4d ", Wlc_NtkPiNum(p) );
380  printf( "PO = %4d ", Wlc_NtkPoNum(p) );
381  printf( "FF = %4d ", Wlc_NtkFfNum(p) );
382  printf( "Obj = %6d ", Wlc_NtkObjNum(p) );
383  printf( "Mem = %.3f MB", 1.0*Wlc_NtkMemUsage(p)/(1<<20) );
384  printf( "\n" );
385  if ( fDistrib )
386  {
387  Wlc_NtkPrintDistrib( p, fVerbose );
388  return;
389  }
390  if ( !fVerbose )
391  return;
392  printf( "Node type statistics:\n" );
393  for ( i = 1; i < WLC_OBJ_NUMBER; i++ )
394  {
395  if ( !p->nObjs[i] )
396  continue;
397  if ( p->nAnds[0] && p->nAnds[i] )
398  printf( "%2d : %-8s %6d %7.2f %%\n", i, Wlc_Names[i], p->nObjs[i], 100.0*p->nAnds[i]/p->nAnds[0] );
399  else
400  printf( "%2d : %-8s %6d\n", i, Wlc_Names[i], p->nObjs[i] );
401  }
402 }
static ABC_NAMESPACE_IMPL_START char * Wlc_Names[WLC_OBJ_NUMBER+1]
DECLARATIONS ///.
Definition: wlcNtk.c:32
static int Wlc_NtkObjNum(Wlc_Ntk_t *p)
Definition: wlc.h:141
int nObjs[WLC_OBJ_NUMBER]
Definition: wlc.h:123
static int Wlc_NtkFfNum(Wlc_Ntk_t *p)
Definition: wlc.h:147
static int Wlc_NtkPoNum(Wlc_Ntk_t *p)
Definition: wlc.h:144
int Wlc_NtkMemUsage(Wlc_Ntk_t *p)
Definition: wlcNtk.c:216
char * pName
Definition: wlc.h:117
int nAnds[WLC_OBJ_NUMBER]
Definition: wlc.h:124
void Wlc_NtkPrintDistrib(Wlc_Ntk_t *p, int fVerbose)
Definition: wlcNtk.c:284
static int Wlc_NtkPiNum(Wlc_Ntk_t *p)
Definition: wlc.h:143
void Wlc_NtkTransferNames ( Wlc_Ntk_t pNew,
Wlc_Ntk_t p 
)

Definition at line 475 of file wlcNtk.c.

476 {
477  int i;
478  assert( !Wlc_NtkHasCopy(pNew) && Wlc_NtkHasCopy(p) );
479  assert( !Wlc_NtkHasNameId(pNew) && Wlc_NtkHasNameId(p) );
480  assert( pNew->pManName == NULL && p->pManName != NULL );
481  Wlc_NtkCleanNameId( pNew );
482  for ( i = 0; i < p->nObjsAlloc; i++ )
483  if ( Wlc_ObjCopy(p, i) && i < Vec_IntSize(&p->vNameIds) && Wlc_ObjNameId(p, i) )
484  Wlc_ObjSetNameId( pNew, Wlc_ObjCopy(p, i), Wlc_ObjNameId(p, i) );
485  pNew->pManName = p->pManName;
486  p->pManName = NULL;
487  Vec_IntErase( &p->vNameIds );
488  // transfer table
489  pNew->pMemTable = p->pMemTable; p->pMemTable = NULL;
490  pNew->vTables = p->vTables; p->vTables = NULL;
491 }
Mem_Flex_t * pMemTable
Definition: wlc.h:130
Vec_Ptr_t * vTables
Definition: wlc.h:131
static void Vec_IntErase(Vec_Int_t *p)
Definition: vecInt.h:266
static void Wlc_NtkCleanNameId(Wlc_Ntk_t *p)
Definition: wlc.h:191
static int Wlc_NtkHasNameId(Wlc_Ntk_t *p)
Definition: wlc.h:192
static int Wlc_ObjNameId(Wlc_Ntk_t *p, int iObj)
Definition: wlc.h:194
static void Wlc_ObjSetNameId(Wlc_Ntk_t *p, int iObj, int i)
Definition: wlc.h:193
int nObjsAlloc
Definition: wlc.h:128
static int Wlc_ObjCopy(Wlc_Ntk_t *p, int iObj)
Definition: wlc.h:188
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t vNameIds
Definition: wlc.h:134
#define assert(ex)
Definition: util_old.h:213
static int Wlc_NtkHasCopy(Wlc_Ntk_t *p)
Definition: wlc.h:186
Abc_Nam_t * pManName
Definition: wlc.h:133
Wlc_Ntk_t* Wlc_NtkUifNodePairs ( Wlc_Ntk_t p,
Vec_Int_t vPairsInit 
)

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

Synopsis [Adds UIF constraints to node pairs and updates POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 192 of file wlcAbs.c.

193 {
194  Vec_Int_t * vPairs = vPairsInit;
195  Wlc_Ntk_t * pNew;
196  Wlc_Obj_t * pObj, * pObj2;
197  Vec_Int_t * vUifConstrs, * vCompares, * vFanins;
198  int i, k, iObj, iObj2, iObjNew, iObjNew2;
199  int iFanin, iFanin2, iFaninNew;
200  // get multiplier pairs if not given
201  if ( vPairs == NULL )
202  vPairs = Wlc_NtkFindUifableMultiplierPairs( p );
203  if ( vPairs == NULL )
204  return NULL;
205  // sanity checks
206  assert( Vec_IntSize(vPairs) > 0 && Vec_IntSize(vPairs) % 2 == 0 );
207  // iterate through node pairs
208  vFanins = Vec_IntAlloc( 100 );
209  vCompares = Vec_IntAlloc( 100 );
210  vUifConstrs = Vec_IntAlloc( 100 );
211  Vec_IntForEachEntryDouble( vPairs, iObj, iObj2, i )
212  {
213  // get two nodes
214  pObj = Wlc_NtkObj( p, iObj );
215  pObj2 = Wlc_NtkObj( p, iObj2 );
216  assert( Wlc_NtkPairIsUifable(p, pObj, pObj2) );
217  // create fanin comparator nodes
218  Vec_IntClear( vCompares );
219  Wlc_ObjForEachFanin( pObj, iFanin, k )
220  {
221  iFanin2 = Wlc_ObjFaninId( pObj2, k );
222  Vec_IntFillTwo( vFanins, 2, iFanin, iFanin2 );
223  iFaninNew = Wlc_ObjCreate( p, WLC_OBJ_COMP_NOTEQU, 0, 0, 0, vFanins );
224  Vec_IntPush( vCompares, iFaninNew );
225  // note that a pointer to Wlc_Obj_t (for example, pObj) can be invalidated after a call to
226  // Wlc_ObjCreate() due to a possible realloc of the internal array of objects...
227  pObj = Wlc_NtkObj( p, iObj );
228  }
229  // concatenate fanin comparators
230  iObjNew = Wlc_ObjCreate( p, WLC_OBJ_BIT_CONCAT, 0, Vec_IntSize(vCompares) - 1, 0, vCompares );
231  // create reduction-OR node
232  Vec_IntFill( vFanins, 1, iObjNew );
233  iObjNew = Wlc_ObjCreate( p, WLC_OBJ_REDUCT_OR, 0, 0, 0, vFanins );
234  // craete output comparator node
235  Vec_IntFillTwo( vFanins, 2, iObj, iObj2 );
236  iObjNew2 = Wlc_ObjCreate( p, WLC_OBJ_COMP_EQU, 0, 0, 0, vFanins );
237  // create implication node (iObjNew is already complemented above)
238  Vec_IntFillTwo( vFanins, 2, iObjNew, iObjNew2 );
239  iObjNew = Wlc_ObjCreate( p, WLC_OBJ_LOGIC_OR, 0, 0, 0, vFanins );
240  // save the constraint
241  Vec_IntPush( vUifConstrs, iObjNew );
242  }
243  // derive the AND of the UIF contraints
244  assert( Vec_IntSize(vUifConstrs) > 0 );
245  if ( Vec_IntSize(vUifConstrs) == 1 )
246  iObjNew = Vec_IntEntry( vUifConstrs, 0 );
247  else
248  {
249  // concatenate
250  iObjNew = Wlc_ObjCreate( p, WLC_OBJ_BIT_CONCAT, 0, Vec_IntSize(vUifConstrs) - 1, 0, vUifConstrs );
251  // create reduction-AND node
252  Vec_IntFill( vFanins, 1, iObjNew );
253  iObjNew = Wlc_ObjCreate( p, WLC_OBJ_REDUCT_AND, 0, 0, 0, vFanins );
254  }
255  // update each PO to point to the new node
256  Wlc_NtkForEachPo( p, pObj, i )
257  {
258  iObj = Wlc_ObjId(p, pObj);
259  Vec_IntFillTwo( vFanins, 2, iObj, iObjNew );
260  iObjNew = Wlc_ObjCreate( p, WLC_OBJ_LOGIC_AND, 0, 0, 0, vFanins );
261  // note that a pointer to Wlc_Obj_t (for example, pObj) can be invalidated after a call to
262  // Wlc_ObjCreate() due to a possible realloc of the internal array of objects...
263  pObj = Wlc_NtkObj( p, iObj );
264  // update PO/CO arrays
265  assert( Vec_IntEntry(&p->vPos, i) == iObj );
266  assert( Vec_IntEntry(&p->vCos, i) == iObj );
267  Vec_IntWriteEntry( &p->vPos, i, iObjNew );
268  Vec_IntWriteEntry( &p->vCos, i, iObjNew );
269  // transfer the PO attribute
270  Wlc_NtkObj(p, iObjNew)->fIsPo = 1;
271  assert( pObj->fIsPo );
272  pObj->fIsPo = 0;
273  }
274  // cleanup
275  Vec_IntFree( vUifConstrs );
276  Vec_IntFree( vCompares );
277  Vec_IntFree( vFanins );
278  if ( vPairs != vPairsInit )
279  Vec_IntFree( vPairs );
280  // reconstruct topological order
281  pNew = Wlc_NtkDupDfs( p );
282  Wlc_NtkTransferNames( pNew, p );
283  return pNew;
284 }
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
Definition: wlc.h:221
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
void Wlc_NtkTransferNames(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p)
Definition: wlcNtk.c:475
#define Wlc_NtkForEachPo(p, pPo, i)
Definition: wlc.h:212
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
int Wlc_ObjCreate(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg, Vec_Int_t *vFanins)
Definition: wlcNtk.c:161
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
ABC_NAMESPACE_IMPL_START int Wlc_NtkPairIsUifable(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Wlc_Obj_t *pObj2)
DECLARATIONS ///.
Definition: wlcAbs.c:44
unsigned fIsPo
Definition: wlc.h:105
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Definition: vecInt.h:66
Wlc_Ntk_t * Wlc_NtkDupDfs(Wlc_Ntk_t *p)
Definition: wlcNtk.c:457
static int Wlc_ObjFaninId(Wlc_Obj_t *p, int i)
Definition: wlc.h:166
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t vPos
Definition: wlc.h:119
Vec_Int_t vCos
Definition: wlc.h:121
#define assert(ex)
Definition: util_old.h:213
Vec_Int_t * Wlc_NtkFindUifableMultiplierPairs(Wlc_Ntk_t *p)
Definition: wlcAbs.c:100
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static void Vec_IntFillTwo(Vec_Int_t *p, int nSize, int FillEven, int FillOdd)
Definition: vecInt.h:556
void Wlc_ObjAddFanins ( Wlc_Ntk_t p,
Wlc_Obj_t pObj,
Vec_Int_t vFanins 
)

Definition at line 182 of file wlcNtk.c.

183 {
184  assert( pObj->nFanins == 0 );
185  pObj->nFanins = Vec_IntSize(vFanins);
186  if ( Wlc_ObjHasArray(pObj) )
187  pObj->pFanins[0] = (int *)Mem_FlexEntryFetch( p->pMemFanin, Vec_IntSize(vFanins) * sizeof(int) );
188  memcpy( Wlc_ObjFanins(pObj), Vec_IntArray(vFanins), sizeof(int) * Vec_IntSize(vFanins) );
189  // special treatment of CONST, SELECT and TABLE
190  if ( pObj->Type == WLC_OBJ_CONST )
191  pObj->nFanins = 0;
192  else if ( pObj->Type == WLC_OBJ_BIT_SELECT || pObj->Type == WLC_OBJ_TABLE )
193  pObj->nFanins = 1;
194 }
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
Mem_Flex_t * pMemFanin
Definition: wlc.h:129
unsigned nFanins
Definition: wlc.h:107
char * memcpy()
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
Definition: mem.c:372
static int Wlc_ObjHasArray(Wlc_Obj_t *p)
Definition: wlc.h:164
unsigned Type
Definition: wlc.h:102
int * pFanins[1]
Definition: wlc.h:111
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
#define assert(ex)
Definition: util_old.h:213
int Wlc_ObjAlloc ( Wlc_Ntk_t p,
int  Type,
int  Signed,
int  End,
int  Beg 
)

Definition at line 141 of file wlcNtk.c.

142 {
143  Wlc_Obj_t * pObj;
144  assert( Type != WLC_OBJ_PO && Type != WLC_OBJ_FI );
145  if ( p->iObj == p->nObjsAlloc )
146  {
147  p->pObjs = ABC_REALLOC( Wlc_Obj_t, p->pObjs, 2 * p->nObjsAlloc );
148  memset( p->pObjs + p->nObjsAlloc, 0, sizeof(Wlc_Obj_t) * p->nObjsAlloc );
149  p->nObjsAlloc *= 2;
150  }
151  pObj = Wlc_NtkObj( p, p->iObj );
152  pObj->Type = Type;
153  pObj->Signed = Signed;
154  pObj->End = End;
155  pObj->Beg = Beg;
156  if ( Wlc_ObjIsCi(pObj) )
157  Wlc_ObjSetCi( p, pObj );
158  p->nObjs[Type]++;
159  return p->iObj++;
160 }
char * memset()
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
Wlc_Obj_t * pObjs
Definition: wlc.h:126
int nObjs[WLC_OBJ_NUMBER]
Definition: wlc.h:123
int iObj
Definition: wlc.h:127
Definition: wlc.h:48
unsigned Beg
Definition: wlc.h:109
unsigned Type
Definition: wlc.h:102
static int Wlc_ObjIsCi(Wlc_Obj_t *p)
Definition: wlc.h:158
unsigned Signed
Definition: wlc.h:103
int nObjsAlloc
Definition: wlc.h:128
unsigned End
Definition: wlc.h:108
void Wlc_ObjSetCi(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlcNtk.c:110
Definition: wlc.h:46
#define assert(ex)
Definition: util_old.h:213
static int Wlc_ObjCiId ( Wlc_Obj_t p)
inlinestatic

Definition at line 162 of file wlc.h.

162 { assert( Wlc_ObjIsCi(p) ); return p->Fanins[1]; }
static int Wlc_ObjIsCi(Wlc_Obj_t *p)
Definition: wlc.h:158
int Fanins[2]
Definition: wlc.h:110
#define assert(ex)
Definition: util_old.h:213
static int* Wlc_ObjConstValue ( Wlc_Obj_t p)
inlinestatic

Definition at line 181 of file wlc.h.

181 { assert(p->Type == WLC_OBJ_CONST); return Wlc_ObjFanins(p); }
unsigned Type
Definition: wlc.h:102
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
#define assert(ex)
Definition: util_old.h:213
static int Wlc_ObjCopy ( Wlc_Ntk_t p,
int  iObj 
)
inlinestatic

Definition at line 188 of file wlc.h.

188 { return Vec_IntEntry( &p->vCopies, iObj ); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vCopies
Definition: wlc.h:138
static Wlc_Obj_t* Wlc_ObjCopyObj ( Wlc_Ntk_t pNew,
Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 189 of file wlc.h.

189 {return Wlc_NtkObj(pNew, Wlc_ObjCopy(p, Wlc_ObjId(p, pObj))); }
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Wlc_ObjCopy(Wlc_Ntk_t *p, int iObj)
Definition: wlc.h:188
int Wlc_ObjCreate ( Wlc_Ntk_t p,
int  Type,
int  Signed,
int  End,
int  Beg,
Vec_Int_t vFanins 
)

Definition at line 161 of file wlcNtk.c.

162 {
163  int iFaninNew = Wlc_ObjAlloc( p, Type, Signed, End, Beg );
164  Wlc_ObjAddFanins( p, Wlc_NtkObj(p, iFaninNew), vFanins );
165  return iFaninNew;
166 }
void Wlc_ObjAddFanins(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vFanins)
Definition: wlcNtk.c:182
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
int Wlc_ObjAlloc(Wlc_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition: wlcNtk.c:141
static Wlc_Obj_t* Wlc_ObjFanin ( Wlc_Ntk_t p,
Wlc_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 170 of file wlc.h.

170 { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, i) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Wlc_ObjFaninId(Wlc_Obj_t *p, int i)
Definition: wlc.h:166
static Wlc_Obj_t* Wlc_ObjFanin0 ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 171 of file wlc.h.

171 { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, 0) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Wlc_ObjFaninId(Wlc_Obj_t *p, int i)
Definition: wlc.h:166
static Wlc_Obj_t* Wlc_ObjFanin1 ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 172 of file wlc.h.

172 { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, 1) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Wlc_ObjFaninId(Wlc_Obj_t *p, int i)
Definition: wlc.h:166
static Wlc_Obj_t* Wlc_ObjFanin2 ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 173 of file wlc.h.

173 { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, 2) ); }
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
Definition: wlc.h:149
static int Wlc_ObjFaninId(Wlc_Obj_t *p, int i)
Definition: wlc.h:166
static int Wlc_ObjFaninId ( Wlc_Obj_t p,
int  i 
)
inlinestatic

Definition at line 166 of file wlc.h.

166 { return Wlc_ObjFanins(p)[i]; }
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
static int Wlc_ObjFaninId0 ( Wlc_Obj_t p)
inlinestatic

Definition at line 167 of file wlc.h.

167 { return Wlc_ObjFanins(p)[0]; }
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
static int Wlc_ObjFaninId1 ( Wlc_Obj_t p)
inlinestatic

Definition at line 168 of file wlc.h.

168 { return Wlc_ObjFanins(p)[1]; }
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
static int Wlc_ObjFaninId2 ( Wlc_Obj_t p)
inlinestatic

Definition at line 169 of file wlc.h.

169 { return Wlc_ObjFanins(p)[2]; }
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
Definition: wlc.h:165
static int Wlc_ObjFaninNum ( Wlc_Obj_t p)
inlinestatic

Definition at line 163 of file wlc.h.

163 { return p->nFanins; }
unsigned nFanins
Definition: wlc.h:107
static int* Wlc_ObjFanins ( Wlc_Obj_t p)
inlinestatic

Definition at line 165 of file wlc.h.

165 { return Wlc_ObjHasArray(p) ? p->pFanins[0] : p->Fanins; }
static int Wlc_ObjHasArray(Wlc_Obj_t *p)
Definition: wlc.h:164
int * pFanins[1]
Definition: wlc.h:111
int Fanins[2]
Definition: wlc.h:110
static Wlc_Obj_t* Wlc_ObjFoToFi ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 196 of file wlc.h.

196 { assert( pObj->Type == WLC_OBJ_FO ); return Wlc_NtkCo(p, Wlc_NtkCoNum(p) - Wlc_NtkCiNum(p) + Wlc_ObjCiId(pObj)); }
static int Wlc_NtkCoNum(Wlc_Ntk_t *p)
Definition: wlc.h:146
static int Wlc_ObjCiId(Wlc_Obj_t *p)
Definition: wlc.h:162
static Wlc_Obj_t * Wlc_NtkCo(Wlc_Ntk_t *p, int i)
Definition: wlc.h:153
static int Wlc_NtkCiNum(Wlc_Ntk_t *p)
Definition: wlc.h:145
unsigned Type
Definition: wlc.h:102
Definition: wlc.h:47
#define assert(ex)
Definition: util_old.h:213
static int Wlc_ObjHasArray ( Wlc_Obj_t p)
inlinestatic

Definition at line 164 of file wlc.h.

164 { return p->nFanins > 2 || p->Type == WLC_OBJ_CONST; }
unsigned nFanins
Definition: wlc.h:107
unsigned Type
Definition: wlc.h:102
static int Wlc_ObjId ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 161 of file wlc.h.

161 { return pObj - p->pObjs; }
Wlc_Obj_t * pObjs
Definition: wlc.h:126
static int Wlc_ObjIsCi ( Wlc_Obj_t p)
inlinestatic

Definition at line 158 of file wlc.h.

158 { return p->Type == WLC_OBJ_PI || p->Type == WLC_OBJ_FO; }
unsigned Type
Definition: wlc.h:102
Definition: wlc.h:47
Definition: wlc.h:45
static int Wlc_ObjIsCo ( Wlc_Obj_t p)
inlinestatic

Definition at line 159 of file wlc.h.

159 { return p->fIsPo || p->fIsFi; }
unsigned fIsPo
Definition: wlc.h:105
unsigned fIsFi
Definition: wlc.h:106
static int Wlc_ObjIsPi ( Wlc_Obj_t p)
inlinestatic

Definition at line 156 of file wlc.h.

156 { return p->Type == WLC_OBJ_PI; }
unsigned Type
Definition: wlc.h:102
Definition: wlc.h:45
static int Wlc_ObjIsPo ( Wlc_Obj_t p)
inlinestatic

Definition at line 157 of file wlc.h.

157 { return p->fIsPo; }
unsigned fIsPo
Definition: wlc.h:105
static int Wlc_ObjIsSigned ( Wlc_Obj_t p)
inlinestatic

Definition at line 178 of file wlc.h.

178 { return p->Signed; }
unsigned Signed
Definition: wlc.h:103
static int Wlc_ObjIsSignedFanin01 ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 179 of file wlc.h.

179 { return Wlc_ObjFanin0(p, pObj)->Signed && Wlc_ObjFanin1(p, pObj)->Signed; }
static Wlc_Obj_t * Wlc_ObjFanin0(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:171
unsigned Signed
Definition: wlc.h:103
static Wlc_Obj_t * Wlc_ObjFanin1(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:172
char* Wlc_ObjName ( Wlc_Ntk_t p,
int  iObj 
)

Definition at line 167 of file wlcNtk.c.

168 {
169  static char Buffer[100];
170  if ( Wlc_NtkHasNameId(p) && Wlc_ObjNameId(p, iObj) )
171  return Abc_NamStr( p->pManName, Wlc_ObjNameId(p, iObj) );
172  sprintf( Buffer, "n%d", iObj );
173  return Buffer;
174 }
static int Wlc_NtkHasNameId(Wlc_Ntk_t *p)
Definition: wlc.h:192
static int Wlc_ObjNameId(Wlc_Ntk_t *p, int iObj)
Definition: wlc.h:194
char * sprintf()
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition: utilNam.c:479
Abc_Nam_t * pManName
Definition: wlc.h:133
static int Wlc_ObjNameId ( Wlc_Ntk_t p,
int  iObj 
)
inlinestatic

Definition at line 194 of file wlc.h.

194 { return Vec_IntEntry( &p->vNameIds, iObj ); }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t vNameIds
Definition: wlc.h:134
static int Wlc_ObjRange ( Wlc_Obj_t p)
inlinestatic

Definition at line 175 of file wlc.h.

175 { return p->End - p->Beg + 1; }
unsigned Beg
Definition: wlc.h:109
unsigned End
Definition: wlc.h:108
static int Wlc_ObjRangeBeg ( Wlc_Obj_t p)
inlinestatic

Definition at line 177 of file wlc.h.

177 { assert(p->Type == WLC_OBJ_BIT_SELECT); return p->Fanins[1] & 0xFFFF; }
unsigned Type
Definition: wlc.h:102
int Fanins[2]
Definition: wlc.h:110
#define assert(ex)
Definition: util_old.h:213
static int Wlc_ObjRangeEnd ( Wlc_Obj_t p)
inlinestatic

Definition at line 176 of file wlc.h.

176 { assert(p->Type == WLC_OBJ_BIT_SELECT); return p->Fanins[1] >> 16; }
unsigned Type
Definition: wlc.h:102
int Fanins[2]
Definition: wlc.h:110
#define assert(ex)
Definition: util_old.h:213
void Wlc_ObjSetCi ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)

Definition at line 110 of file wlcNtk.c.

111 {
112  assert( Wlc_ObjIsCi(pObj) );
113  assert( Wlc_ObjFaninNum(pObj) == 0 );
114  if ( Wlc_NtkPiNum(p) == Wlc_NtkCiNum(p) || pObj->Type != WLC_OBJ_PI )
115  {
116  pObj->Fanins[1] = Vec_IntSize(&p->vCis);
117  Vec_IntPush( &p->vCis, Wlc_ObjId(p, pObj) );
118  }
119  else // insert in the array of CI at the end of PIs
120  {
121  Wlc_Obj_t * pTemp; int i;
122  Vec_IntInsert( &p->vCis, Wlc_NtkPiNum(p), Wlc_ObjId(p, pObj) );
123  // other CI IDs are invalidated... naive fix!
124  Wlc_NtkForEachCi( p, pTemp, i )
125  pTemp->Fanins[1] = i;
126  }
127  if ( pObj->Type == WLC_OBJ_PI )
128  Vec_IntPush( &p->vPis, Wlc_ObjId(p, pObj) );
129 }
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
Vec_Int_t vCis
Definition: wlc.h:120
static void Vec_IntInsert(Vec_Int_t *p, int iHere, int Entry)
Definition: vecInt.h:975
static int Wlc_NtkCiNum(Wlc_Ntk_t *p)
Definition: wlc.h:145
#define Wlc_NtkForEachCi(p, pCi, i)
Definition: wlc.h:214
static int Wlc_ObjFaninNum(Wlc_Obj_t *p)
Definition: wlc.h:163
unsigned Type
Definition: wlc.h:102
if(last==0)
Definition: sparse_int.h:34
static int Wlc_ObjIsCi(Wlc_Obj_t *p)
Definition: wlc.h:158
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Definition: wlc.h:45
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Wlc_NtkPiNum(Wlc_Ntk_t *p)
Definition: wlc.h:143
int Fanins[2]
Definition: wlc.h:110
#define assert(ex)
Definition: util_old.h:213
void Wlc_ObjSetCo ( Wlc_Ntk_t p,
Wlc_Obj_t pObj,
int  fFlopInput 
)

Definition at line 130 of file wlcNtk.c.

131 {
132 // pObj->Fanins[1] = Vec_IntSize(&p->vCos);
133  Vec_IntPush( &p->vCos, Wlc_ObjId(p, pObj) );
134  if ( !fFlopInput )
135  Vec_IntPush( &p->vPos, Wlc_ObjId(p, pObj) );
136  if ( fFlopInput )
137  pObj->fIsFi = 1;
138  else
139  pObj->fIsPo = 1;
140 }
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition: wlc.h:161
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
unsigned fIsPo
Definition: wlc.h:105
Vec_Int_t vPos
Definition: wlc.h:119
Vec_Int_t vCos
Definition: wlc.h:121
unsigned fIsFi
Definition: wlc.h:106
static void Wlc_ObjSetCopy ( Wlc_Ntk_t p,
int  iObj,
int  i 
)
inlinestatic

Definition at line 187 of file wlc.h.

187 { Vec_IntWriteEntry( &p->vCopies, iObj, i ); }
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
Vec_Int_t vCopies
Definition: wlc.h:138
static void Wlc_ObjSetNameId ( Wlc_Ntk_t p,
int  iObj,
int  i 
)
inlinestatic

Definition at line 193 of file wlc.h.

193 { Vec_IntWriteEntry( &p->vNameIds, iObj, i ); }
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
Vec_Int_t vNameIds
Definition: wlc.h:134
static int Wlc_ObjSign ( Wlc_Obj_t p)
inlinestatic

Definition at line 180 of file wlc.h.

180 { return Abc_Var2Lit( Wlc_ObjRange(p), Wlc_ObjIsSigned(p) ); }
static int Wlc_ObjIsSigned(Wlc_Obj_t *p)
Definition: wlc.h:178
static int Abc_Var2Lit(int Var, int fCompl)
Definition: abc_global.h:263
static int Wlc_ObjRange(Wlc_Obj_t *p)
Definition: wlc.h:175
static word* Wlc_ObjTable ( Wlc_Ntk_t p,
Wlc_Obj_t pObj 
)
inlinestatic

Definition at line 183 of file wlc.h.

183 { return (word *)Vec_PtrEntry( p->vTables, Wlc_ObjTableId(pObj) ); }
Vec_Ptr_t * vTables
Definition: wlc.h:131
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static int Wlc_ObjTableId(Wlc_Obj_t *p)
Definition: wlc.h:182
static int Wlc_ObjTableId ( Wlc_Obj_t p)
inlinestatic

Definition at line 182 of file wlc.h.

182 { assert(p->Type == WLC_OBJ_TABLE); return p->Fanins[1]; }
unsigned Type
Definition: wlc.h:102
int Fanins[2]
Definition: wlc.h:110
#define assert(ex)
Definition: util_old.h:213
void Wlc_ObjUpdateType ( Wlc_Ntk_t p,
Wlc_Obj_t pObj,
int  Type 
)

Definition at line 175 of file wlcNtk.c.

176 {
177  assert( pObj->Type == WLC_OBJ_NONE );
178  p->nObjs[pObj->Type]--;
179  pObj->Type = Type;
180  p->nObjs[pObj->Type]++;
181 }
int nObjs[WLC_OBJ_NUMBER]
Definition: wlc.h:123
unsigned Type
Definition: wlc.h:102
#define assert(ex)
Definition: util_old.h:213
Wlc_Ntk_t* Wlc_ReadVer ( char *  pFileName)

Definition at line 1080 of file wlcReadVer.c.

1081 {
1082  Wlc_Prs_t * p;
1083  Wlc_Ntk_t * pNtk = NULL;
1084  // start the parser
1085  p = Wlc_PrsStart( pFileName );
1086  if ( p == NULL )
1087  return NULL;
1088  // detect lines
1089  if ( !Wlc_PrsPrepare( p ) )
1090  goto finish;
1091  // parse models
1092  if ( !Wlc_PrsDerive( p ) )
1093  goto finish;
1094  // derive topological order
1095  pNtk = Wlc_NtkDupDfs( p->pNtk );
1096  Wlc_NtkTransferNames( pNtk, p->pNtk );
1097 finish:
1099  Wlc_PrsStop( p );
1100  return pNtk;
1101 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Wlc_PrsStop(Wlc_Prs_t *p)
Definition: wlcReadVer.c:91
Wlc_Ntk_t * pNtk
Definition: wlcReadVer.c:42
void Wlc_NtkTransferNames(Wlc_Ntk_t *pNew, Wlc_Ntk_t *p)
Definition: wlcNtk.c:475
int Wlc_PrsPrepare(Wlc_Prs_t *p)
Definition: wlcReadVer.c:282
int Wlc_PrsDerive(Wlc_Prs_t *p)
Definition: wlcReadVer.c:789
void Wlc_PrsPrintErrorMessage(Wlc_Prs_t *p)
Definition: wlcReadVer.c:140
Wlc_Prs_t * Wlc_PrsStart(char *pFileName)
FUNCTION DEFINITIONS ///.
Definition: wlcReadVer.c:75
Wlc_Ntk_t * Wlc_NtkDupDfs(Wlc_Ntk_t *p)
Definition: wlcNtk.c:457
void Wlc_WriteVer ( Wlc_Ntk_t p,
char *  pFileName 
)

Definition at line 354 of file wlcWriteVer.c.

355 {
356  FILE * pFile;
357  pFile = fopen( pFileName, "w" );
358  if ( pFile == NULL )
359  {
360  fprintf( stdout, "Wlc_WriteVer(): Cannot open the output file \"%s\".\n", pFileName );
361  return;
362  }
363  fprintf( pFile, "// Benchmark \"%s\" written by ABC on %s\n", p->pName, Extra_TimeStamp() );
364  fprintf( pFile, "\n" );
365  Wlc_WriteTables( pFile, p );
366 // Wlc_WriteAddPos( p );
367  Wlc_WriteVerInt( pFile, p );
368  fprintf( pFile, "\n" );
369  fclose( pFile );
370 }
void Wlc_WriteVerInt(FILE *pFile, Wlc_Ntk_t *p)
Definition: wlcWriteVer.c:147
char * pName
Definition: wlc.h:117
void Wlc_WriteTables(FILE *pFile, Wlc_Ntk_t *p)
Definition: wlcWriteVer.c:64
char * Extra_TimeStamp()