ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
wlnNtk.c File Reference
#include "wln.h"
Include dependency graph for wlnNtk.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START 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)
 
int Wln_NtkIsAcyclic_rec (Wln_Ntk_t *p, int iObj)
 
int Wln_NtkIsAcyclic (Wln_Ntk_t *p)
 
void Wln_NtkTransferNames (Wln_Ntk_t *pNew, Wln_Ntk_t *p)
 
int Wln_ObjDup (Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
 
int Wln_NtkDupDfs_rec (Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
 
Wln_Ntk_tWln_NtkDupDfs (Wln_Ntk_t *p)
 
void Wln_NtkCreateRefs (Wln_Ntk_t *p)
 
int Wln_NtkFaninNum (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)
 

Function Documentation

◆ Wln_NtkAlloc()

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

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
Cube * p
Definition exorList.c:222
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)

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)

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_NtkDupDfs_rec()

int Wln_NtkDupDfs_rec ( Wln_Ntk_t * pNew,
Wln_Ntk_t * p,
int iObj )

Definition at line 312 of file wlnNtk.c.

313{
314 int i, iFanin;
315 if ( iObj == 0 )
316 return 0;
317 if ( Wln_ObjCopy(p, iObj) )
318 return Wln_ObjCopy(p, iObj);
319 //printf( "Visiting node %16s (ID %6d) of type %5s (type ID %2d)\n", Wln_ObjName(p, iObj), iObj, Abc_OperName(Wln_ObjType(p, iObj)), Wln_ObjType(p, iObj) );
320 assert( !Wln_ObjIsFf(p, iObj) );
321 Wln_ObjForEachFanin( p, iObj, iFanin, i )
322 Wln_NtkDupDfs_rec( pNew, p, iFanin );
323 return Wln_ObjDup( pNew, p, iObj );
324}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkFaninNum()

int Wln_NtkFaninNum ( Wln_Ntk_t * p)

Definition at line 365 of file wlnNtk.c.

366{
367 int iObj, nEdges = 0;
368 Wln_NtkForEachObj( p, iObj )
369 nEdges += Wln_ObjFaninNum(p, iObj);
370 return nEdges;
371}
Here is the caller graph for this function:

◆ Wln_NtkFree()

void Wln_NtkFree ( Wln_Ntk_t * p)

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}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Abc_NamStop(Abc_Nam_t *p)
Definition utilNam.c:112
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)

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_NtkIsAcyclic_rec()

int Wln_NtkIsAcyclic_rec ( Wln_Ntk_t * p,
int iObj )

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

Synopsis [Detects combinational loops.]

Description [This procedure is based on the idea suggested by Donald Chai. As we traverse the network and visit the nodes, we need to distinquish three types of nodes: (1) those that are visited for the first time, (2) those that have been visited in this traversal but are currently not on the traversal path, (3) those that have been visited and are currently on the travesal path. When the node of type (3) is encountered, it means that there is a combinational loop. To mark the three types of nodes, two new values of the traversal IDs are used.]

SideEffects []

SeeAlso []

Definition at line 152 of file wlnNtk.c.

153{
154 int i, iFanin;
155 //printf( "Visiting node %d\n", iObj );
156 // skip the node if it is already visited
157 if ( Wln_ObjIsTravIdPrevious(p, iObj) )
158 return 1;
159 // check if the node is part of the combinational loop
160 if ( Wln_ObjIsTravIdCurrent(p, iObj) )
161 {
162 fprintf( stdout, "Network contains combinational loop!\n" );
163 fprintf( stdout, "Node %16s is encountered twice on the following path:\n", Wln_ObjName(p, iObj) );
164 fprintf( stdout, "Node %16s (ID %6d) of type %5s (type ID %2d) ->\n",
165 Wln_ObjName(p, iObj), iObj, Abc_OperName(Wln_ObjType(p, iObj)), Wln_ObjType(p, iObj) );
166 return 0;
167 }
168 // mark this node as a node on the current path
169 Wln_ObjSetTravIdCurrent( p, iObj );
170 // quit if it is a CI or constant node
171 if ( Wln_ObjIsCi(p, iObj) || Wln_ObjIsFf(p, iObj) || Wln_ObjFaninNum(p, iObj) == 0 )
172 {
173 // mark this node as a visited node
174 Wln_ObjSetTravIdPrevious( p, iObj );
175 return 1;
176 }
177 // traverse the fanin's cone searching for the loop
178 Wln_ObjForEachFanin( p, iObj, iFanin, i )
179 {
180 if ( !Wln_NtkIsAcyclic_rec(p, iFanin) )
181 {
182 // return as soon as the loop is detected
183 fprintf( stdout, "Node %16s (ID %6d) of type %5s (type ID %2d) ->\n",
184 Wln_ObjName(p, iObj), iObj, Abc_OperName(Wln_ObjType(p, iObj)), Wln_ObjType(p, iObj) );
185 return 0;
186 }
187 }
188 // mark this node as a visited node
189 Wln_ObjSetTravIdPrevious( p, iObj );
190 return 1;
191}
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)

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)

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_NtkStartFaninMap()

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

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 )

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)

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
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
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)

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)

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_NtkTransferNames()

void Wln_NtkTransferNames ( Wln_Ntk_t * pNew,
Wln_Ntk_t * p )

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

Synopsis [Duplicating network.]

Description []

SideEffects []

SeeAlso []

Definition at line 273 of file wlnNtk.c.

274{
275 assert( pNew->pManName == NULL && p->pManName != NULL );
276 pNew->pManName = p->pManName;
277 p->pManName = NULL;
278 assert( !Wln_NtkHasCopy(pNew) && Wln_NtkHasCopy(p) );
279 if ( Wln_NtkHasNameId(p) )
280 {
281 int i;
282 assert( !Wln_NtkHasNameId(pNew) && Wln_NtkHasNameId(p) );
283 Wln_NtkCleanNameId( pNew );
284 Wln_NtkForEachObj( p, i )
285 if ( Wln_ObjCopy(p, i) && i < Vec_IntSize(&p->vNameIds) && Wln_ObjNameId(p, i) )
286 Wln_ObjSetNameId( pNew, Wln_ObjCopy(p, i), Wln_ObjNameId(p, i) );
287 Vec_IntErase( &p->vNameIds );
288 }
289 if ( Wln_NtkHasInstId(p) )
290 {
291 int i;
292 assert( !Wln_NtkHasInstId(pNew) && Wln_NtkHasInstId(p) );
293 Wln_NtkCleanInstId( pNew );
294 Wln_NtkForEachObj( p, i )
295 if ( Wln_ObjCopy(p, i) && i < Vec_IntSize(&p->vInstIds) && Wln_ObjInstId(p, i) )
296 Wln_ObjSetInstId( pNew, Wln_ObjCopy(p, i), Wln_ObjInstId(p, i) );
297 Vec_IntErase( &p->vInstIds );
298 }
299}
Abc_Nam_t * pManName
Definition wln.h:70
Here is the caller graph for this function:

◆ Wln_ObjDup()

int Wln_ObjDup ( Wln_Ntk_t * pNew,
Wln_Ntk_t * p,
int iObj )

Definition at line 300 of file wlnNtk.c.

301{
302 int i, iFanin, iObjNew = Wln_ObjClone( pNew, p, iObj );
303 Wln_ObjForEachFanin( p, iObj, iFanin, i )
304 Wln_ObjAddFanin( pNew, iObjNew, Wln_ObjCopy(p, iFanin) );
305 if ( Wln_ObjIsConst(p, iObj) )
306 Wln_ObjSetConst( pNew, iObjNew, Wln_ObjFanin0(p, iObj) );
307 else if ( Wln_ObjIsSlice(p, iObj) || Wln_ObjIsRotate(p, iObj) || Wln_ObjIsTable(p, iObj) )
308 Wln_ObjSetFanin( pNew, iObjNew, 1, Wln_ObjFanin1(p, iObj) );
309 Wln_ObjSetCopy( p, iObj, iObjNew );
310 return iObjNew;
311}
void Wln_ObjSetConst(Wln_Ntk_t *p, int iObj, int NameId)
Definition wlnObj.c:65
Here is the call graph for this function:
Here is the caller graph for this function: