ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcTim.c File Reference
#include "base/abc/abc.h"
#include "aig/gia/giaAig.h"
#include "misc/tim/tim.h"
#include "opt/dar/dar.h"
#include "proof/dch/dch.h"
#include "base/main/main.h"
Include dependency graph for abcTim.c:

Go to the source code of this file.

Macros

#define TIM_TEST_BOX_RATIO   200
 DECLARATIONS ///.
 

Functions

void Abc_NtkTestTimNodeStrash_rec (Gia_Man_t *pGia, Hop_Obj_t *pObj)
 FUNCTION DEFINITIONS ///.
 
int Abc_NtkTestTimNodeStrash (Gia_Man_t *pGia, Abc_Obj_t *pNode)
 
void Abc_NtkTestTimCollectCone_rec (Abc_Obj_t *pObj, Vec_Ptr_t *vNodes)
 
Vec_Ptr_tAbc_NtkTestTimCollectCone (Abc_Ntk_t *pNtk, Abc_Obj_t *pObj)
 
Vec_Flt_tAbc_NtkTestCreateArrivals (int nInputs)
 
Vec_Flt_tAbc_NtkTestCreateRequired (int nOutputs)
 
Gia_Man_tAbc_NtkTestTimDeriveGia (Abc_Ntk_t *pNtk, int fVerbose)
 
Gia_Man_tAbc_NtkTestTimPerformSynthesis (Gia_Man_t *p, int fChoices)
 
void Gia_ManVerifyChoices (Gia_Man_t *p)
 
void Gia_ManReverseClasses (Gia_Man_t *p, int fNowIncreasing)
 
void Abc_NtkTestTimByWritingFile (Gia_Man_t *pGia, char *pFileName)
 
void Abc_NtkTestTim (Abc_Ntk_t *pNtk, int fVerbose)
 

Macro Definition Documentation

◆ TIM_TEST_BOX_RATIO

#define TIM_TEST_BOX_RATIO   200

DECLARATIONS ///.

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

FileName [abcTim.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Testing hierarchy/timing manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 34 of file abcTim.c.

Function Documentation

◆ Abc_NtkTestCreateArrivals()

Vec_Flt_t * Abc_NtkTestCreateArrivals ( int nInputs)

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

Synopsis [Create arrival times]

Description []

SideEffects []

SeeAlso []

Definition at line 241 of file abcTim.c.

242{
243 Vec_Flt_t * p;
244 int i;
245 p = Vec_FltAlloc( nInputs );
246 for ( i = 0; i < nInputs; i++ )
247 Vec_FltPush( p, 1.0*(i % 10) );
248 return p;
249}
Cube * p
Definition exorList.c:222
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition vecFlt.h:42
Here is the caller graph for this function:

◆ Abc_NtkTestCreateRequired()

Vec_Flt_t * Abc_NtkTestCreateRequired ( int nOutputs)

Definition at line 250 of file abcTim.c.

251{
252 Vec_Flt_t * p;
253 int i;
254 p = Vec_FltAlloc( nOutputs );
255 for ( i = 0; i < nOutputs; i++ )
256 Vec_FltPush( p, 100.0 + 1.0*i );
257 return p;
258}
Here is the caller graph for this function:

◆ Abc_NtkTestTim()

void Abc_NtkTestTim ( Abc_Ntk_t * pNtk,
int fVerbose )

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

Synopsis [Tests construction and serialization.]

Description []

SideEffects []

SeeAlso []

Definition at line 596 of file abcTim.c.

597{
598 int fUseChoices = 0;
599 Gia_Man_t * pGia, * pTemp;
600
601 // this test only works for a logic network (for example, network with LUT mapping)
602 assert( Abc_NtkIsLogic(pNtk) );
603 // make sure local functions of the nodes are in the AIG form
604 Abc_NtkToAig( pNtk );
605
606 // create GIA manager (pGia) with hierarhy/timing manager attached (pGia->pManTime)
607 // while assuming that some nodes are white boxes (see Abc_NodeIsWhiteBox)
608 pGia = Abc_NtkTestTimDeriveGia( pNtk, fVerbose );
609 printf( "Created GIA manager for network with %d white boxes.\n", Tim_ManBoxNum((Tim_Man_t *)pGia->pManTime) );
610
611 // print the timing manager
612 if ( fVerbose )
613 Tim_ManPrint( (Tim_Man_t *)pGia->pManTime );
614
615 // test writing both managers into a file and reading them back
616 Abc_NtkTestTimByWritingFile( pGia, "test1.aig" );
617
618 // perform synthesis
619 pGia = Abc_NtkTestTimPerformSynthesis( pTemp = pGia, fUseChoices );
620 Gia_ManStop( pTemp );
621
622 // test writing both managers into a file and reading them back
623 Abc_NtkTestTimByWritingFile( pGia, "test2.aig" );
624
625 Gia_ManStop( pGia );
626}
void Abc_NtkTestTimByWritingFile(Gia_Man_t *pGia, char *pFileName)
Definition abcTim.c:552
Gia_Man_t * Abc_NtkTestTimDeriveGia(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcTim.c:271
Gia_Man_t * Abc_NtkTestTimPerformSynthesis(Gia_Man_t *p, int fChoices)
Definition abcTim.c:413
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1333
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
void * pManTime
Definition gia.h:194
int Tim_ManBoxNum(Tim_Man_t *p)
Definition timMan.c:722
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition tim.h:92
void Tim_ManPrint(Tim_Man_t *p)
Definition timMan.c:526
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Abc_NtkTestTimByWritingFile()

void Abc_NtkTestTimByWritingFile ( Gia_Man_t * pGia,
char * pFileName )

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

Synopsis [Tests the hierarchy-timing manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 552 of file abcTim.c.

553{
554 Gia_Man_t * pGia2;
555
556 // normalize choices
557 if ( Gia_ManHasChoices(pGia) )
558 {
559 Gia_ManVerifyChoices( pGia );
560 Gia_ManReverseClasses( pGia, 0 );
561 }
562 // write file
563 Gia_AigerWrite( pGia, pFileName, 0, 0, 0 );
564 // unnormalize choices
565 if ( Gia_ManHasChoices(pGia) )
566 Gia_ManReverseClasses( pGia, 1 );
567
568 // read file
569 pGia2 = Gia_AigerRead( pFileName, 0, 1, 1 );
570
571 // normalize choices
572 if ( Gia_ManHasChoices(pGia2) )
573 {
574 Gia_ManVerifyChoices( pGia2 );
575 Gia_ManReverseClasses( pGia2, 1 );
576 }
577
578 // compare resulting managers
579 if ( Gia_ManCompare( pGia, pGia2 ) )
580 printf( "Verification suceessful.\n" );
581
582 Gia_ManStop( pGia2 );
583}
void Gia_ManReverseClasses(Gia_Man_t *p, int fNowIncreasing)
Definition abcTim.c:492
void Gia_ManVerifyChoices(Gia_Man_t *p)
Definition abcTim.c:443
Gia_Man_t * Gia_AigerRead(char *pFileName, int fGiaSimple, int fSkipStrash, int fCheck)
Definition giaAiger.c:1017
int Gia_ManCompare(Gia_Man_t *p1, Gia_Man_t *p2)
Definition giaUtil.c:1737
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
Definition giaAiger.c:1595
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTestTimCollectCone()

Vec_Ptr_t * Abc_NtkTestTimCollectCone ( Abc_Ntk_t * pNtk,
Abc_Obj_t * pObj )

Definition at line 206 of file abcTim.c.

207{
208 Vec_Ptr_t * vCone = Vec_PtrAlloc( 1000 );
209 if ( pObj != NULL )
210 {
211 // collect for one node
212 assert( Abc_ObjIsNode(pObj) );
213 assert( !Abc_NodeIsTravIdCurrent( pObj ) );
214 Abc_NtkTestTimCollectCone_rec( pObj, vCone );
215 // remove the node because it is a white box
216 Vec_PtrPop( vCone );
217 }
218 else
219 {
220 // collect for all COs
221 Abc_Obj_t * pObj;
222 int i;
223 Abc_NtkForEachCo( pNtk, pObj, i )
224 Abc_NtkTestTimCollectCone_rec( Abc_ObjFanin0(pObj), vCone );
225 }
226 return vCone;
227
228}
void Abc_NtkTestTimCollectCone_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition abcTim.c:192
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:

◆ Abc_NtkTestTimCollectCone_rec()

void Abc_NtkTestTimCollectCone_rec ( Abc_Obj_t * pObj,
Vec_Ptr_t * vNodes )

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

Synopsis [Collect nodes reachable from this box.]

Description []

SideEffects []

SeeAlso []

Definition at line 192 of file abcTim.c.

193{
194 Abc_Obj_t * pFanin;
195 int i;
196 if ( Abc_NodeIsTravIdCurrent( pObj ) )
197 return;
198 Abc_NodeSetTravIdCurrent( pObj );
199 if ( Abc_ObjIsCi(pObj) )
200 return;
201 assert( Abc_ObjIsNode( pObj ) );
202 Abc_ObjForEachFanin( pObj, pFanin, i )
203 Abc_NtkTestTimCollectCone_rec( pFanin, vNodes );
204 Vec_PtrPush( vNodes, pObj );
205}
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTestTimDeriveGia()

Gia_Man_t * Abc_NtkTestTimDeriveGia ( Abc_Ntk_t * pNtk,
int fVerbose )

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

Synopsis [Derives GIA manager together with the hierachy manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 271 of file abcTim.c.

272{
273 Gia_Man_t * pTemp;
274 Gia_Man_t * pGia = NULL;
275 Gia_Man_t * pHoles = NULL;
276 Tim_Man_t * pTim = NULL;
277 Vec_Int_t * vGiaCoLits, * vGiaCoLits2;
278 Vec_Flt_t * vArrTimes, * vReqTimes;
279 Abc_Obj_t * pObj, * pFanin;
280 int i, k, Entry, curPi, curPo, BoxUniqueId;
281 int nBoxFaninMax = 0;
282 assert( Abc_NtkIsTopo(pNtk) );
283 Abc_NtkFillTemp( pNtk );
284
285 // create white boxes
286 curPi = Abc_NtkCiNum(pNtk);
287 curPo = Abc_NtkCoNum(pNtk);
288 Abc_NtkForEachNode( pNtk, pObj, i )
289 {
290 pObj->fMarkA = Abc_NodeIsWhiteBox( pObj );
291 if ( !pObj->fMarkA )
292 continue;
293 nBoxFaninMax = Abc_MaxInt( nBoxFaninMax, Abc_ObjFaninNum(pObj) );
294 curPi++;
295 curPo += Abc_ObjFaninNum(pObj);
296 if ( fVerbose )
297 printf( "Selecting node %6d as white boxes with %d inputs and %d output.\n", i, Abc_ObjFaninNum(pObj), 1 );
298 }
299
300 // construct GIA
301 pGia = Gia_ManStart( Abc_NtkObjNumMax(pNtk) );
302 pHoles = Gia_ManStart( 1000 );
303 for ( i = 0; i < curPi; i++ )
304 Gia_ManAppendCi(pGia);
305 for ( i = 0; i < nBoxFaninMax; i++ )
306 Gia_ManAppendCi(pHoles);
307 Gia_ManHashAlloc( pGia );
308 Gia_ManHashAlloc( pHoles );
309
310 // construct the timing manager
311 pTim = Tim_ManStart( curPi, curPo );
312
313 // assign primary inputs
314 curPi = 0;
315 curPo = 0;
316 Abc_NtkForEachCi( pNtk, pObj, i )
317 pObj->iTemp = Abc_Var2Lit( Gia_ObjId(pGia, Gia_ManCi(pGia, curPi++)), 0 );
318 // create internal nodes in a topologic order from white boxes
319 vGiaCoLits = Vec_IntAlloc( 1000 );
320 vGiaCoLits2 = Vec_IntAlloc( 1000 );
321 Abc_NtkForEachNode( pNtk, pObj, i )
322 {
323 if ( !pObj->fMarkA ) // not a white box
324 {
325 pObj->iTemp = Abc_NtkTestTimNodeStrash( pGia, pObj );
326 continue;
327 }
328 // create box
329 BoxUniqueId = Abc_ObjFaninNum(pObj); // in this case, the node size is the ID of its delay table
330 Tim_ManCreateBox( pTim, curPo, Abc_ObjFaninNum(pObj), curPi, 1, BoxUniqueId, 0 );
331 curPo += Abc_ObjFaninNum(pObj);
332
333 // handle box inputs
334 Abc_ObjForEachFanin( pObj, pFanin, k )
335 {
336 // save CO drivers for the AIG
337 Vec_IntPush( vGiaCoLits, pFanin->iTemp );
338 // load CI nodes for the Holes
339 pFanin->iTemp = Abc_Var2Lit( Gia_ObjId(pHoles, Gia_ManCi(pHoles, k)), 0 );
340 }
341
342 // handle logic of the box
343 pObj->iTemp = Abc_NtkTestTimNodeStrash( pHoles, pObj );
344
345 // handle box outputs
346 // save CO drivers for the Holes
347 Vec_IntPush( vGiaCoLits2, pObj->iTemp );
348// Gia_ManAppendCo( pHoles, pObj->iTemp );
349 // load CO drivers for the AIG
350 pObj->iTemp = Abc_Var2Lit( Gia_ObjId(pGia, Gia_ManCi(pGia, curPi++)), 0 );
351 }
352 Abc_NtkCleanMarkA( pNtk );
353 // create COs of the AIG
354 Abc_NtkForEachCo( pNtk, pObj, i )
355 Gia_ManAppendCo( pGia, Abc_ObjFanin0(pObj)->iTemp );
356 Vec_IntForEachEntry( vGiaCoLits, Entry, i )
357 Gia_ManAppendCo( pGia, Entry );
358 Vec_IntFree( vGiaCoLits );
359 // second AIG
360 Vec_IntForEachEntry( vGiaCoLits2, Entry, i )
361 Gia_ManAppendCo( pHoles, Entry );
362 Vec_IntFree( vGiaCoLits2 );
363 // check parameters
364 curPo += Abc_NtkPoNum( pNtk );
365 assert( curPi == Gia_ManPiNum(pGia) );
366 assert( curPo == Gia_ManPoNum(pGia) );
367 // finalize GIA
368 Gia_ManHashStop( pGia );
369 Gia_ManSetRegNum( pGia, 0 );
370 Gia_ManHashStop( pHoles );
371 Gia_ManSetRegNum( pHoles, 0 );
372
373 // clean up GIA
374 pGia = Gia_ManCleanup( pTemp = pGia );
375 Gia_ManStop( pTemp );
376 pHoles = Gia_ManCleanup( pTemp = pHoles );
377 Gia_ManStop( pTemp );
378
379 // attach the timing manager
380 assert( pGia->pManTime == NULL );
381 pGia->pManTime = pTim;
382
383 // derive hierarchy manager from box info and input/output arrival/required info
384 vArrTimes = Abc_NtkTestCreateArrivals( Abc_NtkPiNum(pNtk) );
385 vReqTimes = Abc_NtkTestCreateRequired( Abc_NtkPoNum(pNtk) );
386
387 Tim_ManPrint( (Tim_Man_t *)pGia->pManTime );
388 Tim_ManCreate( (Tim_Man_t *)pGia->pManTime, Abc_FrameReadLibBox(), vArrTimes, vReqTimes );
389 Tim_ManPrint( (Tim_Man_t *)pGia->pManTime );
390
391 Vec_FltFree( vArrTimes );
392 Vec_FltFree( vReqTimes );
393
394Gia_AigerWrite( pHoles, "holes00.aig", 0, 0, 0 );
395
396 // return
397 pGia->pAigExtra = pHoles;
398 return pGia;
399}
int Abc_NtkTestTimNodeStrash(Gia_Man_t *pGia, Abc_Obj_t *pNode)
Definition abcTim.c:65
Vec_Flt_t * Abc_NtkTestCreateArrivals(int nInputs)
Definition abcTim.c:241
Vec_Flt_t * Abc_NtkTestCreateRequired(int nOutputs)
Definition abcTim.c:250
ABC_DLL void Abc_NtkCleanMarkA(Abc_Ntk_t *pNtk)
Definition abcUtil.c:696
ABC_DLL int Abc_NtkIsTopo(Abc_Ntk_t *pNtk)
Definition abcUtil.c:2888
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_DLL void Abc_NtkFillTemp(Abc_Ntk_t *pNtk)
Definition abcUtil.c:586
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
ABC_DLL void * Abc_FrameReadLibBox()
Definition mainFrame.c:58
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition giaMan.c:764
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
int iTemp
Definition abc.h:149
unsigned fMarkA
Definition abc.h:134
Gia_Man_t * pAigExtra
Definition gia.h:167
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable, int fBlack)
ITERATORS ///.
Definition timBox.c:44
void Tim_ManCreate(Tim_Man_t *p, void *pLib, Vec_Flt_t *vInArrs, Vec_Flt_t *vOutReqs)
Definition timMan.c:406
Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
Definition timMan.c:45
#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:

◆ Abc_NtkTestTimNodeStrash()

int Abc_NtkTestTimNodeStrash ( Gia_Man_t * pGia,
Abc_Obj_t * pNode )

Definition at line 65 of file abcTim.c.

66{
67 Hop_Man_t * pMan;
68 Hop_Obj_t * pRoot;
69 Abc_Obj_t * pFanin;
70 int i;
71 assert( Abc_ObjIsNode(pNode) );
72 assert( Abc_NtkIsAigLogic(pNode->pNtk) );
73 // get the local AIG manager and the local root node
74 pMan = (Hop_Man_t *)pNode->pNtk->pManFunc;
75 pRoot = (Hop_Obj_t *)pNode->pData;
76 // check the constant case
77 if ( Abc_NodeIsConst(pNode) || Hop_Regular(pRoot) == Hop_ManConst1(pMan) )
78 return !Hop_IsComplement(pRoot);
79 // set elementary variables
80 Abc_ObjForEachFanin( pNode, pFanin, i )
81 Hop_IthVar(pMan, i)->iData = pFanin->iTemp;
82 // strash the AIG of this node
83 Abc_NtkTestTimNodeStrash_rec( pGia, Hop_Regular(pRoot) );
84 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
85 // return the final node with complement if needed
86 return Abc_LitNotCond( Hop_Regular(pRoot)->iData, Hop_IsComplement(pRoot) );
87}
void Abc_NtkTestTimNodeStrash_rec(Gia_Man_t *pGia, Hop_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition abcTim.c:54
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition abcObj.c:867
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:257
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition hopOper.c:63
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
Abc_Ntk_t * pNtk
Definition abc.h:130
int iData
Definition hop.h:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTestTimNodeStrash_rec()

void Abc_NtkTestTimNodeStrash_rec ( Gia_Man_t * pGia,
Hop_Obj_t * pObj )

FUNCTION DEFINITIONS ///.

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

Synopsis [Derives GIA for the output of the local function of one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 54 of file abcTim.c.

55{
56 assert( !Hop_IsComplement(pObj) );
57 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
58 return;
59 Abc_NtkTestTimNodeStrash_rec( pGia, Hop_ObjFanin0(pObj) );
60 Abc_NtkTestTimNodeStrash_rec( pGia, Hop_ObjFanin1(pObj) );
61 pObj->iData = Gia_ManHashAnd( pGia, Hop_ObjChild0CopyI(pObj), Hop_ObjChild1CopyI(pObj) );
62 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
63 Hop_ObjSetMarkA( pObj );
64}
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkTestTimPerformSynthesis()

Gia_Man_t * Abc_NtkTestTimPerformSynthesis ( Gia_Man_t * p,
int fChoices )

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

Synopsis [Performs synthesis with or without structural choices.]

Description []

SideEffects []

SeeAlso []

Definition at line 413 of file abcTim.c.

414{
415 Gia_Man_t * pGia;
416 Aig_Man_t * pNew, * pTemp;
417 Dch_Pars_t Pars, * pPars = &Pars;
419 pNew = Gia_ManToAig( p, 0 );
420 if ( fChoices )
421 pNew = Dar_ManChoiceNew( pNew, pPars );
422 else
423 {
424 pNew = Dar_ManCompress2( pTemp = pNew, 1, 1, 1, 0, 0 );
425 Aig_ManStop( pTemp );
426 }
427 pGia = Gia_ManFromAig( pNew );
428 Aig_ManStop( pNew );
429 return pGia;
430}
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
Aig_Man_t * Dar_ManChoiceNew(Aig_Man_t *pAig, Dch_Pars_t *pPars)
Definition darScript.c:849
Aig_Man_t * Dar_ManCompress2(Aig_Man_t *pAig, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose)
Definition darScript.c:235
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition dch.h:43
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition dchCore.c:45
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition giaAig.c:76
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition giaAig.c:318
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManReverseClasses()

void Gia_ManReverseClasses ( Gia_Man_t * p,
int fNowIncreasing )

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

Synopsis [Reverse the order of nodes in equiv classes.]

Description [If the flag is 1, assumed current increasing order ]

SideEffects []

SeeAlso []

Definition at line 492 of file abcTim.c.

493{
494 Vec_Int_t * vCollected;
495 Vec_Int_t * vClass;
496 int i, k, iRepr, iNode, iPrev;
497 // collect classes
498 vCollected = Vec_IntAlloc( 100 );
499 Gia_ManForEachClass( p, iRepr )
500 Vec_IntPush( vCollected, iRepr );
501 // correct each class
502 vClass = Vec_IntAlloc( 100 );
503 Vec_IntForEachEntry( vCollected, iRepr, i )
504 {
505 Vec_IntClear( vClass );
506 Vec_IntPush( vClass, iRepr );
507 Gia_ClassForEachObj1( p, iRepr, iNode )
508 {
509 if ( fNowIncreasing )
510 assert( iRepr < iNode );
511 else
512 assert( iRepr > iNode );
513 Vec_IntPush( vClass, iNode );
514 }
515// if ( !fNowIncreasing )
516// Vec_IntSort( vClass, 1 );
517 // reverse the class
518 iPrev = 0;
519 iRepr = Vec_IntEntryLast( vClass );
520 Vec_IntForEachEntry( vClass, iNode, k )
521 {
522 if ( fNowIncreasing )
523 Gia_ObjSetReprRev( p, iNode, iNode == iRepr ? GIA_VOID : iRepr );
524 else
525 Gia_ObjSetRepr( p, iNode, iNode == iRepr ? GIA_VOID : iRepr );
526 Gia_ObjSetNext( p, iNode, iPrev );
527 iPrev = iNode;
528 }
529 }
530 Vec_IntFree( vCollected );
531 Vec_IntFree( vClass );
532 // verify
533 Gia_ManForEachClass( p, iRepr )
534 Gia_ClassForEachObj1( p, iRepr, iNode )
535 if ( fNowIncreasing )
536 assert( Gia_ObjRepr(p, iNode) == iRepr && iRepr > iNode );
537 else
538 assert( Gia_ObjRepr(p, iNode) == iRepr && iRepr < iNode );
539}
#define Gia_ClassForEachObj1(p, i, iObj)
Definition gia.h:1109
#define Gia_ManForEachClass(p, i)
Definition gia.h:1101
#define GIA_VOID
Definition gia.h:46
Here is the caller graph for this function:

◆ Gia_ManVerifyChoices()

void Gia_ManVerifyChoices ( Gia_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 443 of file abcTim.c.

444{
445 Gia_Obj_t * pObj;
446 int i, iRepr, iNode, fProb = 0;
447 assert( p->pReprs );
448
449 // mark nodes
451 Gia_ManForEachClass( p, iRepr )
452 Gia_ClassForEachObj1( p, iRepr, iNode )
453 {
454 if ( Gia_ObjIsHead(p, iNode) )
455 printf( "Member %d of choice class %d is a representative.\n", iNode, iRepr ), fProb = 1;
456 if ( Gia_ManObj( p, iNode )->fMark0 == 1 )
457 printf( "Node %d participates in more than one choice node.\n", iNode ), fProb = 1;
458 Gia_ManObj( p, iNode )->fMark0 = 1;
459 }
461
462 Gia_ManForEachObj( p, pObj, i )
463 {
464 if ( Gia_ObjIsAnd(pObj) )
465 {
466 if ( Gia_ObjHasRepr(p, Gia_ObjFaninId0(pObj, i)) )
467 printf( "Fanin 0 of AND node %d has a repr.\n", i ), fProb = 1;
468 if ( Gia_ObjHasRepr(p, Gia_ObjFaninId1(pObj, i)) )
469 printf( "Fanin 1 of AND node %d has a repr.\n", i ), fProb = 1;
470 }
471 else if ( Gia_ObjIsCo(pObj) )
472 {
473 if ( Gia_ObjHasRepr(p, Gia_ObjFaninId0(pObj, i)) )
474 printf( "Fanin 0 of CO node %d has a repr.\n", i ), fProb = 1;
475 }
476 }
477// if ( !fProb )
478// printf( "GIA with choices is correct.\n" );
479}
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition giaUtil.c:256
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
Here is the call graph for this function:
Here is the caller graph for this function: