ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaTranStoch.c File Reference
#include <base/abc/abc.h>
#include <aig/aig/aig.h>
#include <opt/dar/dar.h>
#include <aig/gia/gia.h>
#include <aig/gia/giaAig.h>
#include <base/main/main.h>
#include <base/main/mainInt.h>
#include <map/mio/mio.h>
#include <opt/sfm/sfm.h>
#include <opt/fxu/fxu.h>
#include <unistd.h>
Include dependency graph for giaTranStoch.c:

Go to the source code of this file.

Classes

struct  Gia_ManTranStochParam
 

Typedefs

typedef struct Gia_ManTranStochParam Gia_ManTranStochParam
 

Functions

ABC_NAMESPACE_IMPL_START Abc_Ntk_tAbc_NtkFromAigPhase (Aig_Man_t *pMan)
 DECLARATIONS ///.
 
Abc_Ntk_tAbc_NtkIf (Abc_Ntk_t *pNtk, If_Par_t *pPars)
 
int Abc_NtkPerformMfs (Abc_Ntk_t *pNtk, Sfm_Par_t *pPars)
 
Aig_Man_tAbc_NtkToDar (Abc_Ntk_t *pNtk, int fExors, int fRegisters)
 
int Abc_NtkFxPerform (Abc_Ntk_t *pNtk, int nNewNodesMax, int nLitCountMax, int fCanonDivs, int fVerbose, int fVeryVerbose)
 
Abc_Ntk_tGia_ManTranStochPut (Gia_Man_t *pGia)
 
Abc_Ntk_tGia_ManTranStochIf (Abc_Ntk_t *pNtk)
 
void Gia_ManTranStochMfs2 (Abc_Ntk_t *pNtk)
 
Gia_Man_tGia_ManTranStochGet (Abc_Ntk_t *pNtk)
 
void Gia_ManTranStochFx (Abc_Ntk_t *pNtk)
 
Gia_Man_tGia_ManTranStochRefactor (Gia_Man_t *pGia)
 
void Gia_ManTranStochLock (Gia_ManTranStochParam *p)
 
void Gia_ManTranStochUnlock (Gia_ManTranStochParam *p)
 
Gia_Man_tGia_ManTranStochOpt1 (Gia_ManTranStochParam *p, Gia_Man_t *pOld)
 
Gia_Man_tGia_ManTranStochOpt2 (Gia_ManTranStochParam *p)
 
Gia_Man_tGia_ManTranStochOpt3 (Gia_ManTranStochParam *p)
 
Gia_Man_tGia_ManTranStoch (Gia_Man_t *pGia, int nRestarts, int nHops, int nSeedBase, int fMspf, int fMerge, int fResetHop, int fZeroCostHop, int fRefactor, int fTruth, int fSingle, int fOriginalOnly, int fNewLine, Gia_Man_t *pExdc, int nThreads, int nVerbose)
 

Typedef Documentation

◆ Gia_ManTranStochParam

typedef struct Gia_ManTranStochParam Gia_ManTranStochParam

Definition at line 128 of file giaTranStoch.c.

Function Documentation

◆ Abc_NtkFromAigPhase()

ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkFromAigPhase ( Aig_Man_t * pMan)
extern

DECLARATIONS ///.

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

FileName [giaTranStoch.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Implementation of transduction method.]

Author [Yukio Miyasaka]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 2023.]

Revision [

Id
giaTranStoch.c,v 1.00 2023/05/10 00:00:00 Exp

]

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description [This procedure should be called after seq sweeping, which changes the number of registers.]

SideEffects []

SeeAlso []

Definition at line 595 of file abcDar.c.

596{
597 Vec_Ptr_t * vNodes;
598 Abc_Ntk_t * pNtkNew;
599 Abc_Obj_t * pObjNew;
600 Aig_Obj_t * pObj, * pObjLo, * pObjLi;
601 int i;
602 assert( pMan->nAsserts == 0 );
603 // perform strashing
605 pNtkNew->nConstrs = pMan->nConstrs;
606 pNtkNew->nBarBufs = pMan->nBarBufs;
607 // duplicate the name and the spec
608// pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
609// pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
610 Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
611 // create PIs
612 Aig_ManForEachPiSeq( pMan, pObj, i )
613 {
614 pObjNew = Abc_NtkCreatePi( pNtkNew );
615// Abc_ObjAssignName( pObjNew, Abc_ObjName(pObjNew), NULL );
616 pObj->pData = pObjNew;
617 }
618 // create POs
619 Aig_ManForEachPoSeq( pMan, pObj, i )
620 {
621 pObjNew = Abc_NtkCreatePo( pNtkNew );
622// Abc_ObjAssignName( pObjNew, Abc_ObjName(pObjNew), NULL );
623 pObj->pData = pObjNew;
624 }
625 assert( Abc_NtkCiNum(pNtkNew) == Aig_ManCiNum(pMan) - Aig_ManRegNum(pMan) );
626 assert( Abc_NtkCoNum(pNtkNew) == Aig_ManCoNum(pMan) - Aig_ManRegNum(pMan) );
627 // create as many latches as there are registers in the manager
628 Aig_ManForEachLiLoSeq( pMan, pObjLi, pObjLo, i )
629 {
630 pObjNew = Abc_NtkCreateLatch( pNtkNew );
631 pObjLi->pData = Abc_NtkCreateBi( pNtkNew );
632 pObjLo->pData = Abc_NtkCreateBo( pNtkNew );
633 Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pObjLi->pData );
634 Abc_ObjAddFanin( (Abc_Obj_t *)pObjLo->pData, pObjNew );
635 Abc_LatchSetInit0( pObjNew );
636// Abc_ObjAssignName( (Abc_Obj_t *)pObjLi->pData, Abc_ObjName((Abc_Obj_t *)pObjLi->pData), NULL );
637// Abc_ObjAssignName( (Abc_Obj_t *)pObjLo->pData, Abc_ObjName((Abc_Obj_t *)pObjLo->pData), NULL );
638 }
639 // rebuild the AIG
640 vNodes = Aig_ManDfs( pMan, 1 );
641 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
642 if ( Aig_ObjIsBuf(pObj) )
643 pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
644 else
645 pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
646 Vec_PtrFree( vNodes );
647 // connect the PO nodes
648 Aig_ManForEachCo( pMan, pObj, i )
649 {
650 pObjNew = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
651 Abc_ObjAddFanin( Abc_NtkCo(pNtkNew, i), pObjNew );
652 }
653
654 Abc_NtkAddDummyPiNames( pNtkNew );
655 Abc_NtkAddDummyPoNames( pNtkNew );
656 Abc_NtkAddDummyBoxNames( pNtkNew );
657
658 // check the resulting AIG
659 if ( !Abc_NtkCheck( pNtkNew ) )
660 Abc_Print( 1, "Abc_NtkFromAigPhase(): Network check has failed.\n" );
661 return pNtkNew;
662}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:547
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
struct Abc_Aig_t_ Abc_Aig_t
Definition abc.h:117
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
@ ABC_NTK_STRASH
Definition abc.h:58
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:700
@ ABC_FUNC_AIG
Definition abc.h:67
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
Definition aig.h:438
#define Aig_ManForEachCo(p, pObj, i)
Definition aig.h:398
Vec_Ptr_t * Aig_ManDfs(Aig_Man_t *p, int fNodesOnly)
Definition aigDfs.c:145
#define Aig_ManForEachPoSeq(p, pObj, i)
Definition aig.h:444
#define Aig_ManForEachLiLoSeq(p, pObjLi, pObjLo, k)
Definition aig.h:450
int nBarBufs
Definition abc.h:174
int nConstrs
Definition abc.h:173
void * pManFunc
Definition abc.h:191
void * pData
Definition aig.h:87
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the caller graph for this function:

◆ Abc_NtkFxPerform()

int Abc_NtkFxPerform ( Abc_Ntk_t * pNtk,
int nNewNodesMax,
int LitCountMax,
int fCanonDivs,
int fVerbose,
int fVeryVerbose )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 309 of file abcFx.c.

310{
311 extern int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitCountMax, int fCanonDivs, int fVerbose, int fVeryVerbose );
312 Vec_Wec_t * vCubes;
313 assert( Abc_NtkIsSopLogic(pNtk) );
314 // check unique fanins
315 if ( !Abc_NtkFxCheck(pNtk) )
316 {
317 printf( "Abc_NtkFastExtract: Nodes have duplicated fanins. FX is not performed.\n" );
318 return 0;
319 }
320 // collect information about the covers
321 vCubes = Abc_NtkFxRetrieve( pNtk );
322 // call the fast extract procedure
323 if ( Fx_FastExtract( vCubes, Abc_NtkObjNumMax(pNtk), nNewNodesMax, LitCountMax, fCanonDivs, fVerbose, fVeryVerbose ) > 0 )
324 {
325 // update the network
326 Abc_NtkFxInsert( pNtk, vCubes );
327 Vec_WecFree( vCubes );
328 if ( !Abc_NtkCheck( pNtk ) )
329 printf( "Abc_NtkFxPerform: The network check has failed.\n" );
330 return 1;
331 }
332 else
333 printf( "Warning: The network has not been changed by \"fx\".\n" );
334 Vec_WecFree( vCubes );
335 return 0;
336}
Vec_Wec_t * Abc_NtkFxRetrieve(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcFx.c:140
void Abc_NtkFxInsert(Abc_Ntk_t *pNtk, Vec_Wec_t *vCubes)
Definition abcFx.c:183
int Fx_FastExtract(Vec_Wec_t *vCubes, int ObjIdMax, int nNewNodesMax, int LitCountMax, int fCanonDivs, int fVerbose, int fVeryVerbose)
Definition abcFx.c:1166
int Abc_NtkFxCheck(Abc_Ntk_t *pNtk)
Definition abcFx.c:283
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIf()

Abc_Ntk_t * Abc_NtkIf ( Abc_Ntk_t * pNtk,
If_Par_t * pPars )
extern

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

Synopsis [Interface with the FPGA mapping package.]

Description []

SideEffects []

SeeAlso []

Definition at line 107 of file abcIf.c.

108{
109 Abc_Ntk_t * pNtkNew, * pTemp;
110 If_Man_t * pIfMan;
111
112 assert( Abc_NtkIsStrash(pNtk) );
113
114 // get timing information
117
118 // update timing info to reflect logic level
119 if ( (pPars->fDelayOpt || pPars->fDsdBalance || pPars->fUserRecLib || pPars->fUserSesLib || pPars->fUserLutDec || pPars->fUserLut2D ) && pNtk->pManTime )
120 {
121 int c;
122 if ( pNtk->AndGateDelay == 0.0 )
123 {
124 if ( Abc_FrameReadLibGen() )
126 if ( pNtk->AndGateDelay == 0.0 )
127 {
128 pNtk->AndGateDelay = 1.0;
129 printf( "The AIG-node delay is not set. Assuming unit-delay.\n" );
130 }
131 }
132 for ( c = 0; c < Abc_NtkCiNum(pNtk); c++ )
133 pPars->pTimesArr[c] /= pNtk->AndGateDelay;
134 for ( c = 0; c < Abc_NtkCoNum(pNtk); c++ )
135 pPars->pTimesReq[c] /= pNtk->AndGateDelay;
136 }
137
138 // set the latch paths
139 if ( pPars->fLatchPaths && pPars->pTimesArr )
140 {
141 int c;
142 for ( c = 0; c < Abc_NtkPiNum(pNtk); c++ )
143 pPars->pTimesArr[c] = -ABC_INFINITY;
144 }
145
146 // create FPGA mapper
147 pIfMan = Abc_NtkToIf( pNtk, pPars );
148 if ( pIfMan == NULL )
149 return NULL;
150 if ( pPars->fPower )
151 If_ManComputeSwitching( pIfMan );
152
153 // create DSD manager
154 if ( pPars->fUseDsd )
155 {
157 assert( pPars->nLutSize <= If_DsdManVarNum(p) );
158 assert( (pPars->pLutStruct == NULL && If_DsdManLutSize(p) == 0) || (pPars->pLutStruct && pPars->pLutStruct[0] - '0' == If_DsdManLutSize(p)) );
160 if ( pPars->fDsdBalance )
161 If_DsdManAllocIsops( pIfMan->pIfDsdMan, pPars->nLutSize );
162 }
163
164 // perform FPGA mapping
165 if ( !If_ManPerformMapping( pIfMan ) )
166 {
167 If_ManStop( pIfMan );
168 return NULL;
169 }
170
171 // transform the result of mapping into the new network
172 pNtkNew = Abc_NtkFromIf( pIfMan, pNtk );
173 if ( pNtkNew == NULL )
174 return NULL;
175 If_ManStop( pIfMan );
176 if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fUserRecLib )
177 {
178 pNtkNew = Abc_NtkStrash( pTemp = pNtkNew, 0, 0, 0 );
179 Abc_NtkDelete( pTemp );
180 }
181 else if ( pPars->fBidec && pPars->nLutSize <= 8 )
182 Abc_NtkBidecResyn( pNtkNew, 0 );
183
184 // duplicate EXDC
185 if ( pNtk->pExdc )
186 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
187 // make sure that everything is okay
188 if ( !Abc_NtkCheck( pNtkNew ) )
189 {
190 printf( "Abc_NtkIf: The network check has failed.\n" );
191 Abc_NtkDelete( pNtkNew );
192 return NULL;
193 }
194 return pNtkNew;
195}
ABC_NAMESPACE_IMPL_START If_Man_t * Abc_NtkToIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
DECLARATIONS ///.
Definition abcIf.c:209
void If_ManComputeSwitching(If_Man_t *pIfMan)
FUNCTION DEFINITIONS ///.
Definition abcIf.c:59
void Abc_NtkBidecResyn(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcBidec.c:110
ABC_DLL float * Abc_NtkGetCoRequiredFloats(Abc_Ntk_t *pNtk)
Definition abcTiming.c:802
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition abcNtk.c:472
ABC_DLL float * Abc_NtkGetCiArrivalFloats(Abc_Ntk_t *pNtk)
Definition abcTiming.c:789
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
ABC_DLL void * Abc_FrameReadManDsd()
Definition mainFrame.c:67
Cube * p
Definition exorList.c:222
int If_DsdManLutSize(If_DsdMan_t *p)
Definition ifDsd.c:181
int If_DsdManVarNum(If_DsdMan_t *p)
Definition ifDsd.c:173
void If_DsdManAllocIsops(If_DsdMan_t *p, int nLutSize)
Definition ifDsd.c:306
struct If_DsdMan_t_ If_DsdMan_t
Definition if.h:84
void If_ManStop(If_Man_t *p)
Definition ifMan.c:212
int If_ManPerformMapping(If_Man_t *p)
Definition ifCore.c:82
struct If_Man_t_ If_Man_t
BASIC TYPES ///.
Definition if.h:77
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
float Mio_LibraryReadDelayAigNode(Mio_Library_t *pLib)
Definition mioApi.c:64
float AndGateDelay
Definition abc.h:194
Abc_Ntk_t * pExdc
Definition abc.h:201
Abc_ManTime_t * pManTime
Definition abc.h:192
If_DsdMan_t * pIfDsdMan
Definition if.h:260
float * pTimesArr
Definition if.h:176
int fUseDsd
Definition if.h:140
int fLatchPaths
Definition if.h:121
int fDelayOpt
Definition if.h:126
int fUserLut2D
Definition if.h:151
int fPower
Definition if.h:124
int fUserLutDec
Definition if.h:150
int nLutSize
Definition if.h:104
int fUserSesLib
Definition if.h:130
int fBidec
Definition if.h:131
int fDsdBalance
Definition if.h:128
float * pTimesReq
Definition if.h:177
int fUserRecLib
Definition if.h:129
char * pLutStruct
Definition if.h:154
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkPerformMfs()

int Abc_NtkPerformMfs ( Abc_Ntk_t * pNtk,
Sfm_Par_t * pPars )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 357 of file abcMfs.c.

358{
359 Sfm_Ntk_t * p;
360 int nFaninMax, nNodes;
361 assert( Abc_NtkIsLogic(pNtk) );
362 Abc_NtkSweep( pNtk, 0 );
363 // count fanouts
364 nFaninMax = Abc_NtkGetFaninMax( pNtk );
365 if ( nFaninMax > 15 )
366 {
367 Abc_Print( 1, "Currently \"mfs\" cannot process the network containing nodes with more than 15 fanins.\n" );
368 return 1;
369 }
370 if ( !Abc_NtkHasSop(pNtk) )
371 if ( !Abc_NtkToSop( pNtk, -1, ABC_INFINITY ) )
372 {
373 printf( "Conversion to SOP has failed due to low resource limit.\n" );
374 return 0;
375 }
376 // collect information
377 p = Abc_NtkExtractMfs( pNtk, pPars->nFirstFixed );
378 // perform optimization
379 nNodes = Sfm_NtkPerform( p, pPars );
380 if ( nNodes == 0 )
381 {
382// Abc_Print( 1, "The network is not changed by \"mfs\".\n" );
383 }
384 else
385 {
386 Abc_NtkInsertMfs( pNtk, p );
387 if( pPars->fVerbose )
388 Abc_Print( 1, "The network has %d nodes changed by \"mfs\".\n", nNodes );
389 }
390 Sfm_NtkFree( p );
391 return 1;
392}
void Abc_NtkInsertMfs(Abc_Ntk_t *pNtk, Sfm_Ntk_t *p)
Definition abcMfs.c:303
Sfm_Ntk_t * Abc_NtkExtractMfs(Abc_Ntk_t *pNtk, int nFirstFixed)
Definition abcMfs.c:146
ABC_DLL int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcSweep.c:692
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:486
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fMode, int nCubeLimit)
Definition abcFunc.c:1261
int Sfm_NtkPerform(Sfm_Ntk_t *p, Sfm_Par_t *pPars)
Definition sfmCore.c:367
void Sfm_NtkFree(Sfm_Ntk_t *p)
Definition sfmNtk.c:219
typedefABC_NAMESPACE_HEADER_START struct Sfm_Ntk_t_ Sfm_Ntk_t
INCLUDES ///.
Definition sfm.h:41
int nFirstFixed
Definition sfm.h:58
int fVerbose
Definition sfm.h:74
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToDar()

Aig_Man_t * Abc_NtkToDar ( Abc_Ntk_t * pNtk,
int fExors,
int fRegisters )
extern

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description [Assumes that registers are ordered after PIs/POs.]

SideEffects []

SeeAlso []

Definition at line 237 of file abcDar.c.

238{
239 Vec_Ptr_t * vNodes;
240 Aig_Man_t * pMan;
241 Aig_Obj_t * pObjNew;
242 Abc_Obj_t * pObj;
243 int i, nNodes, nDontCares;
244 // make sure the latches follow PIs/POs
245 if ( fRegisters )
246 {
247 assert( Abc_NtkBoxNum(pNtk) == Abc_NtkLatchNum(pNtk) );
248 Abc_NtkForEachCi( pNtk, pObj, i )
249 if ( i < Abc_NtkPiNum(pNtk) )
250 {
251 assert( Abc_ObjIsPi(pObj) );
252 if ( !Abc_ObjIsPi(pObj) )
253 Abc_Print( 1, "Abc_NtkToDar(): Temporary bug: The PI ordering is wrong!\n" );
254 }
255 else
256 assert( Abc_ObjIsBo(pObj) );
257 Abc_NtkForEachCo( pNtk, pObj, i )
258 if ( i < Abc_NtkPoNum(pNtk) )
259 {
260 assert( Abc_ObjIsPo(pObj) );
261 if ( !Abc_ObjIsPo(pObj) )
262 Abc_Print( 1, "Abc_NtkToDar(): Temporary bug: The PO ordering is wrong!\n" );
263 }
264 else
265 assert( Abc_ObjIsBi(pObj) );
266 // print warning about initial values
267 nDontCares = 0;
268 Abc_NtkForEachLatch( pNtk, pObj, i )
269 if ( Abc_LatchIsInitDc(pObj) )
270 {
271 Abc_LatchSetInit0(pObj);
272 nDontCares++;
273 }
274 if ( nDontCares )
275 {
276 Abc_Print( 1, "Warning: %d registers in this network have don't-care init values.\n", nDontCares );
277 Abc_Print( 1, "The don't-care are assumed to be 0. The result may not verify.\n" );
278 Abc_Print( 1, "Use command \"print_latch\" to see the init values of registers.\n" );
279 Abc_Print( 1, "Use command \"zero\" to convert or \"init\" to change the values.\n" );
280 }
281 }
282 // create the manager
283 pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
284 pMan->fCatchExor = fExors;
285 pMan->nConstrs = pNtk->nConstrs;
286 pMan->nBarBufs = pNtk->nBarBufs;
287 pMan->pName = Extra_UtilStrsav( pNtk->pName );
288 pMan->pSpec = Extra_UtilStrsav( pNtk->pSpec );
289 // transfer the pointers to the basic nodes
290 Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)Aig_ManConst1(pMan);
291 Abc_NtkForEachCi( pNtk, pObj, i )
292 {
293 pObj->pCopy = (Abc_Obj_t *)Aig_ObjCreateCi(pMan);
294 // initialize logic level of the CIs
295 ((Aig_Obj_t *)pObj->pCopy)->Level = pObj->Level;
296 }
297
298 // complement the 1-values registers
299 if ( fRegisters ) {
300 Abc_NtkForEachLatch( pNtk, pObj, i )
301 if ( Abc_LatchIsInit1(pObj) )
302 Abc_ObjFanout0(pObj)->pCopy = Abc_ObjNot(Abc_ObjFanout0(pObj)->pCopy);
303 }
304 // perform the conversion of the internal nodes (assumes DFS ordering)
305// pMan->fAddStrash = 1;
306 vNodes = Abc_NtkDfs( pNtk, 0 );
307 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
308// Abc_NtkForEachNode( pNtk, pObj, i )
309 {
310 pObj->pCopy = (Abc_Obj_t *)Aig_And( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj), (Aig_Obj_t *)Abc_ObjChild1Copy(pObj) );
311// Abc_Print( 1, "%d->%d ", pObj->Id, ((Aig_Obj_t *)pObj->pCopy)->Id );
312 }
313 Vec_PtrFree( vNodes );
314 pMan->fAddStrash = 0;
315 // create the POs
316 Abc_NtkForEachCo( pNtk, pObj, i )
317 Aig_ObjCreateCo( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj) );
318 // complement the 1-valued registers
319 Aig_ManSetRegNum( pMan, Abc_NtkLatchNum(pNtk) );
320 if ( fRegisters )
321 Aig_ManForEachLiSeq( pMan, pObjNew, i )
322 if ( Abc_LatchIsInit1(Abc_ObjFanout0(Abc_NtkCo(pNtk,i))) )
323 pObjNew->pFanin0 = Aig_Not(pObjNew->pFanin0);
324 // remove dangling nodes
325 nNodes = (Abc_NtkGetChoiceNum(pNtk) == 0)? Aig_ManCleanup( pMan ) : 0;
326 if ( !fExors && nNodes )
327 Abc_Print( 1, "Abc_NtkToDar(): Unexpected %d dangling nodes when converting to AIG!\n", nNodes );
328//Aig_ManDumpVerilog( pMan, "test.v" );
329 // save the number of registers
330 if ( fRegisters )
331 {
332 Aig_ManSetRegNum( pMan, Abc_NtkLatchNum(pNtk) );
333 pMan->vFlopNums = Vec_IntStartNatural( pMan->nRegs );
334// pMan->vFlopNums = NULL;
335// pMan->vOnehots = Abc_NtkConverLatchNamesIntoNumbers( pNtk );
336 if ( pNtk->vOnehots )
337 pMan->vOnehots = (Vec_Ptr_t *)Vec_VecDupInt( (Vec_Vec_t *)pNtk->vOnehots );
338 }
339 if ( !Aig_ManCheck( pMan ) )
340 {
341 Abc_Print( 1, "Abc_NtkToDar: AIG check has failed.\n" );
342 Aig_ManStop( pMan );
343 return NULL;
344 }
345 return pMan;
346}
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition abc.h:500
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:463
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
Definition aigMan.c:438
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
#define Aig_ManForEachLiSeq(p, pObj, i)
Definition aig.h:447
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:104
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition aigObj.c:66
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition aigMan.c:47
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
int Aig_ManCleanup(Aig_Man_t *p)
Definition aigMan.c:265
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigObj.c:45
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition aigCheck.c:45
char * Extra_UtilStrsav(const char *s)
char * pName
Definition abc.h:158
Vec_Ptr_t * vOnehots
Definition abc.h:211
char * pSpec
Definition abc.h:159
Abc_Obj_t * pCopy
Definition abc.h:148
unsigned Level
Definition abc.h:142
Aig_Obj_t * pFanin0
Definition aig.h:75
unsigned Level
Definition aig.h:82
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStoch()

Gia_Man_t * Gia_ManTranStoch ( Gia_Man_t * pGia,
int nRestarts,
int nHops,
int nSeedBase,
int fMspf,
int fMerge,
int fResetHop,
int fZeroCostHop,
int fRefactor,
int fTruth,
int fSingle,
int fOriginalOnly,
int fNewLine,
Gia_Man_t * pExdc,
int nThreads,
int nVerbose )

Definition at line 261 of file giaTranStoch.c.

261 {
262 int i, j = 0;
263 Gia_Man_t * pNew, * pBest, * pStart;
264 Abc_Ntk_t * pNtk, * pNtkRes; Vec_Ptr_t * vpStarts;
265 Gia_ManTranStochParam Par, *p = &Par;
266 p->nRestarts = nRestarts;
267 p->nHops = nHops;
268 p->nSeedBase = nSeedBase;
269 p->fMspf = fMspf;
270 p->fMerge = fMerge;
271 p->fResetHop = fResetHop;
272 p->fZeroCostHop = fZeroCostHop;
273 p->fRefactor = fRefactor;
274 p->fTruth = fTruth;
275 p->fNewLine = fNewLine;
276 p->pExdc = pExdc;
277 p->nVerbose = nVerbose;
278#ifdef ABC_USE_PTHREADS
279 p->fWorking = 0;
280#endif
281 // setup start points
282 vpStarts = Vec_PtrAlloc( 4 );
283 Vec_PtrPush( vpStarts, Gia_ManDup( pGia ) );
284 if ( !fOriginalOnly ) {
285 { // &put; collapse; st; &get;
286 pNtk = Gia_ManTranStochPut( pGia );
287 pNtkRes = Abc_NtkCollapse( pNtk, ABC_INFINITY, 0, 1, 0, 0, 0 );
288 Abc_NtkDelete( pNtk );
289 pNtk = pNtkRes;
290 pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
291 Abc_NtkDelete( pNtk );
292 pNtk = pNtkRes;
293 pNew = Gia_ManTranStochGet( pNtk );
294 Abc_NtkDelete( pNtk );
295 Vec_PtrPush( vpStarts, pNew );
296 }
297 { // &ttopt;
298 pNew = Gia_ManTtopt( pGia, Gia_ManCiNum( pGia ), Gia_ManCoNum( pGia ), 100 );
299 Vec_PtrPush( vpStarts, pNew );
300 }
301 { // &put; collapse; sop; fx;
302 pNtk = Gia_ManTranStochPut( pGia );
303 pNtkRes = Abc_NtkCollapse( pNtk, ABC_INFINITY, 0, 1, 0, 0, 0 );
304 Abc_NtkDelete( pNtk );
305 pNtk = pNtkRes;
306 Abc_NtkToSop( pNtk, -1, ABC_INFINITY );
307 Gia_ManTranStochFx( pNtk );
308 pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
309 Abc_NtkDelete( pNtk );
310 pNtk = pNtkRes;
311 pNew = Gia_ManTranStochGet( pNtk );
312 Abc_NtkDelete( pNtk );
313 Vec_PtrPush( vpStarts, pNew );
314 }
315 }
316 if ( fSingle ) {
317 pBest = (Gia_Man_t *)Vec_PtrEntry( vpStarts, 0 );
318 for ( i = 1; i < Vec_PtrSize( vpStarts ); i++ ) {
319 pStart = (Gia_Man_t *)Vec_PtrEntry( vpStarts, i );
320 if ( Gia_ManAndNum( pStart ) < Gia_ManAndNum( pBest ) ) {
321 Gia_ManStop( pBest );
322 pBest = pStart;
323 j = i;
324 } else {
325 Gia_ManStop( pStart );
326 }
327 }
328 Vec_PtrClear( vpStarts );
329 Vec_PtrPush( vpStarts, pBest );
330 }
331 // optimize
332 pBest = Gia_ManDup( pGia );
333 if ( nThreads == 1 ) {
334 Vec_PtrForEachEntry( Gia_Man_t *, vpStarts, pStart, i ) {
335 if ( p->nVerbose )
336 printf( "*begin starting point %d: #nodes = %5d\n", i + j, Gia_ManAndNum( pStart ) );
337 p->pStart = pStart;
338 pNew = Gia_ManTranStochOpt3( p );
339 if ( p->nVerbose )
340 printf( "*end starting point %d: #nodes = %5d\n", i + j, Gia_ManAndNum( pNew ) );
341 if ( Gia_ManAndNum( pBest ) > Gia_ManAndNum( pNew ) ) {
342 Gia_ManStop( pBest );
343 pBest = pNew;
344 } else {
345 Gia_ManStop( pNew );
346 }
347 Gia_ManStop( pStart );
348 }
349 } else {
350#ifdef ABC_USE_PTHREADS
351 static pthread_mutex_t mutex;
352 int k, status, nIte, fAssigned, fWorking;
353 Gia_ManTranStochParam ThData[100];
354 pthread_t WorkerThread[100];
355 p->pRes = NULL;
356 p->mutex = &mutex;
357 if ( p->nVerbose )
358 p->nVerbose--;
359 for ( i = 0; i < nThreads; i++ ) {
360 ThData[i] = *p;
361 status = pthread_create( WorkerThread + i, NULL, Gia_ManTranStochWorkerThread, (void *)(ThData + i) );
362 assert( status == 0 );
363 }
364 Vec_PtrForEachEntry( Gia_Man_t *, vpStarts, pStart, k ) {
365 for ( nIte = 0; nIte <= p->nRestarts; nIte++ ) {
366 fAssigned = 0;
367 while ( !fAssigned ) {
368 for ( i = 0; i < nThreads; i++ ) {
369 if ( ThData[i].fWorking )
370 continue;
371 if ( ThData[i].pRes != NULL ) {
372 if( nVerbose )
373 printf( "*sp %d res %4d : #nodes = %5d\n", ThData[i].nSp, ThData[i].nIte, Gia_ManAndNum( ThData[i].pRes ) );
374 if ( Gia_ManAndNum( pBest ) > Gia_ManAndNum( ThData[i].pRes ) ) {
375 Gia_ManStop( pBest );
376 pBest = ThData[i].pRes;
377 } else {
378 Gia_ManStop( ThData[i].pRes );
379 }
380 ThData[i].pRes = NULL;
381 }
382 ThData[i].nSp = j + k;
383 ThData[i].nIte = nIte;
384 ThData[i].pStart = pStart;
385 ThData[i].fWorking = 1;
386 fAssigned = 1;
387 break;
388 }
389 }
390 }
391 }
392 fWorking = 1;
393 while ( fWorking ) {
394 fWorking = 0;
395 for ( i = 0; i < nThreads; i++ ) {
396 if( ThData[i].fWorking ) {
397 fWorking = 1;
398 continue;
399 }
400 if ( ThData[i].pRes != NULL ) {
401 if( nVerbose )
402 printf( "*sp %d res %4d : #nodes = %5d\n", ThData[i].nSp, ThData[i].nIte, Gia_ManAndNum( ThData[i].pRes ) );
403 if ( Gia_ManAndNum( pBest ) > Gia_ManAndNum( ThData[i].pRes ) ) {
404 Gia_ManStop( pBest );
405 pBest = ThData[i].pRes;
406 } else {
407 Gia_ManStop( ThData[i].pRes );
408 }
409 ThData[i].pRes = NULL;
410 }
411 }
412 }
413 for ( i = 0; i < nThreads; i++ ) {
414 ThData[i].pStart = NULL;
415 ThData[i].fWorking = 1;
416 }
417#else
418 printf( "ERROR: pthread is off" );
419#endif
420 Vec_PtrForEachEntry( Gia_Man_t *, vpStarts, pStart, i )
421 Gia_ManStop( pStart );
422 }
423 if ( nVerbose )
424 printf( "best: %d\n", Gia_ManAndNum( pBest ) );
425 Vec_PtrFree( vpStarts );
426 ABC_FREE( pBest->pName );
427 ABC_FREE( pBest->pSpec );
428 pBest->pName = Abc_UtilStrsav( pGia->pName );
429 pBest->pSpec = Abc_UtilStrsav( pGia->pSpec );
430 return pBest;
431}
ABC_DLL Abc_Ntk_t * Abc_NtkCollapse(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fReverse, int fDumpOrder, int fVerbose)
DECLARATIONS ///.
#define ABC_FREE(obj)
Definition abc_global.h:267
Gia_Man_t * Gia_ManTranStochOpt3(Gia_ManTranStochParam *p)
Abc_Ntk_t * Gia_ManTranStochPut(Gia_Man_t *pGia)
Gia_Man_t * Gia_ManTranStochGet(Abc_Ntk_t *pNtk)
void Gia_ManTranStochFx(Abc_Ntk_t *pNtk)
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition giaDup.c:720
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Gia_Man_t * Gia_ManTtopt(Gia_Man_t *p, int nIns, int nOuts, int nRounds)
pthread_mutex_t mutex
Definition starter.c:44
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
Here is the call graph for this function:

◆ Gia_ManTranStochFx()

void Gia_ManTranStochFx ( Abc_Ntk_t * pNtk)

Definition at line 82 of file giaTranStoch.c.

82 {
83 Fxu_Data_t Params, * p = &Params;
85 Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fCanonDivs, p->fVerbose, p->fVeryVerbose );
87}
void Abc_NtkFxuFreeInfo(Fxu_Data_t *p)
Definition abcFxu.c:207
void Abc_NtkSetDefaultFxParams(Fxu_Data_t *p)
FUNCTION DEFINITIONS ///.
Definition abcFxu.c:52
typedefABC_NAMESPACE_HEADER_START struct FxuDataStruct Fxu_Data_t
INCLUDES ///.
Definition fxu.h:42
int Abc_NtkFxPerform(Abc_Ntk_t *pNtk, int nNewNodesMax, int nLitCountMax, int fCanonDivs, int fVerbose, int fVeryVerbose)
Definition abcFx.c:309
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochGet()

Gia_Man_t * Gia_ManTranStochGet ( Abc_Ntk_t * pNtk)

Definition at line 75 of file giaTranStoch.c.

75 {
76 Gia_Man_t * pGia;
77 Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
78 pGia = Gia_ManFromAig( pAig );
79 Aig_ManStop( pAig );
80 return pGia;
81}
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition giaAig.c:76
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition abcDar.c:237
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochIf()

Abc_Ntk_t * Gia_ManTranStochIf ( Abc_Ntk_t * pNtk)

Definition at line 63 of file giaTranStoch.c.

63 {
64 If_Par_t Pars, * pPars = &Pars;
65 If_ManSetDefaultPars( pPars );
67 pPars->nLutSize = pPars->pLutLib->LutMax;
68 return Abc_NtkIf( pNtk, pPars );
69}
ABC_DLL void * Abc_FrameReadLibLut()
Definition mainFrame.c:57
Abc_Ntk_t * Abc_NtkIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
Definition abcIf.c:107
struct If_Par_t_ If_Par_t
Definition if.h:78
struct If_LibLut_t_ If_LibLut_t
Definition if.h:82
void If_ManSetDefaultPars(If_Par_t *pPars)
FUNCTION DECLARATIONS ///.
Definition ifCore.c:47
int LutMax
Definition if.h:190
If_LibLut_t * pLutLib
Definition if.h:175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochLock()

void Gia_ManTranStochLock ( Gia_ManTranStochParam * p)

Definition at line 130 of file giaTranStoch.c.

130 {
131#ifdef ABC_USE_PTHREADS
132 if ( p->fWorking )
133 pthread_mutex_lock( p->mutex );
134#endif
135}
Here is the caller graph for this function:

◆ Gia_ManTranStochMfs2()

void Gia_ManTranStochMfs2 ( Abc_Ntk_t * pNtk)

Definition at line 70 of file giaTranStoch.c.

70 {
71 Sfm_Par_t Pars, * pPars = &Pars;
72 Sfm_ParSetDefault( pPars );
73 Abc_NtkPerformMfs( pNtk, pPars );
74}
int Abc_NtkPerformMfs(Abc_Ntk_t *pNtk, Sfm_Par_t *pPars)
Definition abcMfs.c:357
struct Sfm_Par_t_ Sfm_Par_t
Definition sfm.h:42
void Sfm_ParSetDefault(Sfm_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition sfmCore.c:46
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochOpt1()

Gia_Man_t * Gia_ManTranStochOpt1 ( Gia_ManTranStochParam * p,
Gia_Man_t * pOld )

Definition at line 143 of file giaTranStoch.c.

143 {
144 Gia_Man_t * pGia, * pNew;
145 int i = 0, n;
146 pGia = Gia_ManDup( pOld );
147 do {
148 n = Gia_ManAndNum( pGia );
149 if ( p->fTruth )
150 pNew = Gia_ManTransductionTt( pGia, (p->fMerge? 8: 7), p->fMspf, p->nSeed++, 0, 0, 0, 0, p->pExdc, p->fNewLine, p->nVerbose > 0? p->nVerbose - 1: 0 );
151 else
152 pNew = Gia_ManTransductionBdd( pGia, (p->fMerge? 8: 7), p->fMspf, p->nSeed++, 0, 0, 0, 0, p->pExdc, p->fNewLine, p->nVerbose > 0? p->nVerbose - 1: 0 );
153 Gia_ManStop( pGia );
154 pGia = pNew;
155 if ( p->fRefactor ) {
156 pNew = Gia_ManTranStochRefactor( pGia );
157 Gia_ManStop( pGia );
158 pGia = pNew;
159 } else {
161 pNew = Gia_ManCompress2( pGia, 1, 0 );
163 Gia_ManStop( pGia );
164 pGia = pNew;
165 }
166 if ( p->nVerbose )
167 printf( "* ite %d : #nodes = %5d\n", i, Gia_ManAndNum( pGia ) );
168 i++;
169 } while ( n > Gia_ManAndNum( pGia ) );
170 return pGia;
171}
Gia_Man_t * Gia_ManCompress2(Gia_Man_t *p, int fUpdateLevel, int fVerbose)
Definition giaAig.c:592
void Gia_ManTranStochLock(Gia_ManTranStochParam *p)
void Gia_ManTranStochUnlock(Gia_ManTranStochParam *p)
Gia_Man_t * Gia_ManTranStochRefactor(Gia_Man_t *pGia)
Gia_Man_t * Gia_ManTransductionTt(Gia_Man_t *pGia, int nType, int fMspf, int nRandom, int nSortType, int nPiShuffle, int nParameter, int fLevel, Gia_Man_t *pExdc, int fNewLine, int nVerbose)
Gia_Man_t * Gia_ManTransductionBdd(Gia_Man_t *pGia, int nType, int fMspf, int nRandom, int nSortType, int nPiShuffle, int nParameter, int fLevel, Gia_Man_t *pExdc, int fNewLine, int nVerbose)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochOpt2()

Gia_Man_t * Gia_ManTranStochOpt2 ( Gia_ManTranStochParam * p)

Definition at line 173 of file giaTranStoch.c.

173 {
174 int i, n = Gia_ManAndNum( p->pStart );
175 Gia_Man_t * pGia, * pBest, * pNew;
176 Abc_Ntk_t * pNtk, * pNtkRes;
177 pGia = Gia_ManDup( p->pStart );
178 pBest = Gia_ManDup( pGia );
179 for ( i = 0; 1; i++ ) {
180 pNew = Gia_ManTranStochOpt1( p, pGia );
181 Gia_ManStop( pGia );
182 pGia = pNew;
183 if ( n > Gia_ManAndNum( pGia ) ) {
184 n = Gia_ManAndNum( pGia );
185 Gia_ManStop( pBest );
186 pBest = Gia_ManDup( pGia );
187 if ( p->fResetHop )
188 i = 0;
189 }
190 if ( i == p->nHops )
191 break;
192 if ( p->fZeroCostHop ) {
193 pNew = Gia_ManTranStochRefactor( pGia );
194 Gia_ManStop( pGia );
195 pGia = pNew;
196 } else {
198 pNtk = Gia_ManTranStochPut( pGia );
200 Gia_ManStop( pGia );
201 pNtkRes = Gia_ManTranStochIf( pNtk );
202 Abc_NtkDelete( pNtk );
203 pNtk = pNtkRes;
204 Gia_ManTranStochMfs2( pNtk );
206 pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
208 Abc_NtkDelete( pNtk );
209 pNtk = pNtkRes;
210 pGia = Gia_ManTranStochGet( pNtk );
211 Abc_NtkDelete( pNtk );
212 }
213 if ( p->nVerbose )
214 printf( "* hop %d : #nodes = %5d\n", i, Gia_ManAndNum( pGia ) );
215 }
216 Gia_ManStop( pGia );
217 return pBest;
218}
void Gia_ManTranStochMfs2(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Gia_ManTranStochIf(Abc_Ntk_t *pNtk)
Gia_Man_t * Gia_ManTranStochOpt1(Gia_ManTranStochParam *p, Gia_Man_t *pOld)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochOpt3()

Gia_Man_t * Gia_ManTranStochOpt3 ( Gia_ManTranStochParam * p)

Definition at line 220 of file giaTranStoch.c.

220 {
221 int i, n = Gia_ManAndNum( p->pStart );
222 Gia_Man_t * pBest, * pNew;
223 pBest = Gia_ManDup( p->pStart );
224 for ( i = 0; i <= p->nRestarts; i++ ) {
225 p->nSeed = 1234 * (i + p->nSeedBase);
226 pNew = Gia_ManTranStochOpt2( p );
227 if ( p->nRestarts && p->nVerbose )
228 printf( "* res %2d : #nodes = %5d\n", i, Gia_ManAndNum( pNew ) );
229 if ( n > Gia_ManAndNum( pNew ) ) {
230 n = Gia_ManAndNum( pNew );
231 Gia_ManStop( pBest );
232 pBest = pNew;
233 } else {
234 Gia_ManStop( pNew );
235 }
236 }
237 return pBest;
238}
Gia_Man_t * Gia_ManTranStochOpt2(Gia_ManTranStochParam *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochPut()

Abc_Ntk_t * Gia_ManTranStochPut ( Gia_Man_t * pGia)

Definition at line 56 of file giaTranStoch.c.

56 {
57 Abc_Ntk_t * pNtk;
58 Aig_Man_t * pMan = Gia_ManToAig( pGia, 0 );
59 pNtk = Abc_NtkFromAigPhase( pMan );
60 Aig_ManStop( pMan );
61 return pNtk;
62}
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition giaAig.c:318
ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
DECLARATIONS ///.
Definition abcDar.c:595
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochRefactor()

Gia_Man_t * Gia_ManTranStochRefactor ( Gia_Man_t * pGia)

Definition at line 88 of file giaTranStoch.c.

88 {
89 Gia_Man_t * pNew;
90 Aig_Man_t * pAig, * pTemp;
91 Dar_RefPar_t Pars, * pPars = &Pars;
93 pPars->fUseZeros = 1;
94 pAig = Gia_ManToAig( pGia, 0 );
95 Dar_ManRefactor( pAig, pPars );
96 pAig = Aig_ManDupDfs( pTemp = pAig );
97 Aig_ManStop( pTemp );
98 pNew = Gia_ManFromAig( pAig );
99 Aig_ManStop( pAig );
100 return pNew;
101}
Aig_Man_t * Aig_ManDupDfs(Aig_Man_t *p)
Definition aigDup.c:563
int Dar_ManRefactor(Aig_Man_t *pAig, Dar_RefPar_t *pPars)
Definition darRefact.c:496
struct Dar_RefPar_t_ Dar_RefPar_t
Definition dar.h:43
void Dar_ManDefaultRefParams(Dar_RefPar_t *pPars)
FUNCTION DEFINITIONS ///.
Definition darRefact.c:85
int fUseZeros
Definition dar.h:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManTranStochUnlock()

void Gia_ManTranStochUnlock ( Gia_ManTranStochParam * p)

Definition at line 136 of file giaTranStoch.c.

136 {
137#ifdef ABC_USE_PTHREADS
138 if ( p->fWorking )
139 pthread_mutex_unlock( p->mutex );
140#endif
141}
Here is the caller graph for this function: