ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
wln.h File Reference
Include dependency graph for wln.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Wln_Vec_t_
 
struct  Wln_Ntk_t_
 

Macros

#define Wln_NtkForEachObj(p, i)
 MACRO DEFINITIONS ///.
 
#define Wln_NtkForEachObjReverse(p, i)
 
#define Wln_NtkForEachObjInternal(p, i)
 
#define Wln_NtkForEachPi(p, iPi, i)
 
#define Wln_NtkForEachPo(p, iPo, i)
 
#define Wln_NtkForEachCi(p, iCi, i)
 
#define Wln_NtkForEachCo(p, iCo, i)
 
#define Wln_NtkForEachFf(p, iFf, i)
 
#define Wln_ObjForEachFanin(p, iObj, iFanin, i)
 
#define Wln_ObjForEachFaninReverse(pObj, iFanin, i)
 
#define Wln_ObjForEachFanoutStatic(p, iObj, iFanout, i)
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Wln_Vec_t_ Wln_Vec_t
 INCLUDES ///.
 
typedef struct Wln_Ntk_t_ Wln_Ntk_t
 
typedef struct Rtl_Lib_t_ Rtl_Lib_t
 

Functions

Wln_Ntk_tWln_ReadNdr (char *pFileName)
 FUNCTION DECLARATIONS ///.
 
void Wln_WriteNdr (Wln_Ntk_t *pNtk, char *pFileName)
 
Wln_Ntk_tWln_NtkFromNdr (void *pData, int fDump)
 
void * Wln_NtkToNdr (Wln_Ntk_t *pNtk)
 DECLARATIONS ///.
 
Wln_Ntk_tWln_NtkAlloc (char *pName, int nObjsMax)
 DECLARATIONS ///.
 
void Wln_NtkFree (Wln_Ntk_t *p)
 
int Wln_NtkMemUsage (Wln_Ntk_t *p)
 
void Wln_NtkPrint (Wln_Ntk_t *p)
 
Wln_Ntk_tWln_NtkDupDfs (Wln_Ntk_t *p)
 
int Wln_NtkIsAcyclic (Wln_Ntk_t *p)
 
void Wln_NtkCreateRefs (Wln_Ntk_t *p)
 
void Wln_NtkStartFaninMap (Wln_Ntk_t *p, Vec_Int_t *vFaninMap, int nMulti)
 
void Wln_NtkStartFanoutMap (Wln_Ntk_t *p, Vec_Int_t *vFanoutMap, Vec_Int_t *vFanoutNums, int nMulti)
 
void Wln_NtkStaticFanoutStart (Wln_Ntk_t *p)
 
void Wln_NtkStaticFanoutStop (Wln_Ntk_t *p)
 
void Wln_NtkStaticFanoutTest (Wln_Ntk_t *p)
 
char * Wln_ObjName (Wln_Ntk_t *p, int iObj)
 DECLARATIONS ///.
 
char * Wln_ObjConstString (Wln_Ntk_t *p, int iObj)
 
void Wln_ObjUpdateType (Wln_Ntk_t *p, int iObj, int Type)
 
void Wln_ObjSetConst (Wln_Ntk_t *p, int iObj, int NameId)
 
void Wln_ObjSetSlice (Wln_Ntk_t *p, int iObj, int SliceId)
 
void Wln_ObjAddFanin (Wln_Ntk_t *p, int iObj, int i)
 
int Wln_ObjAddFanins (Wln_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
 
int Wln_ObjAlloc (Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
 
int Wln_ObjClone (Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
 
int Wln_ObjCreateCo (Wln_Ntk_t *p, int iFanin)
 
void Wln_ObjPrint (Wln_Ntk_t *p, int iObj)
 
Vec_Int_tWln_NtkRetime (Wln_Ntk_t *p, int fIgnoreIO, int fSkipSimple, int fVerbose)
 
void Wln_NtkRetimeCreateDelayInfo (Wln_Ntk_t *pNtk)
 
void Wln_WriteVer (Wln_Ntk_t *p, char *pFileName)
 
Rtl_Lib_tRtl_LibReadFile (char *pFileName, char *pFileSpec)
 
void Rtl_LibFree (Rtl_Lib_t *p)
 

Macro Definition Documentation

◆ Wln_NtkForEachCi

#define Wln_NtkForEachCi ( p,
iCi,
i )
Value:
for ( i = 0; (i < Wln_NtkCiNum(p)) && (((iCi) = Wln_NtkCi(p, i)), 1); i++ )
Cube * p
Definition exorList.c:222

Definition at line 198 of file wln.h.

198#define Wln_NtkForEachCi( p, iCi, i ) \
199 for ( i = 0; (i < Wln_NtkCiNum(p)) && (((iCi) = Wln_NtkCi(p, i)), 1); i++ )

◆ Wln_NtkForEachCo

#define Wln_NtkForEachCo ( p,
iCo,
i )
Value:
for ( i = 0; (i < Wln_NtkCoNum(p)) && (((iCo) = Wln_NtkCo(p, i)), 1); i++ )

Definition at line 200 of file wln.h.

200#define Wln_NtkForEachCo( p, iCo, i ) \
201 for ( i = 0; (i < Wln_NtkCoNum(p)) && (((iCo) = Wln_NtkCo(p, i)), 1); i++ )

◆ Wln_NtkForEachFf

#define Wln_NtkForEachFf ( p,
iFf,
i )
Value:
for ( i = 0; (i < Wln_NtkFfNum(p)) && (((iFf) = Wln_NtkFf(p, i)), 1); i++ )

Definition at line 202 of file wln.h.

202#define Wln_NtkForEachFf( p, iFf, i ) \
203 for ( i = 0; (i < Wln_NtkFfNum(p)) && (((iFf) = Wln_NtkFf(p, i)), 1); i++ )

◆ Wln_NtkForEachObj

#define Wln_NtkForEachObj ( p,
i )
Value:
for ( i = 1; i < Wln_NtkObjNum(p); i++ )

MACRO DEFINITIONS ///.

ITERATORS ///

Definition at line 187 of file wln.h.

187#define Wln_NtkForEachObj( p, i ) \
188 for ( i = 1; i < Wln_NtkObjNum(p); i++ )

◆ Wln_NtkForEachObjInternal

#define Wln_NtkForEachObjInternal ( p,
i )
Value:
for ( i = 1; i < Wln_NtkObjNum(p); i++ ) if ( Wln_ObjIsCio(p, i) ) {} else

Definition at line 191 of file wln.h.

191#define Wln_NtkForEachObjInternal( p, i ) \
192 for ( i = 1; i < Wln_NtkObjNum(p); i++ ) if ( Wln_ObjIsCio(p, i) ) {} else

◆ Wln_NtkForEachObjReverse

#define Wln_NtkForEachObjReverse ( p,
i )
Value:
for ( i = Wln_NtkObjNum(p) - 1; i > 0; i-- )

Definition at line 189 of file wln.h.

189#define Wln_NtkForEachObjReverse( p, i ) \
190 for ( i = Wln_NtkObjNum(p) - 1; i > 0; i-- )

◆ Wln_NtkForEachPi

#define Wln_NtkForEachPi ( p,
iPi,
i )
Value:
for ( i = 0; (i < Wln_NtkPiNum(p)) && (((iPi) = Wln_NtkCi(p, i)), 1); i++ )

Definition at line 194 of file wln.h.

194#define Wln_NtkForEachPi( p, iPi, i ) \
195 for ( i = 0; (i < Wln_NtkPiNum(p)) && (((iPi) = Wln_NtkCi(p, i)), 1); i++ )

◆ Wln_NtkForEachPo

#define Wln_NtkForEachPo ( p,
iPo,
i )
Value:
for ( i = 0; (i < Wln_NtkPoNum(p)) && (((iPo) = Wln_NtkCo(p, i)), 1); i++ )

Definition at line 196 of file wln.h.

196#define Wln_NtkForEachPo( p, iPo, i ) \
197 for ( i = 0; (i < Wln_NtkPoNum(p)) && (((iPo) = Wln_NtkCo(p, i)), 1); i++ )

◆ Wln_ObjForEachFanin

#define Wln_ObjForEachFanin ( p,
iObj,
iFanin,
i )
Value:
for ( i = 0; (i < Wln_ObjFaninNum(p, iObj)) && (((iFanin) = Wln_ObjFanin(p, iObj, i)), 1); i++ ) if ( !iFanin ) {} else

Definition at line 205 of file wln.h.

205#define Wln_ObjForEachFanin( p, iObj, iFanin, i ) \
206 for ( i = 0; (i < Wln_ObjFaninNum(p, iObj)) && (((iFanin) = Wln_ObjFanin(p, iObj, i)), 1); i++ ) if ( !iFanin ) {} else

◆ Wln_ObjForEachFaninReverse

#define Wln_ObjForEachFaninReverse ( pObj,
iFanin,
i )
Value:
for ( i = Wln_ObjFaninNum(p, iObj) - 1; (i >= 0) && (((iFanin) = Wln_ObjFanin(p, iObj, i)), 1); i-- ) if ( !iFanin ) {} else

Definition at line 207 of file wln.h.

207#define Wln_ObjForEachFaninReverse( pObj, iFanin, i ) \
208 for ( i = Wln_ObjFaninNum(p, iObj) - 1; (i >= 0) && (((iFanin) = Wln_ObjFanin(p, iObj, i)), 1); i-- ) if ( !iFanin ) {} else

◆ Wln_ObjForEachFanoutStatic

#define Wln_ObjForEachFanoutStatic ( p,
iObj,
iFanout,
i )
Value:
for ( i = 0; (i < Wln_ObjRefs(p, iObj)) && (((iFanout) = Wln_ObjFanout(p, iObj, i)), 1); i++ )

Definition at line 210 of file wln.h.

210#define Wln_ObjForEachFanoutStatic( p, iObj, iFanout, i ) \
211 for ( i = 0; (i < Wln_ObjRefs(p, iObj)) && (((iFanout) = Wln_ObjFanout(p, iObj, i)), 1); i++ )

Typedef Documentation

◆ Rtl_Lib_t

typedef struct Rtl_Lib_t_ Rtl_Lib_t

Definition at line 255 of file wln.h.

◆ Wln_Ntk_t

typedef struct Wln_Ntk_t_ Wln_Ntk_t

Definition at line 55 of file wln.h.

◆ Wln_Vec_t

typedef typedefABC_NAMESPACE_HEADER_START struct Wln_Vec_t_ Wln_Vec_t

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 /// BASIC TYPES ///

Definition at line 46 of file wln.h.

Function Documentation

◆ Rtl_LibFree()

void Rtl_LibFree ( Rtl_Lib_t * p)
extern

Definition at line 318 of file wlnRead.c.

319{
320 Rtl_Ntk_t * pNtk; int i;
321 Vec_PtrForEachEntry( Rtl_Ntk_t *, p->vNtks, pNtk, i )
322 Rtl_NtkFree( pNtk );
323 ABC_FREE( p->vConsts.pArray );
324 ABC_FREE( p->vSlices.pArray );
325 ABC_FREE( p->vConcats.pArray );
326 ABC_FREE( p->vAttrTemp.pArray );
327 for ( i = 0; i < TEMP_NUM; i++ )
328 ABC_FREE( p->vTemp[i].pArray );
329 Vec_IntFreeP( &p->vMap );
330 Vec_IntFreeP( &p->vDirects );
331 Vec_IntFreeP( &p->vInverses );
332 Vec_IntFreeP( &p->vTokens );
333 Abc_NamStop( p->pManName );
334 Vec_PtrFree( p->vNtks );
335 ABC_FREE( p->pSpec );
336 ABC_FREE( p );
337}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Abc_NamStop(Abc_Nam_t *p)
Definition utilNam.c:112
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
#define TEMP_NUM
Definition wlnRead.c:35
struct Rtl_Ntk_t_ Rtl_Ntk_t
Definition wlnRead.c:57
void Rtl_NtkFree(Rtl_Ntk_t *p)
Definition wlnRead.c:191
Here is the call graph for this function:

◆ Rtl_LibReadFile()

Rtl_Lib_t * Rtl_LibReadFile ( char * pFileName,
char * pFileSpec )
extern

Definition at line 1492 of file wlnRead.c.

1493{
1494 Rtl_Lib_t * p = Rtl_LibAlloc(); int i, Entry;
1495 p->pSpec = Abc_UtilStrsav( pFileSpec );
1496 p->pManName = Abc_NamStart( 1000, 50 );
1497 p->vTokens = Rtl_NtkReadFile( pFileName, p->pManName );
1498 Rtl_LibDeriveMap( p );
1499 Vec_IntClear( &p->vAttrTemp );
1500 Vec_IntForEachEntry( p->vTokens, Entry, i )
1501 if ( Entry == p->pMap[RTL_MODULE] )
1502 i = Rtl_NtkReadNtk( p, i+1 );
1503 else if ( Entry == p->pMap[RTL_ATTRIBUTE] )
1504 i = Rtl_NtkReadAttribute2( p, i+1 );
1508 return p;
1509}
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
Definition utilNam.c:80
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
@ RTL_ATTRIBUTE
Definition wlnRead.c:423
@ RTL_MODULE
Definition wlnRead.c:410
int Rtl_NtkReadAttribute2(Rtl_Lib_t *p, int iPos)
Definition wlnRead.c:1286
Rtl_Lib_t * Rtl_LibAlloc()
Definition wlnRead.c:309
void Rtl_LibSetParents(Rtl_Lib_t *p)
Definition wlnRead.c:1430
Vec_Int_t * Rtl_NtkReadFile(char *pFileName, Abc_Nam_t *p)
Definition wlnRead.c:996
int Rtl_NtkReadNtk(Rtl_Lib_t *pLib, int Mod)
Definition wlnRead.c:1363
void Rtl_LibReorderModules(Rtl_Lib_t *p)
Definition wlnRead.c:1477
void Rtl_LibOrderWires(Rtl_Lib_t *pLib)
Definition wlnRead.c:681
struct Rtl_Lib_t_ Rtl_Lib_t
Definition wln.h:255
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkAlloc()

Wln_Ntk_t * Wln_NtkAlloc ( char * pName,
int nObjsMax )
extern

DECLARATIONS ///.

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

FileName [wlnNtk.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Word-level network.]

Synopsis [Network construction procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 23, 2018.]

Revision [

Id
wlnNtk.c,v 1.00 2018/09/23 00:00:00 alanmi Exp

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

Synopsis [Creating networks.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file wlnNtk.c.

46{
47 Wln_Ntk_t * p; int i;
48 p = ABC_CALLOC( Wln_Ntk_t, 1 );
49 p->pName = pName ? Extra_FileNameGeneric( pName ) : NULL;
50 Vec_IntGrow( &p->vCis, 111 );
51 Vec_IntGrow( &p->vCos, 111 );
52 Vec_IntGrow( &p->vFfs, 111 );
53 Vec_IntGrow( &p->vTypes, nObjsMax+1 );
54 Vec_StrGrow( &p->vSigns, nObjsMax+1 );
55 Vec_IntGrow( &p->vRanges, nObjsMax+1 );
56 Vec_IntPush( &p->vTypes, -1 );
57 Vec_StrPush( &p->vSigns, -1 );
58 Vec_IntPush( &p->vRanges, -1 );
59 p->vFanins = ABC_CALLOC( Wln_Vec_t, nObjsMax+1 );
60 p->pRanges = Hash_IntManStart( 1000 );
61 for ( i = 0; i < 65; i++ )
62 Hash_Int2ManInsert( p->pRanges, i, i, 0 );
63 for ( i = 1; i < 64; i++ )
64 Hash_Int2ManInsert( p->pRanges, i, 0, 0 );
65 assert( Hash_IntManEntryNum(p->pRanges) == 128 );
66 return p;
67}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
char * Extra_FileNameGeneric(char *FileName)
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Wln_Vec_t_ Wln_Vec_t
INCLUDES ///.
Definition wln.h:46
struct Wln_Ntk_t_ Wln_Ntk_t
Definition wln.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkCreateRefs()

void Wln_NtkCreateRefs ( Wln_Ntk_t * p)
extern

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

Synopsis [Create fanin/fanout map.]

Description []

SideEffects []

SeeAlso []

Definition at line 357 of file wlnNtk.c.

358{
359 int k, iObj, iFanin;
360 Wln_NtkCleanRefs( p );
361 Wln_NtkForEachObj( p, iObj )
362 Wln_ObjForEachFanin( p, iObj, iFanin, k )
363 Wln_ObjRefsInc( p, iFanin );
364}
#define Wln_ObjForEachFanin(p, iObj, iFanin, i)
Definition wln.h:205
#define Wln_NtkForEachObj(p, i)
MACRO DEFINITIONS ///.
Definition wln.h:187
Here is the caller graph for this function:

◆ Wln_NtkDupDfs()

Wln_Ntk_t * Wln_NtkDupDfs ( Wln_Ntk_t * p)
extern

Definition at line 325 of file wlnNtk.c.

326{
327 int i, k, iObj, iFanin;
328 Wln_Ntk_t * pNew = Wln_NtkAlloc( p->pName, Wln_NtkObjNum(p) );
329 pNew->fSmtLib = p->fSmtLib;
330 if ( p->pSpec ) pNew->pSpec = Abc_UtilStrsav( p->pSpec );
331 Wln_NtkCleanCopy( p );
332 Wln_NtkForEachCi( p, iObj, i )
333 Wln_ObjDup( pNew, p, iObj );
334 Wln_NtkForEachFf( p, iObj, i )
335 Wln_ObjSetCopy( p, iObj, Wln_ObjClone(pNew, p, iObj) );
336 Wln_NtkForEachCo( p, iObj, i )
337 Wln_NtkDupDfs_rec( pNew, p, iObj );
338 Wln_NtkForEachFf( p, iObj, i )
339 Wln_ObjForEachFanin( p, iObj, iFanin, k )
340 Wln_ObjAddFanin( pNew, Wln_ObjCopy(p, iObj), Wln_NtkDupDfs_rec(pNew, p, iFanin) );
341 if ( Wln_NtkHasNameId(p) )
342 Wln_NtkTransferNames( pNew, p );
343 return pNew;
344}
int fSmtLib
Definition wln.h:60
char * pSpec
Definition wln.h:59
void Wln_NtkTransferNames(Wln_Ntk_t *pNew, Wln_Ntk_t *p)
Definition wlnNtk.c:273
ABC_NAMESPACE_IMPL_START Wln_Ntk_t * Wln_NtkAlloc(char *pName, int nObjsMax)
DECLARATIONS ///.
Definition wlnNtk.c:45
int Wln_NtkDupDfs_rec(Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
Definition wlnNtk.c:312
int Wln_ObjDup(Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
Definition wlnNtk.c:300
#define Wln_NtkForEachFf(p, iFf, i)
Definition wln.h:202
#define Wln_NtkForEachCo(p, iCo, i)
Definition wln.h:200
void Wln_ObjAddFanin(Wln_Ntk_t *p, int iObj, int i)
Definition wlnObj.c:75
#define Wln_NtkForEachCi(p, iCi, i)
Definition wln.h:198
int Wln_ObjClone(Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
Definition wlnObj.c:125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkFree()

void Wln_NtkFree ( Wln_Ntk_t * p)
extern

Definition at line 68 of file wlnNtk.c.

69{
70 int i;
71 for ( i = 0; i < Wln_NtkObjNum(p); i++ )
72 if ( Wln_ObjFaninNum(p, i) > 2 )
73 ABC_FREE( p->vFanins[i].pArray[0] );
74 ABC_FREE( p->vFanins );
75
76 if ( p->pRanges ) Hash_IntManStop( p->pRanges );
77 if ( p->pManName ) Abc_NamStop( p->pManName );
78
79 ABC_FREE( p->vCis.pArray );
80 ABC_FREE( p->vCos.pArray );
81 ABC_FREE( p->vFfs.pArray );
82
83 ABC_FREE( p->vTypes.pArray );
84 ABC_FREE( p->vSigns.pArray );
85 ABC_FREE( p->vRanges.pArray );
86 ABC_FREE( p->vNameIds.pArray );
87 ABC_FREE( p->vInstIds.pArray );
88 ABC_FREE( p->vTravIds.pArray );
89 ABC_FREE( p->vCopies.pArray );
90 ABC_FREE( p->vBits.pArray );
91 ABC_FREE( p->vLevels.pArray );
92 ABC_FREE( p->vRefs.pArray );
93 ABC_FREE( p->vFanout.pArray );
94 ABC_FREE( p->vFaninAttrs.pArray );
95 ABC_FREE( p->vFaninLists.pArray );
96
97 ABC_FREE( p->pName );
98 ABC_FREE( p->pSpec );
99 ABC_FREE( p );
100}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkFromNdr()

Wln_Ntk_t * Wln_NtkFromNdr ( void * pData,
int fDump )
extern

Definition at line 182 of file wlnNdr.c.

183{
184 Ndr_Data_t * p = (Ndr_Data_t *)pData;
185 Vec_Int_t * vName2Obj, * vFanins = Vec_IntAlloc( 100 );
186 Vec_Ptr_t * vConstStrings = Vec_PtrAlloc( 100 );
187 int Mod = 2, i, k, iFanin, iObj, Obj, * pArray, nDigits, fFound, NameId, NameIdMax;
188 Wln_Ntk_t * pTemp, * pNtk = Wln_NtkAlloc( "top", Ndr_DataObjNum(p, Mod) );
189 Wln_NtkCheckIntegrity( pData );
190 //pNtk->pSpec = Abc_UtilStrsav( pFileName );
191 // construct network and save name IDs
192 Wln_NtkCleanNameId( pNtk );
193 Wln_NtkCleanInstId( pNtk );
194 Ndr_ModForEachPi( p, Mod, Obj )
195 {
196 int End, Beg, Signed = Ndr_ObjGetRange(p, Obj, &End, &Beg);
197 int iObj = Wln_ObjAlloc( pNtk, ABC_OPER_CI, Signed, End, Beg );
198 int NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
199 int InstId = Ndr_ObjReadBody( p, Obj, NDR_NAME );
200 Wln_ObjSetNameId( pNtk, iObj, NameId );
201 if ( InstId > 0 ) Wln_ObjSetInstId( pNtk, iObj, InstId );
202 }
203 Ndr_ModForEachNode( p, Mod, Obj )
204 {
205 int End, Beg, Signed = Ndr_ObjGetRange(p, Obj, &End, &Beg);
206 int Type = Ndr_ObjReadBody( p, Obj, NDR_OPERTYPE );
207 int nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
208 Vec_Int_t F = {nArray, nArray, pArray}, * vTemp = &F;
209 int iObj = Wln_ObjAlloc( pNtk, Type, Signed, End, Beg );
210 int NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
211 int InstId = Ndr_ObjReadBody( p, Obj, NDR_NAME );
212 Vec_IntClear( vFanins );
213 Vec_IntAppend( vFanins, vTemp );
214 assert( Type != ABC_OPER_DFF );
215 if ( Wln_ObjIsSlice(pNtk, iObj) )
216 Wln_ObjSetSlice( pNtk, iObj, Hash_Int2ManInsert(pNtk->pRanges, End, Beg, 0) );
217 else if ( Wln_ObjIsConst(pNtk, iObj) )
218 Vec_PtrPush( vConstStrings, (char *)Ndr_ObjReadBodyP(p, Obj, NDR_FUNCTION) );
219// else if ( Type == ABC_OPER_BIT_MUX && Vec_IntSize(vFanins) == 3 )
220// ABC_SWAP( int, Wln_ObjFanins(pNtk, iObj)[1], Wln_ObjFanins(pNtk, iObj)[2] );
221 Wln_ObjAddFanins( pNtk, iObj, vFanins );
222 Wln_ObjSetNameId( pNtk, iObj, NameId );
223 if ( InstId > 0 ) Wln_ObjSetInstId( pNtk, iObj, InstId );
224 if ( Type == ABC_OPER_ARI_SMUL )
225 {
226 assert( Wln_ObjFaninNum(pNtk, iObj) == 2 );
227 Wln_ObjSetSigned( pNtk, Wln_ObjFanin0(pNtk, iObj) );
228 Wln_ObjSetSigned( pNtk, Wln_ObjFanin1(pNtk, iObj) );
229 }
230 }
231 // mark primary outputs
232 Ndr_ModForEachPo( p, Mod, Obj )
233 {
234 int End, Beg, Signed = Ndr_ObjGetRange(p, Obj, &End, &Beg);
235 int nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
236 int iObj = Wln_ObjAlloc( pNtk, ABC_OPER_CO, Signed, End, Beg );
237 int NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
238 int InstId = Ndr_ObjReadBody( p, Obj, NDR_NAME );
239 assert( nArray == 1 && NameId == -1 && InstId == -1 );
240 Wln_ObjAddFanin( pNtk, iObj, pArray[0] );
241 }
242 Vec_IntFree( vFanins );
243 // remove instance names if they are not given
244 //Vec_IntPrint( &pNtk->vInstIds );
245 if ( Vec_IntCountPositive(&pNtk->vInstIds) == 0 )
246 Vec_IntErase( &pNtk->vInstIds );
247 // map name IDs into object IDs
248 vName2Obj = Vec_IntInvert( &pNtk->vNameIds, 0 );
249 Wln_NtkForEachObj( pNtk, i )
250 Wln_ObjForEachFanin( pNtk, i, iFanin, k )
251 Wln_ObjSetFanin( pNtk, i, k, Vec_IntEntry(vName2Obj, iFanin) );
252 Vec_IntFree(vName2Obj);
253 // create fake object names
254 NameIdMax = Vec_IntFindMax(&pNtk->vNameIds);
255 nDigits = Abc_Base10Log( NameIdMax+1 );
256 pNtk->pManName = Abc_NamStart( NameIdMax+1, 10 );
257 for ( i = 1; i <= NameIdMax; i++ )
258 {
259 char pName[1000]; sprintf( pName, "s%0*d", (unsigned char)nDigits, i );
260 NameId = Abc_NamStrFindOrAdd( pNtk->pManName, pName, &fFound );
261 assert( !fFound && i == NameId );
262 }
263 // add const strings
264 i = 0;
265 Wln_NtkForEachObj( pNtk, iObj )
266 if ( Wln_ObjIsConst(pNtk, iObj) )
267 Wln_ObjSetConst( pNtk, iObj, Abc_NamStrFindOrAdd(pNtk->pManName, (char *)Vec_PtrEntry(vConstStrings, i++), NULL) );
268 assert( i == Vec_PtrSize(vConstStrings) );
269 Vec_PtrFree( vConstStrings );
270 //Ndr_NtkPrintObjects( pNtk );
271 Wln_WriteVer( pNtk, "temp_ndr.v" );
272 printf( "Dumped design \"%s\" into file \"temp_ndr.v\".\n", pNtk->pName );
273 if ( !Wln_NtkIsAcyclic(pNtk) )
274 {
275 Wln_NtkFree(pNtk);
276 return NULL;
277 }
278 // derive topological order
279 pNtk = Wln_NtkDupDfs( pTemp = pNtk );
280 Wln_NtkFree( pTemp );
281 //Ndr_NtkPrintObjects( pNtk );
282 //pNtk->fMemPorts = 1; // the network contains memory ports
283 //pNtk->fEasyFfs = 1; // the network contains simple flops
284 return pNtk;
285}
@ ABC_OPER_DFF
Definition abcOper.h:142
@ ABC_OPER_ARI_SMUL
Definition abcOper.h:102
@ ABC_OPER_CI
Definition abcOper.h:45
@ ABC_OPER_CO
Definition abcOper.h:46
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
@ NDR_INPUT
Definition ndr.h:103
@ NDR_FUNCTION
Definition ndr.h:108
@ NDR_NAME
Definition ndr.h:106
@ NDR_OPERTYPE
Definition ndr.h:105
@ NDR_OUTPUT
Definition ndr.h:104
struct Ndr_Data_t_ Ndr_Data_t
BASIC TYPES ///.
Definition ndr.h:119
#define Ndr_ModForEachPo(p, Mod, Obj)
Definition ndr.h:159
#define Ndr_ModForEachPi(p, Mod, Obj)
Definition ndr.h:155
#define Ndr_ModForEachNode(p, Mod, Obj)
Definition ndr.h:163
Hash_IntMan_t * pRanges
Definition wln.h:67
Vec_Int_t vInstIds
Definition wln.h:69
Vec_Int_t vNameIds
Definition wln.h:68
Abc_Nam_t * pManName
Definition wln.h:70
char * pName
Definition wln.h:58
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
Definition utilNam.c:453
char * sprintf()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
int Ndr_ObjGetRange(Ndr_Data_t *p, int Obj, int *End, int *Beg)
Definition wlnNdr.c:120
void Wln_NtkCheckIntegrity(void *pData)
Definition wlnNdr.c:153
void Wln_WriteVer(Wln_Ntk_t *p, char *pFileName)
void Wln_ObjSetSlice(Wln_Ntk_t *p, int iObj, int SliceId)
Definition wlnObj.c:70
int Wln_NtkIsAcyclic(Wln_Ntk_t *p)
Definition wlnNtk.c:192
Wln_Ntk_t * Wln_NtkDupDfs(Wln_Ntk_t *p)
Definition wlnNtk.c:325
void Wln_NtkFree(Wln_Ntk_t *p)
Definition wlnNtk.c:68
int Wln_ObjAlloc(Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition wlnObj.c:105
void Wln_ObjSetConst(Wln_Ntk_t *p, int iObj, int NameId)
Definition wlnObj.c:65
Wln_Ntk_t * Wln_NtkAlloc(char *pName, int nObjsMax)
DECLARATIONS ///.
Definition wlnNtk.c:45
int Wln_ObjAddFanins(Wln_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
Definition wlnObj.c:98
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkIsAcyclic()

int Wln_NtkIsAcyclic ( Wln_Ntk_t * p)
extern

Wln_ObjRefs(p, iObj) &&

Definition at line 192 of file wlnNtk.c.

193{
194 int fAcyclic, i, iObj, nUnvisited = 0 ;
195 // set the traversal ID for this DFS ordering
196 Wln_NtkIncrementTravId( p );
197 Wln_NtkIncrementTravId( p );
198 // iObj->TravId == pNet->nTravIds means "iObj is on the path"
199 // iObj->TravId == pNet->nTravIds - 1 means "iObj is visited but is not on the path"
200 // iObj->TravId < pNet->nTravIds - 1 means "iObj is not visited"
201 // traverse the network to detect cycles
202 fAcyclic = 1;
203 Wln_NtkForEachCo( p, iObj, i )
204 {
205 // traverse the output logic cone
206 if ( (fAcyclic = Wln_NtkIsAcyclic_rec(p, iObj)) )
207 continue;
208 // stop as soon as the first loop is detected
209 fprintf( stdout, "Primary output %16s (ID %6d)\n", Wln_ObjName(p, iObj), iObj );
210 goto finish;
211 }
212 Wln_NtkForEachFf( p, iObj, i )
213 {
214 // traverse the output logic cone
215 if ( (fAcyclic = Wln_NtkIsAcyclic_rec(p, iObj)) )
216 continue;
217 // stop as soon as the first loop is detected
218 fprintf( stdout, "Flip-flop %16s (ID %6d)\n", Wln_ObjName(p, iObj), iObj );
219 goto finish;
220 }
221 Wln_NtkForEachObj( p, iObj )
222 nUnvisited += !Wln_ObjIsTravIdPrevious(p, iObj) && !Wln_ObjIsCi(p, iObj);
223 if ( nUnvisited )
224 {
225 int nSinks = 0;
227 printf( "The network has %d objects and %d (%6.2f %%) of them are not connected to the outputs.\n",
228 Wln_NtkObjNum(p), nUnvisited, 100.0*nUnvisited/Wln_NtkObjNum(p) );
229 Wln_NtkForEachObj( p, iObj )
230 if ( !Wln_ObjRefs(p, iObj) && !Wln_ObjIsCi(p, iObj) && !Wln_ObjIsCo(p, iObj) && !Wln_ObjIsFf(p, iObj) )
231 nSinks++;
232 if ( nSinks )
233 {
234 int nPrinted = 0;
235 printf( "These unconnected objects feed into %d sink objects without fanout:\n", nSinks );
236 Wln_NtkForEachObj( p, iObj )
237 if ( !Wln_ObjRefs(p, iObj) && !Wln_ObjIsCi(p, iObj) && !Wln_ObjIsCo(p, iObj) && !Wln_ObjIsFf(p, iObj) )
238 {
239 fprintf( stdout, "Node %16s (ID %6d) of type %5s (type ID %2d)\n",
240 Wln_ObjName(p, iObj), iObj, Abc_OperName(Wln_ObjType(p, iObj)), Wln_ObjType(p, iObj) );
241 if ( ++nPrinted == 5 )
242 break;
243 }
244 if ( nPrinted < nSinks )
245 printf( "...\n" );
246 }
247 Wln_NtkForEachObj( p, iObj )
248 if ( !Wln_ObjIsTravIdPrevious(p, iObj) && !Wln_ObjIsCi(p, iObj) )
249 {
250 // traverse the output logic cone
251 if ( (fAcyclic = Wln_NtkIsAcyclic_rec(p, iObj)) )
252 continue;
253 // stop as soon as the first loop is detected
254 fprintf( stdout, "Unconnected object %s\n", Wln_ObjName(p, iObj) );
255 goto finish;
256 }
257 }
258finish:
259 return fAcyclic;
260}
void Wln_NtkCreateRefs(Wln_Ntk_t *p)
Definition wlnNtk.c:357
int Wln_NtkIsAcyclic_rec(Wln_Ntk_t *p, int iObj)
Definition wlnNtk.c:152
char * Wln_ObjName(Wln_Ntk_t *p, int iObj)
DECLARATIONS ///.
Definition wlnObj.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkMemUsage()

int Wln_NtkMemUsage ( Wln_Ntk_t * p)
extern

Definition at line 101 of file wlnNtk.c.

102{
103 int Mem = sizeof(Wln_Ntk_t);
104 Mem += 4 * p->vCis.nCap;
105 Mem += 4 * p->vCos.nCap;
106 Mem += 4 * p->vFfs.nCap;
107 Mem += 1 * p->vTypes.nCap;
108 Mem += 4 * p->vRanges.nCap;
109 Mem += 4 * p->vNameIds.nCap;
110 Mem += 4 * p->vInstIds.nCap;
111 Mem += 4 * p->vTravIds.nCap;
112 Mem += 4 * p->vCopies.nCap;
113 Mem += 4 * p->vBits.nCap;
114 Mem += 4 * p->vLevels.nCap;
115 Mem += 4 * p->vRefs.nCap;
116 Mem += 4 * p->vFanout.nCap;
117 Mem += 4 * p->vFaninAttrs.nCap;
118 Mem += 4 * p->vFaninLists.nCap;
119 Mem += 20 * Hash_IntManEntryNum(p->pRanges);
120 Mem += Abc_NamMemUsed(p->pManName);
121 return Mem;
122}
int Abc_NamMemUsed(Abc_Nam_t *p)
Definition utilNam.c:247
Here is the call graph for this function:

◆ Wln_NtkPrint()

void Wln_NtkPrint ( Wln_Ntk_t * p)
extern

Definition at line 123 of file wlnNtk.c.

124{
125 int iObj;
126 printf( "Printing %d objects of network \"%s\":\n", Wln_NtkObjNum(p), p->pName );
127 Wln_NtkForEachObj( p, iObj )
128 Wln_ObjPrint( p, iObj );
129 printf( "\n" );
130}
void Wln_ObjPrint(Wln_Ntk_t *p, int iObj)
Definition wlnObj.c:136
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkRetime()

Vec_Int_t * Wln_NtkRetime ( Wln_Ntk_t * p,
int fIgnoreIO,
int fSkipSimple,
int fVerbose )
extern

Definition at line 718 of file wlnRetime.c.

719{
720 if ( fIgnoreIO )
721 Wln_RetMarkPaths( pNtk, fVerbose );
722 return Wln_NtkRetime_int( pNtk, fSkipSimple, fVerbose );
723}
Vec_Int_t * Wln_NtkRetime_int(Wln_Ntk_t *pNtk, int fSkipSimple, int fVerbose)
Definition wlnRetime.c:623
void Wln_RetMarkPaths(Wln_Ntk_t *p, int fVerbose)
Definition wlnRetime.c:374
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkRetimeCreateDelayInfo()

void Wln_NtkRetimeCreateDelayInfo ( Wln_Ntk_t * pNtk)
extern

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

Synopsis [Retiming computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 592 of file wlnRetime.c.

593{
594 int i, iObj;
595// if ( Wln_NtkHasInstId(pNtk) )
596// Vec_IntErase( &pNtk->vInstIds );
597 if ( Wln_NtkHasInstId(pNtk) )
598 {
599 printf( "Using delays given by the user in the input file.\n" );
600 Wln_NtkForEachObj( pNtk, iObj )
601 if ( !Wln_ObjIsCio(pNtk, iObj) && !Wln_ObjIsConst(pNtk, iObj) && Wln_ObjInstId(pNtk, iObj) == 0 )
602 printf( "Warning: Object %d of type %s has zero delay. Retiming will not work correctly.\n", iObj, Abc_OperName(Wln_ObjType(pNtk, iObj)) );
603 }
604 else
605 {
606 printf( "The design has no delay information.\n" );
607 Wln_NtkCleanInstId(pNtk);
608 Wln_NtkForEachObj( pNtk, iObj )
609 {
610 if ( Wln_ObjIsFf(pNtk, iObj) || Wln_ObjType(pNtk, iObj) == ABC_OPER_SLICE || Wln_ObjType(pNtk, iObj) == ABC_OPER_CONCAT )
611 Wln_ObjSetInstId( pNtk, iObj, 1 );
612 else if ( !Wln_ObjIsCio(pNtk, iObj) && Wln_ObjFaninNum(pNtk, iObj) > 0 )
613 Wln_ObjSetInstId( pNtk, iObj, 10 );
614 }
615 Wln_NtkForEachCo( pNtk, iObj, i )
616 {
617 if ( Wln_ObjType(pNtk, Wln_ObjFanin0(pNtk, iObj)) != ABC_OPER_LUT )
618 Wln_ObjSetInstId( pNtk, Wln_ObjFanin0(pNtk, iObj), 1 );
619 }
620 printf( "Assuming default delays: 10 units for most nodes and 1 unit for bit-slice, concat, and buffers driving COs.\n" );
621 }
622}
@ ABC_OPER_LUT
Definition abcOper.h:127
@ ABC_OPER_CONCAT
Definition abcOper.h:147
@ ABC_OPER_SLICE
Definition abcOper.h:146
Here is the caller graph for this function:

◆ Wln_NtkStartFaninMap()

void Wln_NtkStartFaninMap ( Wln_Ntk_t * p,
Vec_Int_t * vFaninMap,
int nMulti )
extern

Definition at line 372 of file wlnNtk.c.

373{
374 int iObj, iOffset = Wln_NtkObjNum(p);
375 Vec_IntFill( vFaninMap, iOffset + nMulti * Wln_NtkFaninNum(p), 0 );
376 Wln_NtkForEachObj( p, iObj )
377 {
378 Vec_IntWriteEntry( vFaninMap, iObj, iOffset );
379 iOffset += nMulti * Wln_ObjFaninNum(p, iObj);
380 }
381 assert( iOffset == Vec_IntSize(vFaninMap) );
382}
int Wln_NtkFaninNum(Wln_Ntk_t *p)
Definition wlnNtk.c:365
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkStartFanoutMap()

void Wln_NtkStartFanoutMap ( Wln_Ntk_t * p,
Vec_Int_t * vFanoutMap,
Vec_Int_t * vFanoutNums,
int nMulti )
extern

Definition at line 383 of file wlnNtk.c.

384{
385 int iObj, iOffset = Wln_NtkObjNum(p);
386 Vec_IntFill( vFanoutMap, iOffset + nMulti * Vec_IntSum(vFanoutNums), 0 );
387 Wln_NtkForEachObj( p, iObj )
388 {
389 Vec_IntWriteEntry( vFanoutMap, iObj, iOffset );
390 iOffset += nMulti * Wln_ObjRefs(p, iObj);
391 }
392 assert( iOffset == Vec_IntSize(vFanoutMap) );
393}
Here is the caller graph for this function:

◆ Wln_NtkStaticFanoutStart()

void Wln_NtkStaticFanoutStart ( Wln_Ntk_t * p)
extern

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

Synopsis [Static fanout.]

Description []

SideEffects []

SeeAlso []

Definition at line 406 of file wlnNtk.c.

407{
408 int k, iObj, iFanin;
409 Vec_Int_t * vRefsCopy = Vec_IntAlloc(0);
411 Wln_NtkStartFanoutMap( p, &p->vFanout, &p->vRefs, 1 );
412 ABC_SWAP( Vec_Int_t, *vRefsCopy, p->vRefs );
413 // add fanouts
414 Wln_NtkCleanRefs( p );
415 Wln_NtkForEachObj( p, iObj )
416 Wln_ObjForEachFanin( p, iObj, iFanin, k )
417 Wln_ObjSetFanout( p, iFanin, Wln_ObjRefsInc(p, iFanin), iObj );
418 // double-check the current number of fanouts added
419 Wln_NtkForEachObj( p, iObj )
420 assert( Wln_ObjRefs(p, iObj) == Vec_IntEntry(vRefsCopy, iObj) );
421 Vec_IntFree( vRefsCopy );
422}
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
void Wln_NtkStartFanoutMap(Wln_Ntk_t *p, Vec_Int_t *vFanoutMap, Vec_Int_t *vFanoutNums, int nMulti)
Definition wlnNtk.c:383
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkStaticFanoutStop()

void Wln_NtkStaticFanoutStop ( Wln_Ntk_t * p)
extern

Definition at line 423 of file wlnNtk.c.

424{
425 Vec_IntErase( &p->vRefs );
426 Vec_IntErase( &p->vFanout );
427}
Here is the caller graph for this function:

◆ Wln_NtkStaticFanoutTest()

void Wln_NtkStaticFanoutTest ( Wln_Ntk_t * p)
extern

Definition at line 428 of file wlnNtk.c.

429{
430 int k, iObj, iFanout;
431 printf( "Printing fanouts of %d objects of network \"%s\":\n", Wln_NtkObjNum(p), p->pName );
433 Wln_NtkForEachObj( p, iObj )
434 {
435 Wln_ObjPrint( p, iObj );
436 printf( " Fanouts : " );
437 Wln_ObjForEachFanoutStatic( p, iObj, iFanout, k )
438 printf( "%5d ", iFanout );
439 printf( "\n" );
440 }
442 printf( "\n" );
443}
void Wln_NtkStaticFanoutStop(Wln_Ntk_t *p)
Definition wlnNtk.c:423
void Wln_NtkStaticFanoutStart(Wln_Ntk_t *p)
Definition wlnNtk.c:406
#define Wln_ObjForEachFanoutStatic(p, iObj, iFanout, i)
Definition wln.h:210
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkToNdr()

void * Wln_NtkToNdr ( Wln_Ntk_t * p)
extern

DECLARATIONS ///.

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

FileName [wlnNdr.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Word-level network.]

Synopsis [Constructing WLN network from NDR data structure.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 23, 2018.]

Revision [

Id
wlnNdr.c,v 1.00 2018/09/23 00:00:00 alanmi Exp

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file wlnNdr.c.

46{
47 Vec_Int_t * vFanins;
48 int i, k, iObj, iFanin;
49 // create a new module
50 void * pDesign = Ndr_Create( 1 );
51 int ModId = Ndr_AddModule( pDesign, 1 );
52 // add primary inputs
53 Wln_NtkForEachPi( p, iObj, i )
54 {
55 Ndr_AddObject( pDesign, ModId, ABC_OPER_CI, 0,
56 Wln_ObjRangeEnd(p, iObj), Wln_ObjRangeBeg(p, iObj), Wln_ObjIsSigned(p, iObj),
57 0, NULL, 1, &iObj, NULL ); // no fanins
58 }
59 // add internal nodes
60 vFanins = Vec_IntAlloc( 10 );
62 {
63 Vec_IntClear( vFanins );
64 Wln_ObjForEachFanin( p, iObj, iFanin, k )
65 Vec_IntPush( vFanins, iFanin );
66 Ndr_AddObject( pDesign, ModId, Wln_ObjType(p, iObj), 0,
67 Wln_ObjRangeEnd(p, iObj), Wln_ObjRangeBeg(p, iObj), Wln_ObjIsSigned(p, iObj),
68 Vec_IntSize(vFanins), Vec_IntArray(vFanins), 1, &iObj,
69 Wln_ObjIsConst(p, iObj) ? Wln_ObjConstString(p, iObj) : NULL );
70 }
71 Vec_IntFree( vFanins );
72 // add primary outputs
73 Wln_NtkForEachPo( p, iObj, i )
74 {
75 Ndr_AddObject( pDesign, ModId, ABC_OPER_CO, 0,
76 Wln_ObjRangeEnd(p, iObj), Wln_ObjRangeBeg(p, iObj), Wln_ObjIsSigned(p, iObj),
77 1, &iObj, 0, NULL, NULL );
78 }
79 return pDesign;
80}
#define Wln_NtkForEachObjInternal(p, i)
Definition wln.h:191
#define Wln_NtkForEachPo(p, iPo, i)
Definition wln.h:196
char * Wln_ObjConstString(Wln_Ntk_t *p, int iObj)
Definition wlnObj.c:53
#define Wln_NtkForEachPi(p, iPi, i)
Definition wln.h:194
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjAddFanin()

void Wln_ObjAddFanin ( Wln_Ntk_t * p,
int iObj,
int i )
extern

Definition at line 75 of file wlnObj.c.

76{
77 Wln_Vec_t * pVec = p->vFanins + iObj;
78 if ( Wln_ObjFaninNum(p, iObj) < 2 )
79 pVec->Array[pVec->nSize++] = i;
80 else if ( Wln_ObjFaninNum(p, iObj) == 2 )
81 {
82 int * pArray = ABC_ALLOC( int, 4 );
83 pArray[0] = pVec->Array[0];
84 pArray[1] = pVec->Array[1];
85 pArray[2] = i;
86 pVec->pArray[0] = pArray;
87 pVec->nSize = 3;
88 pVec->nCap = 4;
89 }
90 else
91 {
92 if ( pVec->nSize == pVec->nCap )
93 pVec->pArray[0] = ABC_REALLOC( int, pVec->pArray[0], (pVec->nCap = 2*pVec->nSize) );
94 assert( pVec->nSize < pVec->nCap );
95 pVec->pArray[0][pVec->nSize++] = i;
96 }
97}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
Here is the caller graph for this function:

◆ Wln_ObjAddFanins()

int Wln_ObjAddFanins ( Wln_Ntk_t * p,
int iObj,
Vec_Int_t * vFanins )
extern

Definition at line 98 of file wlnObj.c.

99{
100 int i, iFanin;
101 Vec_IntForEachEntry( vFanins, iFanin, i )
102 Wln_ObjAddFanin( p, iObj, iFanin );
103 return iObj;
104}
void Wln_ObjAddFanin(Wln_Ntk_t *p, int iObj, int i)
Definition wlnObj.c:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjAlloc()

int Wln_ObjAlloc ( Wln_Ntk_t * p,
int Type,
int Signed,
int End,
int Beg )
extern

Definition at line 105 of file wlnObj.c.

106{
107 int iObj = Vec_IntSize(&p->vTypes);
108 if ( iObj == Vec_IntCap(&p->vTypes) )
109 {
110 p->vFanins = ABC_REALLOC( Wln_Vec_t, p->vFanins, 2 * iObj );
111 memset( p->vFanins + iObj, 0, sizeof(Wln_Vec_t) * iObj );
112 Vec_IntGrow( &p->vTypes, 2 * iObj );
113 }
114 assert( iObj == Vec_StrSize(&p->vSigns) );
115 assert( iObj == Vec_IntSize(&p->vRanges) );
116 Vec_IntPush( &p->vTypes, Type );
117 Vec_StrPush( &p->vSigns, (char)Signed );
118 Vec_IntPush( &p->vRanges, Hash_Int2ManInsert(p->pRanges, End, Beg, 0) );
119 if ( Wln_ObjIsCi(p, iObj) ) Wln_ObjSetFanin( p, iObj, 1, Vec_IntSize(&p->vCis) ), Vec_IntPush( &p->vCis, iObj );
120 if ( Wln_ObjIsCo(p, iObj) ) Wln_ObjSetFanin( p, iObj, 1, Vec_IntSize(&p->vCos) ), Vec_IntPush( &p->vCos, iObj );
121 if ( Wln_ObjIsFf(p, iObj) ) Vec_IntPush( &p->vFfs, iObj );
122 p->nObjs[Type]++;
123 return iObj;
124}
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjClone()

int Wln_ObjClone ( Wln_Ntk_t * pNew,
Wln_Ntk_t * p,
int iObj )
extern

Definition at line 125 of file wlnObj.c.

126{
127 return Wln_ObjAlloc( pNew, Wln_ObjType(p, iObj), Wln_ObjIsSigned(p, iObj), Wln_ObjRangeEnd(p, iObj), Wln_ObjRangeBeg(p, iObj) );
128}
int Wln_ObjAlloc(Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition wlnObj.c:105
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjConstString()

char * Wln_ObjConstString ( Wln_Ntk_t * p,
int iObj )
extern

Definition at line 53 of file wlnObj.c.

54{
55 assert( Wln_ObjIsConst(p, iObj) );
56 return Abc_NamStr( p->pManName, Wln_ObjFanin0(p, iObj) );
57}
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition utilNam.c:555
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjCreateCo()

int Wln_ObjCreateCo ( Wln_Ntk_t * p,
int iFanin )
extern

Definition at line 129 of file wlnObj.c.

130{
131 int iCo = Wln_ObjClone( p, p, iFanin );
133 Wln_ObjAddFanin( p, iCo, iFanin );
134 return iCo;
135}
void Wln_ObjUpdateType(Wln_Ntk_t *p, int iObj, int Type)
Definition wlnObj.c:58
int Wln_ObjClone(Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
Definition wlnObj.c:125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjName()

char * Wln_ObjName ( Wln_Ntk_t * p,
int iObj )
extern

DECLARATIONS ///.

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

FileName [wlnObj.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Word-level network.]

Synopsis [Object construction procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 23, 2018.]

Revision [

Id
wlnObj.c,v 1.00 2018/09/23 00:00:00 alanmi Exp

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

Synopsis [Creating objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file wlnObj.c.

46{
47 static char Buffer[100];
48 if ( Wln_NtkHasNameId(p) && Wln_ObjNameId(p, iObj) )
49 return Abc_NamStr( p->pManName, Wln_ObjNameId(p, iObj) );
50 sprintf( Buffer, "n%d", iObj );
51 return Buffer;
52}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjPrint()

void Wln_ObjPrint ( Wln_Ntk_t * p,
int iObj )
extern

Definition at line 136 of file wlnObj.c.

137{
138 int k, iFanin, Type = Wln_ObjType(p, iObj);
139 printf( "Obj %6d : Type = %6s Fanins = %d : ", iObj, Abc_OperName(Type), Wln_ObjFaninNum(p, iObj) );
140 Wln_ObjForEachFanin( p, iObj, iFanin, k )
141 printf( "%5d ", iFanin );
142 printf( "\n" );
143}
Here is the caller graph for this function:

◆ Wln_ObjSetConst()

void Wln_ObjSetConst ( Wln_Ntk_t * p,
int iObj,
int NameId )
extern

Definition at line 65 of file wlnObj.c.

66{
67 assert( Wln_ObjIsConst(p, iObj) );
68 Wln_ObjSetFanin( p, iObj, 0, NameId );
69}
Here is the caller graph for this function:

◆ Wln_ObjSetSlice()

void Wln_ObjSetSlice ( Wln_Ntk_t * p,
int iObj,
int SliceId )
extern

Definition at line 70 of file wlnObj.c.

71{
72 assert( Wln_ObjIsSlice(p, iObj) );
73 Wln_ObjSetFanin( p, iObj, 1, SliceId );
74}
Here is the caller graph for this function:

◆ Wln_ObjUpdateType()

void Wln_ObjUpdateType ( Wln_Ntk_t * p,
int iObj,
int Type )
extern

Definition at line 58 of file wlnObj.c.

59{
60 assert( Wln_ObjIsNone(p, iObj) );
61 p->nObjs[Wln_ObjType(p, iObj)]--;
62 Vec_IntWriteEntry( &p->vTypes, iObj, Type );
63 p->nObjs[Wln_ObjType(p, iObj)]++;
64}
Here is the caller graph for this function:

◆ Wln_ReadNdr()

Wln_Ntk_t * Wln_ReadNdr ( char * pFileName)
extern

FUNCTION DECLARATIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 298 of file wlnNdr.c.

299{
300 void * pData = Ndr_Read( pFileName );
301 Wln_Ntk_t * pNtk = pData ? Wln_NtkFromNdr( pData, 0 ) : NULL;
302 if ( pNtk ) return NULL;
303 //char * ppNames[10] = { NULL, "a", "b", "c", "d", "e", "f", "g", "h", "i" };
304 //Ndr_WriteVerilog( NULL, pData, ppNames, 0 );
305 Ndr_Delete( pData );
306 return pNtk;
307}
Wln_Ntk_t * Wln_NtkFromNdr(void *pData, int fDump)
Definition wlnNdr.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_WriteNdr()

void Wln_WriteNdr ( Wln_Ntk_t * pNtk,
char * pFileName )
extern

Definition at line 81 of file wlnNdr.c.

82{
83 void * pDesign = Wln_NtkToNdr( p );
84 Ndr_Write( pFileName, pDesign );
85 Ndr_Delete( pDesign );
86 printf( "Dumped the current design into file \"%s\".\n", pFileName );
87}
ABC_NAMESPACE_IMPL_START void * Wln_NtkToNdr(Wln_Ntk_t *p)
DECLARATIONS ///.
Definition wlnNdr.c:45
Here is the call graph for this function:

◆ Wln_WriteVer()

void Wln_WriteVer ( Wln_Ntk_t * p,
char * pFileName )
extern

Definition at line 478 of file wlnWriteVer.c.

479{
480 FILE * pFile;
481 pFile = fopen( pFileName, "w" );
482 if ( pFile == NULL )
483 {
484 fprintf( stdout, "Wln_WriteVer(): Cannot open the output file \"%s\".\n", pFileName );
485 return;
486 }
487 fprintf( pFile, "// Benchmark \"%s\" from file \"%s\" written by ABC on %s\n", p->pName, p->pSpec ? p->pSpec : "unknown", Extra_TimeStamp() );
488 fprintf( pFile, "\n" );
489 Wln_WriteTables( pFile, p );
490// if ( fAddCos )
491// Wln_WriteAddPos( p );
492 Wln_WriteVerInt( pFile, p );
493 fprintf( pFile, "\n" );
494 fclose( pFile );
495}
char * Extra_TimeStamp()
void Wln_WriteTables(FILE *pFile, Wln_Ntk_t *p)
Definition wlnWriteVer.c:64
void Wln_WriteVerInt(FILE *pFile, Wln_Ntk_t *p)
Here is the call graph for this function:
Here is the caller graph for this function: