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

Go to the source code of this file.

Classes

struct  Frc_Obj_t_
 
struct  Frc_Man_t_
 

Macros

#define Frc_ManForEachObj(p, pObj, i)
 
#define Frc_ManForEachObjVec(vVec, p, pObj, i)
 
#define Frc_ManForEachNode(p, pObj, i)
 
#define Frc_ManForEachCi(p, pObj, i)
 
#define Frc_ManForEachCo(p, pObj, i)
 
#define Frc_ObjForEachFanin(pObj, pNext, i)
 
#define Frc_ObjForEachFaninReverse(pObj, pNext, i)
 
#define Frc_ObjForEachFanout(pObj, pNext, i)
 

Typedefs

typedef typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
 DECLARATIONS ///.
 
typedef struct Frc_Man_t_ Frc_Man_t
 

Functions

void Frc_ObjAddFanin (Frc_Obj_t *pObj, Frc_Obj_t *pFanin)
 FUNCTION DEFINITIONS ///.
 
Frc_Man_tFrc_ManStartSimple (Gia_Man_t *pGia)
 
void Frc_ManCollectSuper_rec (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
 
void Frc_ManCollectSuper (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
 
void Frc_ManCreateRefsSpecial (Gia_Man_t *p)
 
void Frc_ManTransformRefs (Gia_Man_t *p, int *pnObjs, int *pnFanios)
 
Frc_Man_tFrc_ManStart (Gia_Man_t *pGia)
 
void Frc_ManPrintStats (Frc_Man_t *p)
 
void Frc_ManStop (Frc_Man_t *p)
 
int Frc_ManCrossCut_rec (Frc_Man_t *p, Frc_Obj_t *pObj)
 
int Frc_ManCrossCut2_rec (Frc_Man_t *p, Frc_Obj_t *pObj)
 
int Frc_ManCrossCut (Frc_Man_t *p, Vec_Int_t *vOrder, int fReverse)
 
Vec_Int_tFrc_ManCollectCos (Frc_Man_t *p)
 
void Frc_ManCrossCutTest (Frc_Man_t *p, Vec_Int_t *vOrderInit)
 
void Frc_ManPlaceRandom (Frc_Man_t *p)
 
void Frc_ManArrayShuffle (Vec_Int_t *vArray)
 
void Frc_ManPlaceDfs_rec (Frc_Man_t *p, Frc_Obj_t *pObj, int *piPlace)
 
void Frc_ManPlaceDfs (Frc_Man_t *p, Vec_Int_t *vCoOrder)
 
int Frc_ManPlaceDfsBoth (Frc_Man_t *p, Vec_Int_t *vCoOrder, int *piCutSize2)
 
void Frc_ManPlacementRefine (Frc_Man_t *p, int nIters, int fVerbose)
 
int Frc_ObjFanoutsAreCos (Frc_Obj_t *pThis)
 
void Frc_DumpGraphIntoFile (Frc_Man_t *p)
 
void For_ManExperiment (Gia_Man_t *pGia, int nIters, int fClustered, int fVerbose)
 
void For_ManFileExperiment ()
 

Macro Definition Documentation

◆ Frc_ManForEachCi

#define Frc_ManForEachCi ( p,
pObj,
i )
Value:
for ( i = 0; (i < Vec_IntSize(p->vCis)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCis,i))); i++ )
Cube * p
Definition exorList.c:222

Definition at line 103 of file giaForce.c.

103#define Frc_ManForEachCi( p, pObj, i ) \
104 for ( i = 0; (i < Vec_IntSize(p->vCis)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCis,i))); i++ )

◆ Frc_ManForEachCo

#define Frc_ManForEachCo ( p,
pObj,
i )
Value:
for ( i = 0; (i < Vec_IntSize(p->vCos)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCos,i))); i++ )

Definition at line 105 of file giaForce.c.

105#define Frc_ManForEachCo( p, pObj, i ) \
106 for ( i = 0; (i < Vec_IntSize(p->vCos)) && (pObj = Frc_ManObj(p,Vec_IntEntry(p->vCos,i))); i++ )

◆ Frc_ManForEachNode

#define Frc_ManForEachNode ( p,
pObj,
i )
Value:
for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) ) if ( Frc_ObjIsTerm(pObj) ) {} else

Definition at line 101 of file giaForce.c.

101#define Frc_ManForEachNode( p, pObj, i ) \
102 for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) ) if ( Frc_ObjIsTerm(pObj) ) {} else

◆ Frc_ManForEachObj

#define Frc_ManForEachObj ( p,
pObj,
i )
Value:
for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) )

Definition at line 96 of file giaForce.c.

96#define Frc_ManForEachObj( p, pObj, i ) \
97 for ( i = 0; (i < p->nObjData) && (pObj = Frc_ManObj(p,i)); i += Frc_ObjSize(pObj) )

◆ Frc_ManForEachObjVec

#define Frc_ManForEachObjVec ( vVec,
p,
pObj,
i )
Value:
for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Frc_ManObj(p, Vec_IntEntry(vVec,i))); i++ )

Definition at line 98 of file giaForce.c.

98#define Frc_ManForEachObjVec( vVec, p, pObj, i ) \
99 for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Frc_ManObj(p, Vec_IntEntry(vVec,i))); i++ )

◆ Frc_ObjForEachFanin

#define Frc_ObjForEachFanin ( pObj,
pNext,
i )
Value:
for ( i = 0; (i < (int)pObj->nFanins) && (pNext = Frc_ObjFanin(pObj,i)); i++ )

Definition at line 108 of file giaForce.c.

108#define Frc_ObjForEachFanin( pObj, pNext, i ) \
109 for ( i = 0; (i < (int)pObj->nFanins) && (pNext = Frc_ObjFanin(pObj,i)); i++ )

◆ Frc_ObjForEachFaninReverse

#define Frc_ObjForEachFaninReverse ( pObj,
pNext,
i )
Value:
for ( i = (int)pObj->nFanins - 1; (i >= 0) && (pNext = Frc_ObjFanin(pObj,i)); i-- )

Definition at line 110 of file giaForce.c.

110#define Frc_ObjForEachFaninReverse( pObj, pNext, i ) \
111 for ( i = (int)pObj->nFanins - 1; (i >= 0) && (pNext = Frc_ObjFanin(pObj,i)); i-- )

◆ Frc_ObjForEachFanout

#define Frc_ObjForEachFanout ( pObj,
pNext,
i )
Value:
for ( i = 0; (i < (int)pObj->nFanouts) && (pNext = Frc_ObjFanout(pObj,i)); i++ )

Definition at line 112 of file giaForce.c.

112#define Frc_ObjForEachFanout( pObj, pNext, i ) \
113 for ( i = 0; (i < (int)pObj->nFanouts) && (pNext = Frc_ObjFanout(pObj,i)); i++ )

Typedef Documentation

◆ Frc_Man_t

typedef struct Frc_Man_t_ Frc_Man_t

Definition at line 55 of file giaForce.c.

◆ Frc_Obj_t

typedef typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t

DECLARATIONS ///.

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

FileName [gia.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 36 of file giaForce.c.

Function Documentation

◆ For_ManExperiment()

void For_ManExperiment ( Gia_Man_t * pGia,
int nIters,
int fClustered,
int fVerbose )

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

Synopsis [Experiment with the FORCE algorithm.]

Description []

SideEffects []

SeeAlso []

Definition at line 1039 of file giaForce.c.

1040{
1041 Frc_Man_t * p;
1042 Gia_ManRandom( 1 );
1043 if ( fClustered )
1044 p = Frc_ManStart( pGia );
1045 else
1046 p = Frc_ManStartSimple( pGia );
1047// Frc_DumpGraphIntoFile( p );
1048 if ( fVerbose )
1050// Frc_ManCrossCutTest( p, NULL );
1051 Frc_ManPlacementRefine( p, nIters, fVerbose );
1052 Frc_ManStop( p );
1053}
Frc_Man_t * Frc_ManStartSimple(Gia_Man_t *pGia)
Definition giaForce.c:150
void Frc_ManStop(Frc_Man_t *p)
Definition giaForce.c:584
Frc_Man_t * Frc_ManStart(Gia_Man_t *pGia)
Definition giaForce.c:428
struct Frc_Man_t_ Frc_Man_t
Definition giaForce.c:55
void Frc_ManPrintStats(Frc_Man_t *p)
Definition giaForce.c:557
void Frc_ManPlacementRefine(Frc_Man_t *p, int nIters, int fVerbose)
Definition giaForce.c:886
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition giaUtil.c:49
Here is the call graph for this function:

◆ For_ManFileExperiment()

void For_ManFileExperiment ( )

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

Synopsis [Experiment with the FORCE algorithm.]

Description []

SideEffects []

SeeAlso []

Definition at line 1066 of file giaForce.c.

1067{
1068 FILE * pFile;
1069 int * pBuffer;
1070 int i, Size, Exp = 25;
1071 abctime clk = Abc_Clock();
1072 int RetValue;
1073
1074 Size = (1 << Exp);
1075 printf( "2^%d machine words (%d bytes).\n", Exp, (int)sizeof(int) * Size );
1076
1077 pBuffer = ABC_ALLOC( int, Size );
1078 for ( i = 0; i < Size; i++ )
1079 pBuffer[i] = i;
1080ABC_PRT( "Fillup", Abc_Clock() - clk );
1081
1082clk = Abc_Clock();
1083 pFile = fopen( "test.txt", "rb" );
1084 RetValue = fread( pBuffer, 1, sizeof(int) * Size, pFile );
1085 fclose( pFile );
1086ABC_PRT( "Read ", Abc_Clock() - clk );
1087
1088clk = Abc_Clock();
1089 pFile = fopen( "test.txt", "wb" );
1090 fwrite( pBuffer, 1, sizeof(int) * Size, pFile );
1091 fclose( pFile );
1092ABC_PRT( "Write ", Abc_Clock() - clk );
1093/*
10942^25 machine words (134217728 bytes).
1095Fillup = 0.06 sec
1096Read = 0.08 sec
1097Write = 1.81 sec
1098*/
1099}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
#define ABC_ALLOC(type, num)
Definition abc_global.h:264

◆ Frc_DumpGraphIntoFile()

void Frc_DumpGraphIntoFile ( Frc_Man_t * p)

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

Synopsis [Computes the distances from the given set of objects.]

Description [Returns one of the most distant objects.]

SideEffects []

SeeAlso []

Definition at line 1002 of file giaForce.c.

1003{
1004 FILE * pFile;
1005 Frc_Obj_t * pThis, * pNext;
1006 int i, k, Counter = 0;
1007 // assign numbers to CIs and internal nodes
1008 Frc_ManForEachObj( p, pThis, i )
1009 {
1010 if ( i && ((Frc_ObjIsCi(pThis) && !Frc_ObjFanoutsAreCos(pThis)) || Frc_ObjIsNode(pThis)) )
1011 pThis->iFanin = Counter++;
1012 else
1013 pThis->iFanin = ~0;
1014 }
1015 // assign numbers to all other nodes
1016 pFile = fopen( "x\\large\\aig\\dg1.g", "w" );
1017 Frc_ManForEachObj( p, pThis, i )
1018 {
1019 Frc_ObjForEachFanout( pThis, pNext, k )
1020 {
1021 if ( ~pThis->iFanin && ~pNext->iFanin )
1022 fprintf( pFile, "%d %d\n", pThis->iFanin, pNext->iFanin );
1023 }
1024 }
1025 fclose( pFile );
1026}
#define Frc_ManForEachObj(p, pObj, i)
Definition giaForce.c:96
int Frc_ObjFanoutsAreCos(Frc_Obj_t *pThis)
Definition giaForce.c:981
#define Frc_ObjForEachFanout(pObj, pNext, i)
Definition giaForce.c:112
typedefABC_NAMESPACE_IMPL_START struct Frc_Obj_t_ Frc_Obj_t
DECLARATIONS ///.
Definition giaForce.c:36
Here is the call graph for this function:

◆ Frc_ManArrayShuffle()

void Frc_ManArrayShuffle ( Vec_Int_t * vArray)

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

Synopsis [Shuffles array of random integers.]

Description []

SideEffects []

SeeAlso []

Definition at line 775 of file giaForce.c.

776{
777 int i, iNext, Temp;
778 for ( i = 0; i < vArray->nSize; i++ )
779 {
780 iNext = Gia_ManRandom( 0 ) % vArray->nSize;
781 Temp = vArray->pArray[i];
782 vArray->pArray[i] = vArray->pArray[iNext];
783 vArray->pArray[iNext] = Temp;
784 }
785}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCollectCos()

Vec_Int_t * Frc_ManCollectCos ( Frc_Man_t * p)

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

Synopsis [Collects CO handles.]

Description []

SideEffects []

SeeAlso []

Definition at line 692 of file giaForce.c.

693{
694 Vec_Int_t * vCoOrder;
695 Frc_Obj_t * pObj;
696 int i;
697 vCoOrder = Vec_IntAlloc( Frc_ManCoNum(p) );
698 Frc_ManForEachCo( p, pObj, i )
699 Vec_IntPush( vCoOrder, pObj->hHandle );
700 return vCoOrder;
701}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
#define Frc_ManForEachCo(p, pObj, i)
Definition giaForce.c:105
Here is the caller graph for this function:

◆ Frc_ManCollectSuper()

void Frc_ManCollectSuper ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vSuper,
Vec_Int_t * vVisit )

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

Synopsis [Collect the fanin IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 289 of file giaForce.c.

290{
291 int Entry, i;
292 Vec_IntClear( vSuper );
293 Vec_IntClear( vVisit );
294 assert( pObj->fMark0 == 1 );
295 pObj->fMark0 = 0;
296 Frc_ManCollectSuper_rec( p, pObj, vSuper, vVisit );
297 pObj->fMark0 = 1;
298 Vec_IntForEachEntry( vVisit, Entry, i )
299 Gia_ManObj(p, Entry)->fMark1 = 0;
300}
void Frc_ManCollectSuper_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
Definition giaForce.c:261
unsigned fMark0
Definition gia.h:81
#define assert(ex)
Definition util_old.h:213
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCollectSuper_rec()

void Frc_ManCollectSuper_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vSuper,
Vec_Int_t * vVisit )

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

Synopsis [Collect the fanin IDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 261 of file giaForce.c.

262{
263 if ( pObj->fMark1 )
264 return;
265 pObj->fMark1 = 1;
266 Vec_IntPush( vVisit, Gia_ObjId(p, pObj) );
267 if ( pObj->fMark0 )
268 {
269 Vec_IntPush( vSuper, Gia_ObjId(p, pObj) );
270 return;
271 }
272 assert( Gia_ObjIsAnd(pObj) );
273 Frc_ManCollectSuper_rec( p, Gia_ObjFanin0(pObj), vSuper, vVisit );
274 Frc_ManCollectSuper_rec( p, Gia_ObjFanin1(pObj), vSuper, vVisit );
275
276}
unsigned fMark1
Definition gia.h:86
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCreateRefsSpecial()

void Frc_ManCreateRefsSpecial ( Gia_Man_t * p)

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

Synopsis [Assigns references while removing the MUX/XOR ones.]

Description []

SideEffects []

SeeAlso []

Definition at line 313 of file giaForce.c.

314{
315 Gia_Obj_t * pObj, * pFan0, * pFan1;
316 Gia_Obj_t * pObjC, * pObjD0, * pObjD1;
317 int i;
318 assert( p->pRefs == NULL );
321 Gia_ManForEachAnd( p, pObj, i )
322 {
323 assert( pObj->fMark0 == 0 );
324 pFan0 = Gia_ObjFanin0(pObj);
325 pFan1 = Gia_ObjFanin1(pObj);
326 // skip nodes whose fanins are PIs or are already marked
327 if ( Gia_ObjIsCi(pFan0) || pFan0->fMark0 ||
328 Gia_ObjIsCi(pFan1) || pFan1->fMark0 )
329 continue;
330 // skip nodes that are not MUX type
331 if ( !Gia_ObjIsMuxType(pObj) )
332 continue;
333 // the node is MUX type, mark it and its fanins
334 pObj->fMark0 = 1;
335 pFan0->fMark0 = 1;
336 pFan1->fMark0 = 1;
337 // deref the control
338 pObjC = Gia_ObjRecognizeMux( pObj, &pObjD1, &pObjD0 );
339 Gia_ObjRefDec( p, Gia_Regular(pObjC) );
340 if ( Gia_Regular(pObjD0) == Gia_Regular(pObjD1) )
341 Gia_ObjRefDec( p, Gia_Regular(pObjD0) );
342 }
343 Gia_ManForEachAnd( p, pObj, i )
344 assert( Gia_ObjRefNum(p, pObj) > 0 );
346}
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
Definition giaUtil.c:1056
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
Definition giaUtil.c:982
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition giaUtil.c:256
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition giaUtil.c:779
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCrossCut()

int Frc_ManCrossCut ( Frc_Man_t * p,
Vec_Int_t * vOrder,
int fReverse )

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 658 of file giaForce.c.

659{
660 Frc_Obj_t * pObj;
661 int i;
662 assert( Vec_IntSize(vOrder) == Frc_ManCoNum(p) );
663 p->nCutCur = 0;
664 p->nCutMax = 0;
665 Frc_ManForEachObj( p, pObj, i )
666 pObj->iFanout = pObj->nFanouts;
667 Frc_ManForEachObjVec( vOrder, p, pObj, i )
668 {
669 assert( Frc_ObjIsCo(pObj) );
670 if ( fReverse )
671 p->nCutCur -= Frc_ManCrossCut2_rec( p, Frc_ObjFanin(pObj,0) );
672 else
673 p->nCutCur -= Frc_ManCrossCut_rec( p, Frc_ObjFanin(pObj,0) );
674 }
675 assert( p->nCutCur == 0 );
676// Frc_ManForEachObj( p, pObj, i )
677// assert( pObj->iFanout == 0 );
678 return p->nCutMax;
679}
#define Frc_ManForEachObjVec(vVec, p, pObj, i)
Definition giaForce.c:98
int Frc_ManCrossCut_rec(Frc_Man_t *p, Frc_Obj_t *pObj)
Definition giaForce.c:604
int Frc_ManCrossCut2_rec(Frc_Man_t *p, Frc_Obj_t *pObj)
Definition giaForce.c:631
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCrossCut2_rec()

int Frc_ManCrossCut2_rec ( Frc_Man_t * p,
Frc_Obj_t * pObj )

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 631 of file giaForce.c.

632{
633 assert( pObj->iFanout > 0 );
634 if ( pObj->iFanout-- == pObj->nFanouts )
635 {
636 Frc_Obj_t * pFanin;
637 int i;
638 p->nCutCur++;
639 p->nCutMax = Abc_MaxInt( p->nCutMax, p->nCutCur );
640 if ( !Frc_ObjIsCi(pObj) )
641 Frc_ObjForEachFaninReverse( pObj, pFanin, i )
642 p->nCutCur -= Frc_ManCrossCut2_rec( p, pFanin );
643 }
644 return pObj->iFanout == 0;
645}
#define Frc_ObjForEachFaninReverse(pObj, pNext, i)
Definition giaForce.c:110
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCrossCut_rec()

int Frc_ManCrossCut_rec ( Frc_Man_t * p,
Frc_Obj_t * pObj )

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 604 of file giaForce.c.

605{
606 assert( pObj->iFanout > 0 );
607 if ( pObj->iFanout-- == pObj->nFanouts )
608 {
609 Frc_Obj_t * pFanin;
610 int i;
611 p->nCutCur++;
612 p->nCutMax = Abc_MaxInt( p->nCutMax, p->nCutCur );
613 if ( !Frc_ObjIsCi(pObj) )
614 Frc_ObjForEachFanin( pObj, pFanin, i )
615 p->nCutCur -= Frc_ManCrossCut_rec( p, pFanin );
616 }
617 return pObj->iFanout == 0;
618}
#define Frc_ObjForEachFanin(pObj, pNext, i)
Definition giaForce.c:108
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManCrossCutTest()

void Frc_ManCrossCutTest ( Frc_Man_t * p,
Vec_Int_t * vOrderInit )

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 714 of file giaForce.c.

715{
716 Vec_Int_t * vOrder;
717// abctime clk = Abc_Clock();
718 vOrder = vOrderInit? vOrderInit : Frc_ManCollectCos( p );
719 printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 0 ) );
720 printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 1 ) );
721 Vec_IntReverseOrder( vOrder );
722 printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 0 ) );
723 printf( "CrossCut = %6d\n", Frc_ManCrossCut( p, vOrder, 1 ) );
724 Vec_IntReverseOrder( vOrder );
725 if ( vOrder != vOrderInit )
726 Vec_IntFree( vOrder );
727// ABC_PRT( "Time", Abc_Clock() - clk );
728}
Vec_Int_t * Frc_ManCollectCos(Frc_Man_t *p)
Definition giaForce.c:692
int Frc_ManCrossCut(Frc_Man_t *p, Vec_Int_t *vOrder, int fReverse)
Definition giaForce.c:658
Here is the call graph for this function:

◆ Frc_ManPlaceDfs()

void Frc_ManPlaceDfs ( Frc_Man_t * p,
Vec_Int_t * vCoOrder )

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

Synopsis [Generates DFS placement.]

Description []

SideEffects []

SeeAlso []

Definition at line 823 of file giaForce.c.

824{
825 Frc_Obj_t * pObj;
826 int i, nPlaces = 0;
827 Frc_ManForEachObj( p, pObj, i )
828 {
829 pObj->iFanout = pObj->nFanouts;
830 if ( pObj->nFanouts == 0 && !Frc_ObjIsCo(pObj) )
831 pObj->pPlace = nPlaces++;
832 }
833 Frc_ManForEachObjVec( vCoOrder, p, pObj, i )
834 {
835 assert( Frc_ObjIsCo(pObj) );
836 Frc_ManPlaceDfs_rec( p, Frc_ObjFanin(pObj,0), &nPlaces );
837 pObj->pPlace = nPlaces++;
838 }
839 assert( nPlaces == p->nObjs );
840}
void Frc_ManPlaceDfs_rec(Frc_Man_t *p, Frc_Obj_t *pObj, int *piPlace)
Definition giaForce.c:798
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManPlaceDfs_rec()

void Frc_ManPlaceDfs_rec ( Frc_Man_t * p,
Frc_Obj_t * pObj,
int * piPlace )

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

Synopsis [Computes cross cut size for the given order of POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 798 of file giaForce.c.

799{
800 assert( pObj->iFanout > 0 );
801 if ( pObj->iFanout-- == pObj->nFanouts )
802 {
803 Frc_Obj_t * pFanin;
804 int i;
805 if ( !Frc_ObjIsCi(pObj) )
806 Frc_ObjForEachFanin( pObj, pFanin, i )
807 Frc_ManPlaceDfs_rec( p, pFanin, piPlace );
808 pObj->pPlace = (*piPlace)++;
809 }
810}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManPlaceDfsBoth()

int Frc_ManPlaceDfsBoth ( Frc_Man_t * p,
Vec_Int_t * vCoOrder,
int * piCutSize2 )

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

Synopsis [Generates DFS placement by trying both orders.]

Description [Returns the cross cut size of the best order. ]

SideEffects []

SeeAlso []

Definition at line 853 of file giaForce.c.

854{
855 int nCutStart1, nCutStart2;
856 nCutStart1 = Frc_ManCrossCut( p, vCoOrder, 0 );
857 Vec_IntReverseOrder( vCoOrder );
858 nCutStart2 = Frc_ManCrossCut( p, vCoOrder, 0 );
859 if ( nCutStart1 <= nCutStart2 )
860 {
861 Vec_IntReverseOrder( vCoOrder ); // undo
862 Frc_ManPlaceDfs( p, vCoOrder );
863 *piCutSize2 = nCutStart2;
864 return nCutStart1;
865 }
866 else
867 {
868 Frc_ManPlaceDfs( p, vCoOrder );
869 Vec_IntReverseOrder( vCoOrder ); // undo
870 *piCutSize2 = nCutStart1;
871 return nCutStart2;
872 }
873}
void Frc_ManPlaceDfs(Frc_Man_t *p, Vec_Int_t *vCoOrder)
Definition giaForce.c:823
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManPlacementRefine()

void Frc_ManPlacementRefine ( Frc_Man_t * p,
int nIters,
int fVerbose )

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

Synopsis [Performs iterative refinement of the given placement.]

Description []

SideEffects []

SeeAlso []

Definition at line 886 of file giaForce.c.

887{
888 int fRandomize = 0;
889 Vec_Int_t * vCoOrder;
890 Frc_Obj_t * pThis, * pNext;
891 double CostThis, CostPrev;
892 float * pVertX, VertX;
893 int * pPermX, * pHandles;
894 int k, h, Iter, iMinX, iMaxX, Counter, nCutStart, nCutCur, nCutCur2, nCutPrev;
895 abctime clk = Abc_Clock(), clk2, clk2Total = 0;
896 // create starting one-dimensional placement
897 vCoOrder = Frc_ManCollectCos( p );
898 if ( fRandomize )
899 Frc_ManArrayShuffle( vCoOrder );
900 nCutStart = Frc_ManPlaceDfsBoth( p, vCoOrder, &nCutCur2 );
901 // refine placement
902 CostPrev = 0.0;
903 nCutPrev = nCutStart;
904 pHandles = ABC_ALLOC( int, p->nObjs );
905 pVertX = ABC_ALLOC( float, p->nObjs );
906 for ( Iter = 0; Iter < nIters; Iter++ )
907 {
908 // compute centers of hyperedges
909 CostThis = 0.0;
910 Frc_ManForEachObj( p, pThis, h )
911 {
912 iMinX = iMaxX = pThis->pPlace;
913 Frc_ObjForEachFanout( pThis, pNext, k )
914 {
915 iMinX = Abc_MinInt( iMinX, pNext->pPlace );
916 iMaxX = Abc_MaxInt( iMaxX, pNext->pPlace );
917 }
918 pThis->fEdgeCenter = 0.5 * (iMaxX + iMinX);
919 CostThis += (iMaxX - iMinX);
920 }
921 // compute new centers of objects
922 Counter = 0;
923 Frc_ManForEachObj( p, pThis, h )
924 {
925 VertX = pThis->fEdgeCenter;
926 Frc_ObjForEachFanin( pThis, pNext, k )
927 VertX += pNext->fEdgeCenter;
928 pVertX[Counter] = VertX / (Frc_ObjFaninNum(pThis) + 1);
929 pHandles[Counter++] = h;
930 }
931 assert( Counter == Frc_ManObjNum(p) );
932 // sort these numbers
933 clk2 = Abc_Clock();
934 pPermX = Gia_SortFloats( pVertX, pHandles, p->nObjs );
935 clk2Total += Abc_Clock() - clk2;
936 assert( pPermX == pHandles );
937 Vec_IntClear( vCoOrder );
938 for ( k = 0; k < p->nObjs; k++ )
939 {
940 pThis = Frc_ManObj( p, pPermX[k] );
941 pThis->pPlace = k;
942 if ( Frc_ObjIsCo(pThis) )
943 Vec_IntPush( vCoOrder, pThis->hHandle );
944 }
945/*
946 printf( "Ordering of PIs:\n" );
947 Frc_ManForEachCi( p, pThis, k )
948 printf( "PI number = %7d. Object handle = %7d, Coordinate = %7d.\n",
949 k, pThis->hHandle, pThis->pPlace );
950*/
951 nCutCur = Frc_ManPlaceDfsBoth( p, vCoOrder, &nCutCur2 );
952 // evaluate cost
953 if ( fVerbose )
954 {
955 printf( "%2d : Span = %e ", Iter+1, CostThis );
956 printf( "Cut = %6d (%5.2f %%) CutR = %6d ", nCutCur, 100.0*(nCutStart-nCutCur)/nCutStart, nCutCur2 );
957 ABC_PRTn( "Total", Abc_Clock() - clk );
958 ABC_PRT( "Sort", clk2Total );
959// Frc_ManCrossCutTest( p, vCoOrder );
960 }
961// if ( 1.0 * nCutPrev / nCutCur < 1.001 )
962// break;
963 nCutPrev = nCutCur;
964 }
965 ABC_FREE( pHandles );
966 ABC_FREE( pVertX );
967 Vec_IntFree( vCoOrder );
968}
#define ABC_PRTn(a, t)
Definition abc_global.h:257
#define ABC_FREE(obj)
Definition abc_global.h:267
int Frc_ManPlaceDfsBoth(Frc_Man_t *p, Vec_Int_t *vCoOrder, int *piCutSize2)
Definition giaForce.c:853
void Frc_ManArrayShuffle(Vec_Int_t *vArray)
Definition giaForce.c:775
int * Gia_SortFloats(float *pArray, int *pPerm, int nSize)
Definition giaSort.c:251
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManPlaceRandom()

void Frc_ManPlaceRandom ( Frc_Man_t * p)

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

Synopsis [Generates random placement.]

Description []

SideEffects []

SeeAlso []

Definition at line 743 of file giaForce.c.

744{
745 Frc_Obj_t * pThis;
746 int * pPlacement;
747 int i, h, Temp, iNext, Counter;
748 pPlacement = ABC_ALLOC( int, p->nObjs );
749 for ( i = 0; i < p->nObjs; i++ )
750 pPlacement[i] = i;
751 for ( i = 0; i < p->nObjs; i++ )
752 {
753 iNext = Gia_ManRandom( 0 ) % p->nObjs;
754 Temp = pPlacement[i];
755 pPlacement[i] = pPlacement[iNext];
756 pPlacement[iNext] = Temp;
757 }
758 Counter = 0;
759 Frc_ManForEachObj( p, pThis, h )
760 pThis->pPlace = pPlacement[Counter++];
761 ABC_FREE( pPlacement );
762}
Here is the call graph for this function:

◆ Frc_ManPrintStats()

void Frc_ManPrintStats ( Frc_Man_t * p)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 557 of file giaForce.c.

558{
559// if ( p->pName )
560// printf( "%8s : ", p->pName );
561 printf( "i/o =%7d/%7d ", Frc_ManPiNum(p), Frc_ManPoNum(p) );
562 if ( Frc_ManRegNum(p) )
563 printf( "ff =%7d ", Frc_ManRegNum(p) );
564 printf( "node =%8d ", Frc_ManNodeNum(p) );
565 printf( "obj =%8d ", Frc_ManObjNum(p) );
566// printf( "lev =%5d ", Frc_ManLevelNum(p) );
567// printf( "cut =%5d ", Frc_ManCrossCut(p) );
568 printf( "mem =%5.2f MB", 4.0*p->nObjData/(1<<20) );
569// printf( "obj =%5d ", Frc_ManObjNum(p) );
570 printf( "\n" );
571}
Here is the caller graph for this function:

◆ Frc_ManStart()

Frc_Man_t * Frc_ManStart ( Gia_Man_t * pGia)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 428 of file giaForce.c.

429{
430 Frc_Man_t * p;
431 Frc_Obj_t * pObjLog, * pFanLog;
432 Gia_Obj_t * pObj, * pFanin;//, * pObjRi, * pObjRo;
433 Vec_Int_t * vSuper, * vVisit;
434 int nObjs, nFanios, nNodes = 0;
435 int i, k, hHandle = 0;
436 // prepare the AIG
437// Gia_ManCreateRefs( pGia );
439 Frc_ManTransformRefs( pGia, &nObjs, &nFanios );
440 Gia_ManFillValue( pGia );
441 // create logic network
442 p = ABC_CALLOC( Frc_Man_t, 1 );
443 p->pGia = pGia;
444 p->nRegs = Gia_ManRegNum(pGia);
445 p->vCis = Vec_IntAlloc( Gia_ManCiNum(pGia) );
446 p->vCos = Vec_IntAlloc( Gia_ManCoNum(pGia) );
447 p->nObjData = (sizeof(Frc_Obj_t) / 4) * nObjs + 2 * nFanios;
448 p->pObjData = ABC_CALLOC( int, p->nObjData );
449 // create constant node
450 Gia_ManConst0(pGia)->Value = hHandle;
451 pObjLog = Frc_ManObj( p, hHandle );
452 pObjLog->hHandle = hHandle;
453 pObjLog->nFanins = 0;
454 pObjLog->nFanouts = Gia_ObjRefNum( pGia, Gia_ManConst0(pGia) );
455 // count objects
456 hHandle += Frc_ObjSize( pObjLog );
457 nNodes++;
458 p->nObjs++;
459 // create the PIs
460 Gia_ManForEachCi( pGia, pObj, i )
461 {
462 // create PI object
463 pObj->Value = hHandle;
464 Vec_IntPush( p->vCis, hHandle );
465 pObjLog = Frc_ManObj( p, hHandle );
466 pObjLog->hHandle = hHandle;
467 pObjLog->nFanins = 0;
468 pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
469 pObjLog->fCi = 1;
470 // count objects
471 hHandle += Frc_ObjSize( pObjLog );
472 p->nObjs++;
473 }
474 // create internal nodes
475 vSuper = Vec_IntAlloc( 100 );
476 vVisit = Vec_IntAlloc( 100 );
477 Gia_ManForEachAnd( pGia, pObj, i )
478 {
479 if ( pObj->fMark0 == 0 )
480 {
481 assert( Gia_ObjRefNum( pGia, pObj ) == 0 );
482 continue;
483 }
484 assert( Gia_ObjRefNum( pGia, pObj ) > 0 );
485 Frc_ManCollectSuper( pGia, pObj, vSuper, vVisit );
486 // create node object
487 pObj->Value = hHandle;
488 pObjLog = Frc_ManObj( p, hHandle );
489 pObjLog->hHandle = hHandle;
490 pObjLog->nFanins = Vec_IntSize( vSuper );
491 pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
492 // add fanins
493 Gia_ManForEachObjVec( vSuper, pGia, pFanin, k )
494 {
495 pFanLog = Frc_ManObj( p, Gia_ObjValue(pFanin) );
496 Frc_ObjAddFanin( pObjLog, pFanLog );
497 }
498 // count objects
499 hHandle += Frc_ObjSize( pObjLog );
500 nNodes++;
501 p->nObjs++;
502 }
503 Vec_IntFree( vSuper );
504 Vec_IntFree( vVisit );
505 // create the POs
506 Gia_ManForEachCo( pGia, pObj, i )
507 {
508 // create PO object
509 pObj->Value = hHandle;
510 Vec_IntPush( p->vCos, hHandle );
511 pObjLog = Frc_ManObj( p, hHandle );
512 pObjLog->hHandle = hHandle;
513 pObjLog->nFanins = 1;
514 pObjLog->nFanouts = 0;
515 pObjLog->fCo = 1;
516 // add fanins
517 pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin0(pObj)) );
518 Frc_ObjAddFanin( pObjLog, pFanLog );
519 // count objects
520 hHandle += Frc_ObjSize( pObjLog );
521 p->nObjs++;
522 }
523 // connect registers
524// Gia_ManForEachRiRo( pGia, pObjRi, pObjRo, i )
525// Frc_ObjAddFanin( Frc_ManObj(p,Gia_ObjValue(pObjRo)), Frc_ManObj(p,Gia_ObjValue(pObjRi)) );
526 Gia_ManCleanMark0( pGia );
527 assert( nNodes == Frc_ManNodeNum(p) );
528 assert( nObjs == p->nObjs );
529 assert( hHandle == p->nObjData );
530 if ( hHandle != p->nObjData )
531 printf( "Frc_ManStart(): Fatal error in internal representation.\n" );
532 // make sure the fanin/fanout counters are correct
533 Gia_ManForEachObj( pGia, pObj, i )
534 {
535 if ( !~Gia_ObjValue(pObj) )
536 continue;
537 pObjLog = Frc_ManObj( p, Gia_ObjValue(pObj) );
538 assert( pObjLog->nFanins == pObjLog->iFanin );
539 assert( pObjLog->nFanouts == pObjLog->iFanout );
540 pObjLog->iFanin = pObjLog->iFanout = 0;
541 }
542 ABC_FREE( pGia->pRefs );
543 return p;
544}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
void Frc_ManTransformRefs(Gia_Man_t *p, int *pnObjs, int *pnFanios)
Definition giaForce.c:359
void Frc_ManCreateRefsSpecial(Gia_Man_t *p)
Definition giaForce.c:313
void Frc_ManCollectSuper(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper, Vec_Int_t *vVisit)
Definition giaForce.c:289
void Frc_ObjAddFanin(Frc_Obj_t *pObj, Frc_Obj_t *pFanin)
FUNCTION DEFINITIONS ///.
Definition giaForce.c:131
void Gia_ManFillValue(Gia_Man_t *p)
Definition giaUtil.c:369
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
#define Gia_ManForEachCo(p, pObj, i)
Definition gia.h:1236
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228
int * pRefs
Definition gia.h:118
unsigned Value
Definition gia.h:89
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManStartSimple()

Frc_Man_t * Frc_ManStartSimple ( Gia_Man_t * pGia)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file giaForce.c.

151{
152 Frc_Man_t * p;
153 Frc_Obj_t * pObjLog, * pFanLog;
154 Gia_Obj_t * pObj;//, * pObjRi, * pObjRo;
155 int i, nNodes, hHandle = 0;
156 // prepare the AIG
157 Gia_ManCreateRefs( pGia );
158 // create logic network
159 p = ABC_CALLOC( Frc_Man_t, 1 );
160 p->pGia = pGia;
161 p->nRegs = Gia_ManRegNum(pGia);
162 p->vCis = Vec_IntAlloc( Gia_ManCiNum(pGia) );
163 p->vCos = Vec_IntAlloc( Gia_ManCoNum(pGia) );
164 p->nObjData = (sizeof(Frc_Obj_t) / 4) * Gia_ManObjNum(pGia) + 2 * (2 * Gia_ManAndNum(pGia) + Gia_ManCoNum(pGia));
165 p->pObjData = ABC_CALLOC( int, p->nObjData );
166 // create constant node
167 Gia_ManConst0(pGia)->Value = hHandle;
168 pObjLog = Frc_ManObj( p, hHandle );
169 pObjLog->hHandle = hHandle;
170 pObjLog->nFanins = 0;
171 pObjLog->nFanouts = Gia_ObjRefNum( pGia, Gia_ManConst0(pGia) );
172 // count objects
173 hHandle += Frc_ObjSize( pObjLog );
174 nNodes = 1;
175 p->nObjs++;
176 // create the PIs
177 Gia_ManForEachCi( pGia, pObj, i )
178 {
179 // create PI object
180 pObj->Value = hHandle;
181 Vec_IntPush( p->vCis, hHandle );
182 pObjLog = Frc_ManObj( p, hHandle );
183 pObjLog->hHandle = hHandle;
184 pObjLog->nFanins = 0;
185 pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
186 pObjLog->fCi = 0;
187 // count objects
188 hHandle += Frc_ObjSize( pObjLog );
189 p->nObjs++;
190 }
191 // create internal nodes
192 Gia_ManForEachAnd( pGia, pObj, i )
193 {
194 assert( Gia_ObjRefNum( pGia, pObj ) > 0 );
195 // create node object
196 pObj->Value = hHandle;
197 pObjLog = Frc_ManObj( p, hHandle );
198 pObjLog->hHandle = hHandle;
199 pObjLog->nFanins = 2;
200 pObjLog->nFanouts = Gia_ObjRefNum( pGia, pObj );
201 // add fanins
202 pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin0(pObj)) );
203 Frc_ObjAddFanin( pObjLog, pFanLog );
204 pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin1(pObj)) );
205 Frc_ObjAddFanin( pObjLog, pFanLog );
206 // count objects
207 hHandle += Frc_ObjSize( pObjLog );
208 nNodes++;
209 p->nObjs++;
210 }
211 // create the POs
212 Gia_ManForEachCo( pGia, pObj, i )
213 {
214 // create PO object
215 pObj->Value = hHandle;
216 Vec_IntPush( p->vCos, hHandle );
217 pObjLog = Frc_ManObj( p, hHandle );
218 pObjLog->hHandle = hHandle;
219 pObjLog->nFanins = 1;
220 pObjLog->nFanouts = 0;
221 pObjLog->fCo = 1;
222 // add fanins
223 pFanLog = Frc_ManObj( p, Gia_ObjValue(Gia_ObjFanin0(pObj)) );
224 Frc_ObjAddFanin( pObjLog, pFanLog );
225 // count objects
226 hHandle += Frc_ObjSize( pObjLog );
227 p->nObjs++;
228 }
229 // connect registers
230// Gia_ManForEachRiRo( pGia, pObjRi, pObjRo, i )
231// Frc_ObjAddFanin( Frc_ManObj(p,Gia_ObjValue(pObjRo)), Frc_ManObj(p,Gia_ObjValue(pObjRi)) );
232 assert( nNodes == Frc_ManNodeNum(p) );
233 assert( hHandle == p->nObjData );
234 if ( hHandle != p->nObjData )
235 printf( "Frc_ManStartSimple(): Fatal error in internal representation.\n" );
236 // make sure the fanin/fanout counters are correct
237 Gia_ManForEachObj( pGia, pObj, i )
238 {
239 if ( !~Gia_ObjValue(pObj) )
240 continue;
241 pObjLog = Frc_ManObj( p, Gia_ObjValue(pObj) );
242 assert( pObjLog->nFanins == pObjLog->iFanin );
243 assert( pObjLog->nFanouts == pObjLog->iFanout );
244 pObjLog->iFanin = pObjLog->iFanout = 0;
245 }
246 ABC_FREE( pGia->pRefs );
247 return p;
248}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ManStop()

void Frc_ManStop ( Frc_Man_t * p)

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

Synopsis [Creates logic network isomorphic to the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 584 of file giaForce.c.

585{
586 Vec_IntFree( p->vCis );
587 Vec_IntFree( p->vCos );
588 ABC_FREE( p->pObjData );
589 ABC_FREE( p );
590}
Here is the caller graph for this function:

◆ Frc_ManTransformRefs()

void Frc_ManTransformRefs ( Gia_Man_t * p,
int * pnObjs,
int * pnFanios )

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

Synopsis [Assigns references while removing the MUX/XOR ones.]

Description []

SideEffects []

SeeAlso []

Definition at line 359 of file giaForce.c.

360{
361 Vec_Int_t * vSuper, * vVisit;
362 Gia_Obj_t * pObj, * pFanin;
363 int i, k, Counter;
364 assert( p->pRefs != NULL );
365
366 // mark nodes to be used in the logic network
368 Gia_ManConst0(p)->fMark0 = 1;
369 // mark the inputs
370 Gia_ManForEachCi( p, pObj, i )
371 pObj->fMark0 = 1;
372 // mark those nodes that have ref count more than 1
373 Gia_ManForEachAnd( p, pObj, i )
374 pObj->fMark0 = (Gia_ObjRefNum(p, pObj) > 1);
375 // mark the output drivers
376 Gia_ManForEachCoDriver( p, pObj, i )
377 pObj->fMark0 = 1;
378
379 // count the number of nodes
380 Counter = 0;
381 Gia_ManForEachObj( p, pObj, i )
382 Counter += pObj->fMark0;
383 *pnObjs = Counter + Gia_ManCoNum(p);
384
385 // reset the references
386 ABC_FREE( p->pRefs );
387 p->pRefs = ABC_CALLOC( int, Gia_ManObjNum(p) );
388 // reference from internal nodes
389 Counter = 0;
390 vSuper = Vec_IntAlloc( 100 );
391 vVisit = Vec_IntAlloc( 100 );
393 Gia_ManForEachAnd( p, pObj, i )
394 {
395 if ( pObj->fMark0 == 0 )
396 continue;
397 Frc_ManCollectSuper( p, pObj, vSuper, vVisit );
398 Gia_ManForEachObjVec( vSuper, p, pFanin, k )
399 {
400 assert( pFanin->fMark0 );
401 Gia_ObjRefInc( p, pFanin );
402 }
403 Counter += Vec_IntSize( vSuper );
404 }
406 Vec_IntFree( vSuper );
407 Vec_IntFree( vVisit );
408 // reference from outputs
409 Gia_ManForEachCoDriver( p, pObj, i )
410 {
411 assert( pObj->fMark0 );
412 Gia_ObjRefInc( p, pObj );
413 }
414 *pnFanios = Counter + Gia_ManCoNum(p);
415}
void Gia_ManCheckMark1(Gia_Man_t *p)
Definition giaUtil.c:332
#define Gia_ManForEachCoDriver(p, pObj, i)
Definition gia.h:1244
void Gia_ManCleanMark1(Gia_Man_t *p)
Definition giaUtil.c:313
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Frc_ObjAddFanin()

void Frc_ObjAddFanin ( Frc_Obj_t * pObj,
Frc_Obj_t * pFanin )

FUNCTION DEFINITIONS ///.

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

Synopsis [Creates fanin/fanout pair.]

Description []

SideEffects []

SeeAlso []

Definition at line 131 of file giaForce.c.

132{
133 assert( pObj->iFanin < pObj->nFanins );
134 assert( pFanin->iFanout < pFanin->nFanouts );
135 pFanin->Fanios[pFanin->nFanins + pFanin->iFanout++] =
136 pObj->Fanios[pObj->iFanin++] = pObj->hHandle - pFanin->hHandle;
137}
Here is the caller graph for this function:

◆ Frc_ObjFanoutsAreCos()

int Frc_ObjFanoutsAreCos ( Frc_Obj_t * pThis)

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

Synopsis [Returns 1 if all fanouts are COsw.]

Description []

SideEffects []

SeeAlso []

Definition at line 981 of file giaForce.c.

982{
983 Frc_Obj_t * pNext;
984 int i;
985 Frc_ObjForEachFanout( pThis, pNext, i )
986 if ( !Frc_ObjIsCo(pNext) )
987 return 0;
988 return 1;
989}
Here is the caller graph for this function: