ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaSplit.c File Reference
#include "gia.h"
#include "misc/extra/extra.h"
Include dependency graph for giaSplit.c:

Go to the source code of this file.

Classes

struct  Spl_Man_t_
 

Typedefs

typedef typedefABC_NAMESPACE_IMPL_START struct Spl_Man_t_ Spl_Man_t
 DECLARATIONS ///.
 

Functions

Vec_Wec_tSpl_ManToWecMapping (Gia_Man_t *p)
 FUNCTION DEFINITIONS ///.
 
Vec_Int_tSpl_ManFromWecMapping (Gia_Man_t *p, Vec_Wec_t *vMap)
 
Spl_Man_tSpl_ManAlloc (Gia_Man_t *pGia, int Limit, int fReverse)
 
void Spl_ManStop (Spl_Man_t *p)
 
void Spl_ManWinFindLeavesRoots (Spl_Man_t *p)
 
void Spl_ManLutFanouts_rec (Gia_Man_t *p, int iObj, Vec_Int_t *vFanouts, Vec_Bit_t *vMarksNo, Vec_Bit_t *vMarksCIO)
 
int Spl_ManLutFanouts (Gia_Man_t *p, int iObj, Vec_Int_t *vFanouts, Vec_Bit_t *vMarksNo, Vec_Bit_t *vMarksCIO)
 
int Spl_ManCountMarkedFanins (Gia_Man_t *p, int iObj, Vec_Bit_t *vMarks)
 
int Spl_ManFindGoodCand (Spl_Man_t *p)
 
int Spl_ManFindOne (Spl_Man_t *p)
 
int Spl_ManLutMffcSize (Gia_Man_t *p, int iObj, Vec_Int_t *vTemp, Vec_Bit_t *vMarksAnd)
 
void Spl_ManAddNode (Spl_Man_t *p, int iPivot, Vec_Int_t *vCands)
 
int Spl_ManComputeOne (Spl_Man_t *p, int iPivot)
 
int Gia_ManComputeOneWin (Gia_Man_t *pGia, int iPivot, Vec_Int_t **pvRoots, Vec_Int_t **pvNodes, Vec_Int_t **pvLeaves, Vec_Int_t **pvAnds)
 
void Gia_ManComputeOneWinStart (Gia_Man_t *pGia, int nAnds, int fReverse)
 
void Spl_ManComputeOneTest (Gia_Man_t *pGia)
 

Typedef Documentation

◆ Spl_Man_t

typedef typedefABC_NAMESPACE_IMPL_START struct Spl_Man_t_ Spl_Man_t

DECLARATIONS ///.

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

FileName [giaSplit.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Structural AIG splitting.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
giaSplit.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 31 of file giaSplit.c.

Function Documentation

◆ Gia_ManComputeOneWin()

int Gia_ManComputeOneWin ( Gia_Man_t * pGia,
int iPivot,
Vec_Int_t ** pvRoots,
Vec_Int_t ** pvNodes,
Vec_Int_t ** pvLeaves,
Vec_Int_t ** pvAnds )

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

Synopsis [External procedures.]

Description []

SideEffects []

SeeAlso []

Definition at line 516 of file giaSplit.c.

517{
518 Spl_Man_t * p = (Spl_Man_t *)pGia->pSatlutWinman;
519 assert( p != NULL );
520 if ( iPivot == -1 )
521 {
522 Spl_ManStop( p );
523 pGia->pSatlutWinman = NULL;
524 return 0;
525 }
526 if ( !Spl_ManComputeOne( p, iPivot ) )
527 {
528 *pvRoots = NULL;
529 *pvNodes = NULL;
530 *pvLeaves = NULL;
531 *pvAnds = NULL;
532 return 0;
533 }
534 *pvRoots = p->vRoots;
535 *pvNodes = p->vNodes;
536 *pvLeaves = p->vLeaves;
537 *pvAnds = p->vAnds;
538 // Vec_IntPrint( p->vNodes );
539 return Vec_IntSize(p->vAnds);
540}
Cube * p
Definition exorList.c:222
typedefABC_NAMESPACE_IMPL_START struct Spl_Man_t_ Spl_Man_t
DECLARATIONS ///.
Definition giaSplit.c:31
int Spl_ManComputeOne(Spl_Man_t *p, int iPivot)
Definition giaSplit.c:461
void Spl_ManStop(Spl_Man_t *p)
Definition giaSplit.c:148
void * pSatlutWinman
Definition gia.h:140
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManComputeOneWinStart()

void Gia_ManComputeOneWinStart ( Gia_Man_t * pGia,
int nAnds,
int fReverse )

Definition at line 541 of file giaSplit.c.

542{
543 assert( pGia->pSatlutWinman == NULL );
544 pGia->pSatlutWinman = Spl_ManAlloc( pGia, nAnds, fReverse );
545}
Spl_Man_t * Spl_ManAlloc(Gia_Man_t *pGia, int Limit, int fReverse)
Definition giaSplit.c:110
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManAddNode()

void Spl_ManAddNode ( Spl_Man_t * p,
int iPivot,
Vec_Int_t * vCands )

Definition at line 452 of file giaSplit.c.

453{
454 int i, iObj;
455 Vec_IntPush( p->vNodes, iPivot );
456 Vec_BitWriteEntry( p->vMarksNo, iPivot, 1 );
457 Vec_IntAppend( p->vAnds, vCands );
458 Vec_IntForEachEntry( vCands, iObj, i )
459 Vec_BitWriteEntry( p->vMarksAnd, iObj, 1 );
460}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Spl_ManAlloc()

Spl_Man_t * Spl_ManAlloc ( Gia_Man_t * pGia,
int Limit,
int fReverse )

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

Synopsis [Creating manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 110 of file giaSplit.c.

111{
112 int i, iObj;
114 p->pGia = pGia;
115 p->Limit = Limit;
116 p->fReverse = fReverse;
117 // intermediate
118 p->vMarksCIO = Vec_BitStart( Gia_ManObjNum(pGia) );
119 p->vMarksIn = Vec_BitStart( Gia_ManObjNum(pGia) );
120 p->vMarksNo = Vec_BitStart( Gia_ManObjNum(pGia) );
121 p->vMarksAnd = Vec_BitStart( Gia_ManObjNum(pGia) );
122 p->vRoots = Vec_IntAlloc( 100 );
123 p->vNodes = Vec_IntAlloc( 100 );
124 p->vLeaves = Vec_IntAlloc( 100 );
125 p->vAnds = Vec_IntAlloc( 100 );
126 // temporary
127 p->vFanouts = Vec_IntAlloc( 100 );
128 p->vCands = Vec_IntAlloc( 100 );
129 p->vInputs = Vec_IntAlloc( 100 );
130 // mark CIs/COs
131 Vec_BitWriteEntry( p->vMarksCIO, 0, 1 );
132 Gia_ManForEachCiId( pGia, iObj, i )
133 Vec_BitWriteEntry( p->vMarksCIO, iObj, 1 );
134 Gia_ManForEachCoId( pGia, iObj, i )
135 Vec_BitWriteEntry( p->vMarksCIO, iObj, 1 );
136 // mapping
137 ABC_FREE( pGia->pRefs );
138 Gia_ManCreateRefs( pGia );
139 Gia_ManSetLutRefs( pGia );
140 assert( Gia_ManHasMapping(pGia) );
141 assert( !Gia_ManHasMapping2(pGia) );
142 pGia->vMapping2 = Spl_ManToWecMapping( pGia );
143 Vec_IntFreeP( &pGia->vMapping );
144 // fanout
146 return p;
147}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
Vec_Wec_t * Spl_ManToWecMapping(Gia_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition giaSplit.c:69
void Gia_ManStaticFanoutStart(Gia_Man_t *p)
Definition giaFanout.c:238
#define Gia_ManForEachCoId(p, Id, i)
Definition gia.h:1240
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition giaUtil.c:779
void Gia_ManSetLutRefs(Gia_Man_t *p)
Definition giaIf.c:295
#define Gia_ManForEachCiId(p, Id, i)
Definition gia.h:1230
Vec_Wec_t * vMapping2
Definition gia.h:137
Vec_Int_t * vMapping
Definition gia.h:136
int * pRefs
Definition gia.h:118
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManComputeOne()

int Spl_ManComputeOne ( Spl_Man_t * p,
int iPivot )

Definition at line 461 of file giaSplit.c.

462{
463 int CountAdd, iObj, i;
464 assert( Gia_ObjIsLut2(p->pGia, iPivot) );
465//Gia_ManPrintCone2( p->pGia, Gia_ManObj(p->pGia, iPivot) );
466 // assume it was previously filled in
467 Vec_IntForEachEntry( p->vNodes, iObj, i )
468 Vec_BitWriteEntry( p->vMarksNo, iObj, 0 );
469 Vec_IntForEachEntry( p->vAnds, iObj, i )
470 Vec_BitWriteEntry( p->vMarksAnd, iObj, 0 );
471 // double check that it is empty
472 //Gia_ManForEachLut2( p->pGia, iObj )
473 // assert( !Vec_BitEntry(p->vMarksNo, iObj) );
474 //Gia_ManForEachLut2( p->pGia, iObj )
475 // assert( !Vec_BitEntry(p->vMarksAnd, iObj) );
476 // clean arrays
477 Vec_IntClear( p->vNodes );
478 Vec_IntClear( p->vAnds );
479 // add root node
480 Spl_ManLutMffcSize( p->pGia, iPivot, p->vCands, p->vMarksAnd );
481 Spl_ManAddNode( p, iPivot, p->vCands );
482 if ( Vec_IntSize(p->vAnds) > p->Limit )
483 return 0;
484 //printf( "%d ", iPivot );
485 // add one node at a time
486 while ( (iObj = Spl_ManFindOne(p)) )
487 {
488 assert( Gia_ObjIsLut2(p->pGia, iObj) );
489 assert( !Vec_BitEntry(p->vMarksNo, iObj) );
490 CountAdd = Spl_ManLutMffcSize( p->pGia, iObj, p->vCands, p->vMarksAnd );
491 if ( Vec_IntSize(p->vAnds) + CountAdd > p->Limit )
492 break;
493 Spl_ManAddNode( p, iObj, p->vCands );
494 //printf( "+%d ", iObj );
495 }
496 //printf( "\n" );
497 Vec_IntSort( p->vNodes, 0 );
498 Vec_IntSort( p->vAnds, 0 );
500 Vec_IntSort( p->vLeaves, 0 );
501 Vec_IntSort( p->vRoots, 0 );
502 return 1;
503}
int Spl_ManLutMffcSize(Gia_Man_t *p, int iObj, Vec_Int_t *vTemp, Vec_Bit_t *vMarksAnd)
Definition giaSplit.c:439
void Spl_ManWinFindLeavesRoots(Spl_Man_t *p)
Definition giaSplit.c:184
void Spl_ManAddNode(Spl_Man_t *p, int iPivot, Vec_Int_t *vCands)
Definition giaSplit.c:452
int Spl_ManFindOne(Spl_Man_t *p)
Definition giaSplit.c:336
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManComputeOneTest()

void Spl_ManComputeOneTest ( Gia_Man_t * pGia)

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

Synopsis [Testing procedure.]

Description []

SideEffects []

SeeAlso []

Definition at line 558 of file giaSplit.c.

559{
560 int iLut, Count;
561 Gia_ManComputeOneWinStart( pGia, 64, 0 );
562 Gia_ManForEachLut2( pGia, iLut )
563 {
564 Vec_Int_t * vRoots, * vNodes, * vLeaves, * vAnds;
565 Count = Gia_ManComputeOneWin( pGia, iLut, &vRoots, &vNodes, &vLeaves, &vAnds );
566 printf( "Obj = %6d : Leaf = %2d. Node = %2d. Root = %2d. AND = %3d.\n",
567 iLut, Vec_IntSize(vLeaves), Vec_IntSize(vNodes), Vec_IntSize(vRoots), Count );
568 }
569 Gia_ManComputeOneWin( pGia, -1, NULL, NULL, NULL, NULL );
570}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Gia_ManComputeOneWinStart(Gia_Man_t *pGia, int nAnds, int fReverse)
Definition giaSplit.c:541
int Gia_ManComputeOneWin(Gia_Man_t *pGia, int iPivot, Vec_Int_t **pvRoots, Vec_Int_t **pvNodes, Vec_Int_t **pvLeaves, Vec_Int_t **pvAnds)
Definition giaSplit.c:516
#define Gia_ManForEachLut2(p, i)
Definition gia.h:1168
Here is the call graph for this function:

◆ Spl_ManCountMarkedFanins()

int Spl_ManCountMarkedFanins ( Gia_Man_t * p,
int iObj,
Vec_Bit_t * vMarks )

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

Synopsis [Returns the number of fanins beloning to the set.]

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file giaSplit.c.

294{
295 int i, iFan, Count = 0;
296 Vec_Int_t * vFanins = Gia_ObjLutFanins2(p, iObj);
297 Vec_IntForEachEntry( vFanins, iFan, i )
298 if ( Vec_BitEntry(vMarks, iFan) )
299 Count++;
300 return Count;
301}
Here is the caller graph for this function:

◆ Spl_ManFindGoodCand()

int Spl_ManFindGoodCand ( Spl_Man_t * p)

Definition at line 302 of file giaSplit.c.

303{
304 int i, iObj;
305 int Res = 0, InCount, InCountMax = -1;
306 // mark leaves
307 Vec_IntForEachEntry( p->vInputs, iObj, i )
308 Vec_BitWriteEntry( p->vMarksIn, iObj, 1 );
309 // find candidate with maximum input overlap
310 Vec_IntForEachEntry( p->vCands, iObj, i )
311 {
312 InCount = Spl_ManCountMarkedFanins( p->pGia, iObj, p->vMarksIn );
313 if ( InCountMax < InCount )
314 {
315 InCountMax = InCount;
316 Res = iObj;
317 }
318 }
319 // unmark leaves
320 Vec_IntForEachEntry( p->vInputs, iObj, i )
321 Vec_BitWriteEntry( p->vMarksIn, iObj, 0 );
322 return Res;
323}
int Spl_ManCountMarkedFanins(Gia_Man_t *p, int iObj, Vec_Bit_t *vMarks)
Definition giaSplit.c:293
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManFindOne()

int Spl_ManFindOne ( Spl_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 336 of file giaSplit.c.

337{
338 Vec_Int_t * vVec;
339 int nFanouts, iObj, iFan, i, k;
340 int Res = 0;
341
342 // deref
343 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
344 Vec_IntForEachEntry( vVec, iFan, k )
345 Gia_ObjLutRefDecId( p->pGia, iFan );
346
347 // collect external nodes
348 if ( p->fReverse && (Vec_IntSize(p->vNodes) & 1) )
349 {
350 Vec_IntForEachEntry( p->vNodes, iObj, i )
351 {
352 if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 0 )
353 continue;
354 assert( Gia_ObjLutRefNumId(p->pGia, iObj) > 0 );
355 if ( Gia_ObjLutRefNumId(p->pGia, iObj) >= 5 ) // skip nodes with high fanout!
356 continue;
357 nFanouts = Spl_ManLutFanouts( p->pGia, iObj, p->vFanouts, p->vMarksNo, p->vMarksCIO );
358 if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 1 && nFanouts == 1 )
359 {
360 Res = Vec_IntEntry(p->vFanouts, 0);
361 goto finish;
362 }
363 //Vec_IntAppend( p->vCands, p->vFanouts );
364 }
365 }
366
367 // consider LUT inputs - get one that has no refs
368 Vec_IntClear( p->vCands );
369 Vec_IntClear( p->vInputs );
370 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
371 Vec_IntForEachEntry( vVec, iFan, k )
372 if ( !Vec_BitEntry(p->vMarksNo, iFan) && !Vec_BitEntry(p->vMarksCIO, iFan) && !Gia_ObjLutRefNumId(p->pGia, iFan) )
373 {
374 Vec_IntPush( p->vCands, iFan );
375 Vec_IntPush( p->vInputs, iFan );
376 }
377 Res = Spl_ManFindGoodCand( p );
378 if ( Res )
379 goto finish;
380
381 // collect candidates
382 Vec_IntClear( p->vCands );
383 Vec_IntClear( p->vInputs );
384 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
385 Vec_IntForEachEntry( vVec, iFan, k )
386 if ( !Vec_BitEntry(p->vMarksNo, iFan) && !Vec_BitEntry(p->vMarksCIO, iFan) )
387 {
388 Vec_IntPush( p->vCands, iFan );
389 Vec_IntPush( p->vInputs, iFan );
390 }
391
392 // all inputs have refs - collect external nodes
393 Vec_IntForEachEntry( p->vNodes, iObj, i )
394 {
395 if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 0 )
396 continue;
397 assert( Gia_ObjLutRefNumId(p->pGia, iObj) > 0 );
398 if ( Gia_ObjLutRefNumId(p->pGia, iObj) >= 5 ) // skip nodes with high fanout!
399 continue;
400 nFanouts = Spl_ManLutFanouts( p->pGia, iObj, p->vFanouts, p->vMarksNo, p->vMarksCIO );
401 if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 1 && nFanouts == 1 )
402 {
403 Res = Vec_IntEntry(p->vFanouts, 0);
404 goto finish;
405 }
406 Vec_IntAppend( p->vCands, p->vFanouts );
407 }
408
409 // choose among not-so-good ones
410 Res = Spl_ManFindGoodCand( p );
411 if ( Res )
412 goto finish;
413
414 // get the first candidate
415 if ( Res == 0 && Vec_IntSize(p->vCands) > 0 )
416 Res = Vec_IntEntry( p->vCands, 0 );
417
418finish:
419 // ref
420 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
421 Vec_IntForEachEntry( vVec, iFan, k )
422 Gia_ObjLutRefIncId( p->pGia, iFan );
423 return Res;
424}
int Spl_ManFindGoodCand(Spl_Man_t *p)
Definition giaSplit.c:302
int Spl_ManLutFanouts(Gia_Man_t *p, int iObj, Vec_Int_t *vFanouts, Vec_Bit_t *vMarksNo, Vec_Bit_t *vMarksCIO)
Definition giaSplit.c:268
#define Gia_ManForEachLut2Vec(vIds, p, vVec, iObj, i)
Definition gia.h:1172
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManFromWecMapping()

Vec_Int_t * Spl_ManFromWecMapping ( Gia_Man_t * p,
Vec_Wec_t * vMap )

Definition at line 79 of file giaSplit.c.

80{
81 Vec_Int_t * vMapping, * vVec; int i, k, Obj;
82 assert( Gia_ManHasMapping2(p) );
83 vMapping = Vec_IntAlloc( Gia_ManObjNum(p) + Vec_WecSizeSize(vMap) + 2*Vec_WecSizeUsed(vMap) );
84 Vec_IntFill( vMapping, Gia_ManObjNum(p), 0 );
85 Vec_WecForEachLevel( vMap, vVec, i )
86 if ( Vec_IntSize(vVec) > 0 )
87 {
88 Vec_IntWriteEntry( vMapping, i, Vec_IntSize(vMapping) );
89 Vec_IntPush( vMapping, Vec_IntSize(vVec) );
90 Vec_IntForEachEntry( vVec, Obj, k )
91 Vec_IntPush( vMapping, Obj );
92 Vec_IntPush( vMapping, i );
93 }
94 assert( Vec_IntSize(vMapping) < 16 || Vec_IntSize(vMapping) == Vec_IntCap(vMapping) );
95 return vMapping;
96}
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecWec.h:55
Here is the caller graph for this function:

◆ Spl_ManLutFanouts()

int Spl_ManLutFanouts ( Gia_Man_t * p,
int iObj,
Vec_Int_t * vFanouts,
Vec_Bit_t * vMarksNo,
Vec_Bit_t * vMarksCIO )

Definition at line 268 of file giaSplit.c.

269{
270 int i, iFanout;
271 assert( Gia_ObjIsLut2(p, iObj) );
272 Vec_IntClear( vFanouts );
273 Gia_ObjForEachFanoutStaticId( p, iObj, iFanout, i )
274 Spl_ManLutFanouts_rec( p, iFanout, vFanouts, vMarksNo, vMarksCIO );
275 // clean up
276 Vec_IntForEachEntry( vFanouts, iFanout, i )
277 Vec_BitWriteEntry( vMarksCIO, iFanout, 0 );
278 return Vec_IntSize(vFanouts);
279}
void Spl_ManLutFanouts_rec(Gia_Man_t *p, int iObj, Vec_Int_t *vFanouts, Vec_Bit_t *vMarksNo, Vec_Bit_t *vMarksCIO)
Definition giaSplit.c:254
#define Gia_ObjForEachFanoutStaticId(p, Id, FanId, i)
Definition gia.h:1127
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManLutFanouts_rec()

void Spl_ManLutFanouts_rec ( Gia_Man_t * p,
int iObj,
Vec_Int_t * vFanouts,
Vec_Bit_t * vMarksNo,
Vec_Bit_t * vMarksCIO )

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

Synopsis [Computes LUTs that are fanouts of the node outside of the cone.]

Description []

SideEffects []

SeeAlso []

Definition at line 254 of file giaSplit.c.

255{
256 int iFanout, i;
257 if ( Vec_BitEntry(vMarksNo, iObj) || Vec_BitEntry(vMarksCIO, iObj) )
258 return;
259 if ( Gia_ObjIsLut2(p, iObj) )
260 {
261 Vec_BitWriteEntry( vMarksCIO, iObj, 1 );
262 Vec_IntPush( vFanouts, iObj );
263 return;
264 }
265 Gia_ObjForEachFanoutStaticId( p, iObj, iFanout, i )
266 Spl_ManLutFanouts_rec( p, iFanout, vFanouts, vMarksNo, vMarksCIO );
267}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManLutMffcSize()

int Spl_ManLutMffcSize ( Gia_Man_t * p,
int iObj,
Vec_Int_t * vTemp,
Vec_Bit_t * vMarksAnd )

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

Synopsis [Computing window for one pivot node.]

Description []

SideEffects []

SeeAlso []

Definition at line 439 of file giaSplit.c.

440{
441 int iTemp, i, k = 0;
442 assert( Gia_ObjIsLut2(p, iObj) );
443//Vec_IntPrint( Gia_ObjLutFanins2(p, iObj) );
445 Gia_ManCollectAnds( p, &iObj, 1, vTemp, Gia_ObjLutFanins2(p, iObj) );
446 Vec_IntForEachEntry( vTemp, iTemp, i )
447 if ( !Vec_BitEntry(vMarksAnd, iTemp) )
448 Vec_IntWriteEntry( vTemp, k++, iTemp );
449 Vec_IntShrink( vTemp, k );
450 return k;
451}
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
void Gia_ManCollectAnds(Gia_Man_t *p, int *pNodes, int nNodes, Vec_Int_t *vNodes, Vec_Int_t *vLeaves)
Definition giaDfs.c:125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManStop()

void Spl_ManStop ( Spl_Man_t * p)

Definition at line 148 of file giaSplit.c.

149{
150 // fanout
151 Gia_ManStaticFanoutStop( p->pGia );
152 // mapping
153 assert( !Gia_ManHasMapping(p->pGia) );
154 assert( Gia_ManHasMapping2(p->pGia) );
155 p->pGia->vMapping = Spl_ManFromWecMapping( p->pGia, p->pGia->vMapping2 );
156 Vec_WecFreeP( &p->pGia->vMapping2 );
157 // intermediate
158 Vec_BitFree( p->vMarksCIO );
159 Vec_BitFree( p->vMarksIn );
160 Vec_BitFree( p->vMarksNo );
161 Vec_BitFree( p->vMarksAnd );
162 Vec_IntFree( p->vRoots );
163 Vec_IntFree( p->vNodes );
164 Vec_IntFree( p->vLeaves );
165 Vec_IntFree( p->vAnds );
166 // temporary
167 Vec_IntFree( p->vFanouts );
168 Vec_IntFree( p->vCands );
169 Vec_IntFree( p->vInputs );
170 ABC_FREE( p );
171}
Vec_Int_t * Spl_ManFromWecMapping(Gia_Man_t *p, Vec_Wec_t *vMap)
Definition giaSplit.c:79
void Gia_ManStaticFanoutStop(Gia_Man_t *p)
Definition giaFanout.c:393
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Spl_ManToWecMapping()

Vec_Wec_t * Spl_ManToWecMapping ( Gia_Man_t * p)

FUNCTION DEFINITIONS ///.

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

Synopsis [Transforming to the internal LUT representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 69 of file giaSplit.c.

70{
71 Vec_Wec_t * vMapping = Vec_WecStart( Gia_ManObjNum(p) );
72 int Obj, Fanin, k;
73 assert( Gia_ManHasMapping(p) );
74 Gia_ManForEachLut( p, Obj )
75 Gia_LutForEachFanin( p, Obj, Fanin, k )
76 Vec_WecPush( vMapping, Obj, Fanin );
77 return vMapping;
78}
#define Gia_ManForEachLut(p, i)
Definition gia.h:1157
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition gia.h:1161
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the caller graph for this function:

◆ Spl_ManWinFindLeavesRoots()

void Spl_ManWinFindLeavesRoots ( Spl_Man_t * p)

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

Synopsis [Takes Nodes and Marks. Returns Leaves and Roots.]

Description []

SideEffects []

SeeAlso []

Definition at line 184 of file giaSplit.c.

185{
186 Vec_Int_t * vVec;
187 int iObj, iFan, i, k;
188 // collect leaves
189/*
190 Vec_IntClear( p->vLeaves );
191 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
192 {
193 assert( Vec_BitEntry(p->vMarksNo, iObj) );
194 Vec_IntForEachEntry( vVec, iFan, k )
195 if ( !Vec_BitEntry(p->vMarksNo, iFan) )
196 {
197 Vec_BitWriteEntry(p->vMarksNo, iFan, 1);
198 Vec_IntPush( p->vLeaves, iFan );
199 }
200 }
201 Vec_IntForEachEntry( p->vLeaves, iFan, i )
202 Vec_BitWriteEntry(p->vMarksNo, iFan, 0);
203*/
204 Vec_IntClear( p->vLeaves );
205 Vec_IntForEachEntry( p->vAnds, iObj, i )
206 {
207 Gia_Obj_t * pObj = Gia_ManObj( p->pGia, iObj );
208 assert( Vec_BitEntry(p->vMarksAnd, iObj) );
209 iFan = Gia_ObjFaninId0( pObj, iObj );
210 if ( !Vec_BitEntry(p->vMarksAnd, iFan) )
211 {
212 assert( Gia_ObjIsLut2(p->pGia, iFan) || Vec_BitEntry(p->vMarksCIO, iFan) );
213 Vec_BitWriteEntry(p->vMarksAnd, iFan, 1);
214 Vec_IntPush( p->vLeaves, iFan );
215 }
216 iFan = Gia_ObjFaninId1( pObj, iObj );
217 if ( !Vec_BitEntry(p->vMarksAnd, iFan) )
218 {
219 assert( Gia_ObjIsLut2(p->pGia, iFan) || Vec_BitEntry(p->vMarksCIO, iFan) );
220 Vec_BitWriteEntry(p->vMarksAnd, iFan, 1);
221 Vec_IntPush( p->vLeaves, iFan );
222 }
223 }
224 Vec_IntForEachEntry( p->vLeaves, iFan, i )
225 Vec_BitWriteEntry(p->vMarksAnd, iFan, 0);
226
227 // collect roots
228 Vec_IntClear( p->vRoots );
229 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
230 Vec_IntForEachEntry( vVec, iFan, k )
231 Gia_ObjLutRefDecId( p->pGia, iFan );
232 Vec_IntForEachEntry( p->vAnds, iObj, i )
233 if ( Gia_ObjLutRefNumId(p->pGia, iObj) )
234 Vec_IntPush( p->vRoots, iObj );
235 Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
236 Vec_IntForEachEntry( vVec, iFan, k )
237 Gia_ObjLutRefIncId( p->pGia, iFan );
238}
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
Here is the caller graph for this function: