ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcIvy.c File Reference
#include "base/abc/abc.h"
#include "bool/dec/dec.h"
#include "proof/fra/fra.h"
#include "aig/ivy/ivy.h"
#include "proof/fraig/fraig.h"
#include "map/mio/mio.h"
#include "aig/aig/aig.h"
#include "aig/gia/gia.h"
Include dependency graph for abcIvy.c:

Go to the source code of this file.

Typedefs

typedef int Abc_Edge_t
 

Functions

ABC_NAMESPACE_IMPL_START Aig_Man_tAbc_NtkToDar (Abc_Ntk_t *pNtk, int fExors, int fRegisters)
 DECLARATIONS ///.
 
void Aig_ManStop (Aig_Man_t *pMan)
 
Ivy_Obj_tDec_GraphToNetworkIvy (Ivy_Man_t *pMan, Dec_Graph_t *pGraph)
 
void Ivy_CutComputeAll (Ivy_Man_t *p, int nInputs)
 
Ivy_Man_tAbc_NtkIvyBefore (Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
 FUNCTION DEFINITIONS ///.
 
Abc_Ntk_tAbc_NtkIvyAfter (Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
 
Abc_Ntk_tAbc_NtkIvyStrash (Abc_Ntk_t *pNtk)
 
Abc_Ntk_tAbc_NtkIvyHaig (Abc_Ntk_t *pNtk, int nIters, int fUseZeroCost, int fVerbose)
 
void Abc_NtkIvyCuts (Abc_Ntk_t *pNtk, int nInputs)
 
Abc_Ntk_tAbc_NtkIvyRewrite (Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvyRewriteSeq (Abc_Ntk_t *pNtk, int fUseZeroCost, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvyResyn0 (Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvyResyn (Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvySat (Abc_Ntk_t *pNtk, int nConfLimit, int fVerbose)
 
void Abc_NtkTransferPointers (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkAig)
 
Abc_Ntk_tAbc_NtkIvyFraig (Abc_Ntk_t *pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose)
 
int Abc_NtkIvyProve (Abc_Ntk_t **ppNtk, void *pPars)
 
Abc_Ntk_tAbc_NtkIvy (Abc_Ntk_t *pNtk)
 
Ivy_Man_tGia_ManToIvySimple (Gia_Man_t *p)
 
Gia_Man_tGia_ManFromIvySimple (Ivy_Man_t *p)
 
Gia_Man_tGia_ManIvyFraig (Gia_Man_t *p, int nConfLimit, int fUseProve, int fVerbose)
 
Gia_Man_tGia_ManIvyFraigTest (Gia_Man_t *p, int nConfLimit, int fVerbose)
 

Variables

int timeRetime
 DECLARATIONS ///.
 

Typedef Documentation

◆ Abc_Edge_t

typedef int Abc_Edge_t

Definition at line 56 of file abcIvy.c.

Function Documentation

◆ Abc_NtkIvy()

Abc_Ntk_t * Abc_NtkIvy ( Abc_Ntk_t * pNtk)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 632 of file abcIvy.c.

633{
634// Abc_Ntk_t * pNtkAig;
635 Ivy_Man_t * pMan;//, * pTemp;
636// int fCleanup = 1;
637// int nNodes;
638// int nLatches = Abc_NtkLatchNum(pNtk);
639 Vec_Int_t * vInit = Abc_NtkCollectLatchValuesIvy( pNtk, 0 );
640
641 assert( !Abc_NtkIsNetlist(pNtk) );
642 if ( Abc_NtkIsBddLogic(pNtk) )
643 {
644 if ( !Abc_NtkBddToSop(pNtk, -1, ABC_INFINITY, 1) )
645 {
646 Vec_IntFree( vInit );
647 printf( "Abc_NtkIvy(): Converting to SOPs has failed.\n" );
648 return NULL;
649 }
650 }
651 if ( Abc_NtkCountSelfFeedLatches(pNtk) )
652 {
653 printf( "Warning: The network has %d self-feeding latches. Quitting.\n", Abc_NtkCountSelfFeedLatches(pNtk) );
654 return NULL;
655 }
656
657 // print warning about choice nodes
658 if ( Abc_NtkGetChoiceNum( pNtk ) )
659 printf( "Warning: The choice nodes in the initial AIG are removed by strashing.\n" );
660
661 // convert to the AIG manager
662 pMan = Abc_NtkToIvy( pNtk );
663 if ( !Ivy_ManCheck( pMan ) )
664 {
665 Vec_IntFree( vInit );
666 printf( "AIG check has failed.\n" );
667 Ivy_ManStop( pMan );
668 return NULL;
669 }
670
671// Ivy_MffcTest( pMan );
672// Ivy_ManPrintStats( pMan );
673
674// pMan = Ivy_ManBalance( pTemp = pMan, 1 );
675// Ivy_ManStop( pTemp );
676
677// Ivy_ManSeqRewrite( pMan, 0, 0 );
678// Ivy_ManTestCutsAlg( pMan );
679// Ivy_ManTestCutsBool( pMan );
680// Ivy_ManRewriteAlg( pMan, 1, 1 );
681
682// pMan = Ivy_ManResyn( pTemp = pMan, 1, 0 );
683// Ivy_ManStop( pTemp );
684
685// Ivy_ManTestCutsAll( pMan );
686// Ivy_ManTestCutsTravAll( pMan );
687
688// Ivy_ManPrintStats( pMan );
689
690// Ivy_ManPrintStats( pMan );
691// Ivy_ManRewritePre( pMan, 1, 0, 0 );
692// Ivy_ManPrintStats( pMan );
693// printf( "\n" );
694
695// Ivy_ManPrintStats( pMan );
696// Ivy_ManMakeSeq( pMan, nLatches, pInit );
697// Ivy_ManPrintStats( pMan );
698
699// Ivy_ManRequiredLevels( pMan );
700
701// Ivy_FastMapPerform( pMan, 8 );
702 Ivy_ManStop( pMan );
703 return NULL;
704
705
706/*
707 // convert from the AIG manager
708 pNtkAig = Abc_NtkFromIvy( pNtk, pMan );
709// pNtkAig = Abc_NtkFromIvySeq( pNtk, pMan );
710 Ivy_ManStop( pMan );
711
712 // report the cleanup results
713 if ( fCleanup && (nNodes = Abc_AigCleanup(pNtkAig->pManFunc)) )
714 printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
715 // duplicate EXDC
716 if ( pNtk->pExdc )
717 pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
718 // make sure everything is okay
719 if ( !Abc_NtkCheck( pNtkAig ) )
720 {
721 ABC_FREE( pInit );
722 printf( "Abc_NtkStrash: The network check has failed.\n" );
723 Abc_NtkDelete( pNtkAig );
724 return NULL;
725 }
726
727 ABC_FREE( pInit );
728 return pNtkAig;
729*/
730}
ABC_DLL int Abc_NtkCountSelfFeedLatches(Abc_Ntk_t *pNtk)
Definition abcLatch.c:92
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition abcUtil.c:463
ABC_DLL int Abc_NtkBddToSop(Abc_Ntk_t *pNtk, int fMode, int nCubeLimit, int fCubeSort)
Definition abcFunc.c:866
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
int Ivy_ManCheck(Ivy_Man_t *p)
DECLARATIONS ///.
Definition ivyCheck.c:45
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition ivy.h:46
void Ivy_ManStop(Ivy_Man_t *p)
Definition ivyMan.c:238
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Abc_NtkIvyAfter()

Abc_Ntk_t * Abc_NtkIvyAfter ( Abc_Ntk_t * pNtk,
Ivy_Man_t * pMan,
int fSeq,
int fHaig )

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

Synopsis [Prepares the IVY package.]

Description []

SideEffects []

SeeAlso []

Definition at line 141 of file abcIvy.c.

142{
143 Abc_Ntk_t * pNtkAig;
144 int nNodes, fCleanup = 1;
145 // convert from the AIG manager
146 if ( fSeq )
147 pNtkAig = Abc_NtkFromIvySeq( pNtk, pMan, fHaig );
148 else
149 pNtkAig = Abc_NtkFromIvy( pNtk, pMan );
150 // report the cleanup results
151 if ( !fHaig && fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
152 printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
153 // duplicate EXDC
154 if ( pNtk->pExdc )
155 pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
156 // make sure everything is okay
157 if ( !Abc_NtkCheck( pNtkAig ) )
158 {
159 printf( "Abc_NtkStrash: The network check has failed.\n" );
160 Abc_NtkDelete( pNtkAig );
161 return NULL;
162 }
163 return pNtkAig;
164}
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_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition abcAig.c:194
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_Ntk_t * pExdc
Definition abc.h:201
void * pManFunc
Definition abc.h:191
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIvyBefore()

Ivy_Man_t * Abc_NtkIvyBefore ( Abc_Ntk_t * pNtk,
int fSeq,
int fUseDc )

FUNCTION DEFINITIONS ///.

DECLARATIONS ///.

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

Synopsis [Prepares the IVY package.]

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file abcIvy.c.

89{
90 Ivy_Man_t * pMan;
91//timeRetime = Abc_Clock();
92 assert( !Abc_NtkIsNetlist(pNtk) );
93 if ( Abc_NtkIsBddLogic(pNtk) )
94 {
95 if ( !Abc_NtkBddToSop(pNtk, -1, ABC_INFINITY, 1) )
96 {
97 printf( "Abc_NtkIvyBefore(): Converting to SOPs has failed.\n" );
98 return NULL;
99 }
100 }
101 if ( fSeq && Abc_NtkCountSelfFeedLatches(pNtk) )
102 {
103 printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtk) );
104// return NULL;
105 }
106 // print warning about choice nodes
107 if ( Abc_NtkGetChoiceNum( pNtk ) )
108 printf( "Warning: The choice nodes in the initial AIG are removed by strashing.\n" );
109 // convert to the AIG manager
110 pMan = Abc_NtkToIvy( pNtk );
111 if ( !Ivy_ManCheck( pMan ) )
112 {
113 printf( "AIG check has failed.\n" );
114 Ivy_ManStop( pMan );
115 return NULL;
116 }
117// Ivy_ManPrintStats( pMan );
118 if ( fSeq )
119 {
120 int nLatches = Abc_NtkLatchNum(pNtk);
121 Vec_Int_t * vInit = Abc_NtkCollectLatchValuesIvy( pNtk, fUseDc );
122 Ivy_ManMakeSeq( pMan, nLatches, vInit->pArray );
123 Vec_IntFree( vInit );
124// Ivy_ManPrintStats( pMan );
125 }
126//timeRetime = Abc_Clock() - timeRetime;
127 return pMan;
128}
void Ivy_ManMakeSeq(Ivy_Man_t *p, int nLatches, int *pInits)
Definition ivyMan.c:482
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIvyCuts()

void Abc_NtkIvyCuts ( Abc_Ntk_t * pNtk,
int nInputs )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 268 of file abcIvy.c.

269{
270 Ivy_Man_t * pMan;
271 pMan = Abc_NtkIvyBefore( pNtk, 1, 0 );
272 if ( pMan == NULL )
273 return;
274 Ivy_CutComputeAll( pMan, nInputs );
275 Ivy_ManStop( pMan );
276}
void Ivy_CutComputeAll(Ivy_Man_t *p, int nInputs)
Definition ivySeq.c:1108
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition abcIvy.c:88
Here is the call graph for this function:

◆ Abc_NtkIvyFraig()

Abc_Ntk_t * Abc_NtkIvyFraig ( Abc_Ntk_t * pNtk,
int nConfLimit,
int fDoSparse,
int fProve,
int fTransfer,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 460 of file abcIvy.c.

461{
462 Ivy_FraigParams_t Params, * pParams = &Params;
463 Abc_Ntk_t * pNtkAig;
464 Ivy_Man_t * pMan, * pTemp;
465 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
466 if ( pMan == NULL )
467 return NULL;
468 Ivy_FraigParamsDefault( pParams );
469 pParams->nBTLimitNode = nConfLimit;
470 pParams->fVerbose = fVerbose;
471 pParams->fProve = fProve;
472 pParams->fDoSparse = fDoSparse;
473 pMan = Ivy_FraigPerform( pTemp = pMan, pParams );
474 // transfer the pointers
475 if ( fTransfer == 1 )
476 {
477 Vec_Ptr_t * vCopies;
478 vCopies = Abc_NtkSaveCopy( pNtk );
479 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
480 Abc_NtkLoadCopy( pNtk, vCopies );
481 Vec_PtrFree( vCopies );
482 Abc_NtkTransferPointers( pNtk, pNtkAig );
483 }
484 else
485 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
486 pNtkAig->pModel = (int *)pMan->pData; pMan->pData = NULL;
487 Ivy_ManStop( pTemp );
488 Ivy_ManStop( pMan );
489 return pNtkAig;
490}
void Abc_NtkTransferPointers(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkAig)
Definition abcIvy.c:423
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition abcIvy.c:141
ABC_DLL void Abc_NtkLoadCopy(Abc_Ntk_t *pNtk, Vec_Ptr_t *vCopies)
Definition abcUtil.c:650
ABC_DLL Vec_Ptr_t * Abc_NtkSaveCopy(Abc_Ntk_t *pNtk)
Definition abcUtil.c:628
Ivy_Man_t * Ivy_FraigPerform(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Definition ivyFraig.c:451
void Ivy_FraigParamsDefault(Ivy_FraigParams_t *pParams)
FUNCTION DEFINITIONS ///.
Definition ivyFraig.c:225
struct Ivy_FraigParams_t_ Ivy_FraigParams_t
Definition ivy.h:49
int * pModel
Definition abc.h:198
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIvyHaig()

Abc_Ntk_t * Abc_NtkIvyHaig ( Abc_Ntk_t * pNtk,
int nIters,
int fUseZeroCost,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 200 of file abcIvy.c.

201{
202 Abc_Ntk_t * pNtkAig;
203 Ivy_Man_t * pMan;
204 abctime clk;
205// int i;
206/*
207extern int nMoves;
208extern int nMovesS;
209extern int nClauses;
210extern int timeInv;
211
212nMoves = 0;
213nMovesS = 0;
214nClauses = 0;
215timeInv = 0;
216*/
217 pMan = Abc_NtkIvyBefore( pNtk, 1, 1 );
218 if ( pMan == NULL )
219 return NULL;
220//timeRetime = Abc_Clock();
221
222clk = Abc_Clock();
223 Ivy_ManHaigStart( pMan, fVerbose );
224// Ivy_ManRewriteSeq( pMan, 0, 0 );
225// for ( i = 0; i < nIters; i++ )
226// Ivy_ManRewriteSeq( pMan, fUseZeroCost, 0 );
227
228//printf( "%d ", Ivy_ManNodeNum(pMan) );
229 Ivy_ManRewriteSeq( pMan, 0, 0 );
230 Ivy_ManRewriteSeq( pMan, 0, 0 );
231 Ivy_ManRewriteSeq( pMan, 1, 0 );
232//printf( "%d ", Ivy_ManNodeNum(pMan) );
233//printf( "%d ", Ivy_ManNodeNum(pMan->pHaig) );
234//ABC_PRT( " ", Abc_Clock() - clk );
235//printf( "\n" );
236/*
237 printf( "Moves = %d. ", nMoves );
238 printf( "MovesS = %d. ", nMovesS );
239 printf( "Clauses = %d. ", nClauses );
240 ABC_PRT( "Time", timeInv );
241*/
242// Ivy_ManRewriteSeq( pMan, 1, 0 );
243//printf( "Haig size = %d.\n", Ivy_ManNodeNum(pMan->pHaig) );
244// Ivy_ManHaigPostprocess( pMan, fVerbose );
245//timeRetime = Abc_Clock() - timeRetime;
246
247 // write working AIG into the current network
248// pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 1, 0 );
249 // write HAIG into the current network
250 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan->pHaig, 1, 1 );
251
252 Ivy_ManHaigStop( pMan );
253 Ivy_ManStop( pMan );
254 return pNtkAig;
255}
ABC_INT64_T abctime
Definition abc_global.h:332
int Ivy_ManRewriteSeq(Ivy_Man_t *p, int fUseZeroCost, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition ivySeq.c:63
void Ivy_ManHaigStop(Ivy_Man_t *p)
Definition ivyHaig.c:159
void Ivy_ManHaigStart(Ivy_Man_t *p, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition ivyHaig.c:94
Here is the call graph for this function:

◆ Abc_NtkIvyProve()

int Abc_NtkIvyProve ( Abc_Ntk_t ** ppNtk,
void * pPars )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 503 of file abcIvy.c.

504{
505 Prove_Params_t * pParams = (Prove_Params_t *)pPars;
506 Abc_Ntk_t * pNtk = *ppNtk, * pNtkTemp;
507 Abc_Obj_t * pObj, * pFanin;
508 Ivy_Man_t * pMan;
509 Aig_Man_t * pMan2;
510 int RetValue;
511 assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
512 // experiment with various parameters settings
513// pParams->fUseBdds = 1;
514// pParams->fBddReorder = 1;
515// pParams->nTotalBacktrackLimit = 10000;
516
517 // strash the network if it is not strashed already
518 if ( !Abc_NtkIsStrash(pNtk) )
519 {
520 pNtk = Abc_NtkStrash( pNtkTemp = pNtk, 0, 1, 0 );
521 Abc_NtkDelete( pNtkTemp );
522 }
523
524 // check the case when the 0000 simulation pattern detect the bug
525 pObj = Abc_NtkPo(pNtk,0);
526 pFanin = Abc_ObjFanin0(pObj);
527 if ( Abc_ObjFanin0(pObj)->fPhase != (unsigned)Abc_ObjFaninC0(pObj) )
528 {
529 pNtk->pModel = ABC_CALLOC( int, Abc_NtkCiNum(pNtk) );
530 return 0;
531 }
532
533 // changed in "src\sat\fraig\fraigMan.c"
534 // pParams->nMiteringLimitStart = 300; // starting mitering limit
535 // to be
536 // pParams->nMiteringLimitStart = 5000; // starting mitering limit
537
538 // if SAT only, solve without iteration
539// RetValue = Abc_NtkMiterSat( pNtk, 2*(ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, NULL, NULL );
540 pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
541 RetValue = Fra_FraigSat( pMan2, (ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, 0, 0, 1, 0, 0, 0 );
542 pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
543 Aig_ManStop( pMan2 );
544// pNtk->pModel = Aig_ManReleaseData( pMan2 );
545 if ( RetValue >= 0 )
546 return RetValue;
547
548 // apply AIG rewriting
549 if ( pParams->fUseRewriting && Abc_NtkNodeNum(pNtk) > 500 )
550 {
551// abctime clk = Abc_Clock();
552//printf( "Before rwsat = %d. ", Abc_NtkNodeNum(pNtk) );
553 pParams->fUseRewriting = 0;
554 pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 );
555 Abc_NtkDelete( pNtkTemp );
556 Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
557 pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 );
558 Abc_NtkDelete( pNtkTemp );
559 Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
560 Abc_NtkRefactor( pNtk, 10, 1, 16, 0, 0, 0, 0 );
561//printf( "After rwsat = %d. ", Abc_NtkNodeNum(pNtk) );
562//ABC_PRT( "Time", Abc_Clock() - clk );
563 }
564
565 // convert ABC network into IVY network
566 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
567
568 // solve the CEC problem
569 RetValue = Ivy_FraigProve( &pMan, pParams );
570// RetValue = -1;
571
572 // convert IVY network into ABC network
573 pNtk = Abc_NtkIvyAfter( pNtkTemp = pNtk, pMan, 0, 0 );
574 Abc_NtkDelete( pNtkTemp );
575 // transfer model if given
576 pNtk->pModel = (int *)pMan->pData; pMan->pData = NULL;
577 Ivy_ManStop( pMan );
578
579 // try to prove it using brute force SAT with good CNF encoding
580 if ( RetValue < 0 )
581 {
582 pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
583 // dump the miter before entering high-effort solving
584 if ( pParams->fVerbose )
585 {
586 char pFileName[100];
587 sprintf( pFileName, "cecmiter.aig" );
588 Ioa_WriteAiger( pMan2, pFileName, 0, 0 );
589 printf( "Intermediate reduced miter is written into file \"%s\".\n", pFileName );
590 }
591 RetValue = Fra_FraigSat( pMan2, pParams->nMiteringLimitLast, 0, 0, 0, 0, 0, 0, 0, pParams->fVerbose );
592 pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
593 Aig_ManStop( pMan2 );
594 }
595
596 // try to prove it using brute force BDDs
597#ifdef ABC_USE_CUDD
598 if ( RetValue < 0 && pParams->fUseBdds )
599 {
600 if ( pParams->fVerbose )
601 {
602 printf( "Attempting BDDs with node limit %d ...\n", pParams->nBddSizeLimit );
603 fflush( stdout );
604 }
605 pNtk = Abc_NtkCollapse( pNtkTemp = pNtk, pParams->nBddSizeLimit, 0, pParams->fBddReorder, 0, 0, 0 );
606 if ( pNtk )
607 {
608 Abc_NtkDelete( pNtkTemp );
609 RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc)) );
610 }
611 else
612 pNtk = pNtkTemp;
613 }
614#endif
615
616 // return the result
617 *ppNtk = pNtk;
618 return RetValue;
619}
void Aig_ManStop(Aig_Man_t *pMan)
Definition aigMan.c:187
ABC_NAMESPACE_IMPL_START Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition abcDar.c:237
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL Abc_Ntk_t * Abc_NtkCollapse(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fReverse, int fDumpOrder, int fVerbose)
DECLARATIONS ///.
ABC_DLL int Abc_NtkRewrite(Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
Definition abcRewrite.c:61
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition abcStrash.c:265
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition abcBalance.c:53
ABC_DLL int Abc_NtkRefactor(Abc_Ntk_t *pNtk, int nNodeSizeMax, int nMinSaved, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
int Fra_FraigSat(Aig_Man_t *pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fFlipBits, int fAndOuts, int fNewSolver, int fVerbose)
ITERATORS ///.
Definition fraCec.c:47
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
struct Prove_ParamsStruct_t_ Prove_Params_t
Definition ivyFraig.c:108
int Ivy_FraigProve(Ivy_Man_t **ppManAig, void *pPars)
Definition ivyFraig.c:255
char * sprintf()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIvyResyn()

Abc_Ntk_t * Abc_NtkIvyResyn ( Abc_Ntk_t * pNtk,
int fUpdateLevel,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 368 of file abcIvy.c.

369{
370 Abc_Ntk_t * pNtkAig;
371 Ivy_Man_t * pMan, * pTemp;
372 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
373 if ( pMan == NULL )
374 return NULL;
375 pMan = Ivy_ManResyn( pTemp = pMan, fUpdateLevel, fVerbose );
376 Ivy_ManStop( pTemp );
377 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
378 Ivy_ManStop( pMan );
379 return pNtkAig;
380}
Ivy_Man_t * Ivy_ManResyn(Ivy_Man_t *p, int fUpdateLevel, int fVerbose)
Definition ivyResyn.c:86
Here is the call graph for this function:

◆ Abc_NtkIvyResyn0()

Abc_Ntk_t * Abc_NtkIvyResyn0 ( Abc_Ntk_t * pNtk,
int fUpdateLevel,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 343 of file abcIvy.c.

344{
345 Abc_Ntk_t * pNtkAig;
346 Ivy_Man_t * pMan, * pTemp;
347 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
348 if ( pMan == NULL )
349 return NULL;
350 pMan = Ivy_ManResyn0( pTemp = pMan, fUpdateLevel, fVerbose );
351 Ivy_ManStop( pTemp );
352 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
353 Ivy_ManStop( pMan );
354 return pNtkAig;
355}
Ivy_Man_t * Ivy_ManResyn0(Ivy_Man_t *p, int fUpdateLevel, int fVerbose)
DECLARATIONS ///.
Definition ivyResyn.c:45
Here is the call graph for this function:

◆ Abc_NtkIvyRewrite()

Abc_Ntk_t * Abc_NtkIvyRewrite ( Abc_Ntk_t * pNtk,
int fUpdateLevel,
int fUseZeroCost,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 289 of file abcIvy.c.

290{
291 Abc_Ntk_t * pNtkAig;
292 Ivy_Man_t * pMan;
293 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
294 if ( pMan == NULL )
295 return NULL;
296//timeRetime = Abc_Clock();
297 Ivy_ManRewritePre( pMan, fUpdateLevel, fUseZeroCost, fVerbose );
298//timeRetime = Abc_Clock() - timeRetime;
299 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
300 Ivy_ManStop( pMan );
301 return pNtkAig;
302}
int Ivy_ManRewritePre(Ivy_Man_t *p, int fUpdateLevel, int fUseZeroCost, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition ivyRwr.c:55
Here is the call graph for this function:

◆ Abc_NtkIvyRewriteSeq()

Abc_Ntk_t * Abc_NtkIvyRewriteSeq ( Abc_Ntk_t * pNtk,
int fUseZeroCost,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 315 of file abcIvy.c.

316{
317 Abc_Ntk_t * pNtkAig;
318 Ivy_Man_t * pMan;
319 pMan = Abc_NtkIvyBefore( pNtk, 1, 1 );
320 if ( pMan == NULL )
321 return NULL;
322//timeRetime = Abc_Clock();
323 Ivy_ManRewriteSeq( pMan, fUseZeroCost, fVerbose );
324//timeRetime = Abc_Clock() - timeRetime;
325// Ivy_ManRewriteSeq( pMan, 1, 0 );
326// Ivy_ManRewriteSeq( pMan, 1, 0 );
327 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 1, 0 );
328 Ivy_ManStop( pMan );
329 return pNtkAig;
330}
Here is the call graph for this function:

◆ Abc_NtkIvySat()

Abc_Ntk_t * Abc_NtkIvySat ( Abc_Ntk_t * pNtk,
int nConfLimit,
int fVerbose )

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 393 of file abcIvy.c.

394{
395 Ivy_FraigParams_t Params, * pParams = &Params;
396 Abc_Ntk_t * pNtkAig;
397 Ivy_Man_t * pMan, * pTemp;
398 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
399 if ( pMan == NULL )
400 return NULL;
401 Ivy_FraigParamsDefault( pParams );
402 pParams->nBTLimitMiter = nConfLimit;
403 pParams->fVerbose = fVerbose;
404// pMan = Ivy_FraigPerform( pTemp = pMan, pParams );
405 pMan = Ivy_FraigMiter( pTemp = pMan, pParams );
406 Ivy_ManStop( pTemp );
407 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
408 Ivy_ManStop( pMan );
409 return pNtkAig;
410}
Ivy_Man_t * Ivy_FraigMiter(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Definition ivyFraig.c:480
int nBTLimitMiter
Definition ivy.h:144
Here is the call graph for this function:

◆ Abc_NtkIvyStrash()

Abc_Ntk_t * Abc_NtkIvyStrash ( Abc_Ntk_t * pNtk)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 177 of file abcIvy.c.

178{
179 Abc_Ntk_t * pNtkAig;
180 Ivy_Man_t * pMan;
181 pMan = Abc_NtkIvyBefore( pNtk, 1, 0 );
182 if ( pMan == NULL )
183 return NULL;
184 pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 1, 0 );
185 Ivy_ManStop( pMan );
186 return pNtkAig;
187}
Here is the call graph for this function:

◆ Abc_NtkToDar()

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

DECLARATIONS ///.

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

FileName [abcIvy.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Strashing of the current network.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

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 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
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
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
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition aigMan.c:47
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
int nBarBufs
Definition abc.h:174
int nConstrs
Definition abc.h:173
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
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the caller graph for this function:

◆ Abc_NtkTransferPointers()

void Abc_NtkTransferPointers ( Abc_Ntk_t * pNtk,
Abc_Ntk_t * pNtkAig )

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

Synopsis [Sets the final nodes to point to the original nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 423 of file abcIvy.c.

424{
425 Abc_Obj_t * pObj;
426 Ivy_Obj_t * pObjIvy, * pObjFraig;
427 int i;
428 pObj = Abc_AigConst1(pNtk);
429 pObj->pCopy = Abc_AigConst1(pNtkAig);
430 Abc_NtkForEachCi( pNtk, pObj, i )
431 pObj->pCopy = Abc_NtkCi(pNtkAig, i);
432 Abc_NtkForEachCo( pNtk, pObj, i )
433 pObj->pCopy = Abc_NtkCo(pNtkAig, i);
434 Abc_NtkForEachLatch( pNtk, pObj, i )
435 pObj->pCopy = Abc_NtkBox(pNtkAig, i);
436 Abc_NtkForEachNode( pNtk, pObj, i )
437 {
438 pObjIvy = (Ivy_Obj_t *)pObj->pCopy;
439 if ( pObjIvy == NULL )
440 continue;
441 pObjFraig = Ivy_ObjEquiv( pObjIvy );
442 if ( pObjFraig == NULL )
443 continue;
444 pObj->pCopy = Abc_EdgeToNode( pNtkAig, Ivy_Regular(pObjFraig)->TravId );
445 pObj->pCopy = Abc_ObjNotCond( pObj->pCopy, Ivy_IsComplement(pObjFraig) );
446 }
447}
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
struct Ivy_Obj_t_ Ivy_Obj_t
Definition ivy.h:47
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Aig_ManStop()

void Aig_ManStop ( Aig_Man_t * p)
extern

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

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file aigMan.c.

188{
189 Aig_Obj_t * pObj;
190 int i;
191 if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
192 if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
193 // make sure the nodes have clean marks
194 Aig_ManForEachObj( p, pObj, i )
195 assert( !pObj->fMarkA && !pObj->fMarkB );
196 Tim_ManStopP( (Tim_Man_t **)&p->pManTime );
197 if ( p->pFanData )
199 if ( p->pManExdc )
200 Aig_ManStop( p->pManExdc );
201// Aig_TableProfile( p );
202 Aig_MmFixedStop( p->pMemObjs, 0 );
203 Vec_PtrFreeP( &p->vCis );
204 Vec_PtrFreeP( &p->vCos );
205 Vec_PtrFreeP( &p->vObjs );
206 Vec_PtrFreeP( &p->vBufs );
207 //--jlong -- begin
208 Vec_PtrFreeP( &p->unfold2_type_I );
209 Vec_PtrFreeP( &p->unfold2_type_II );
210 //--jlong -- end
211 Vec_IntFreeP( &p->vLevelR );
212 Vec_VecFreeP( &p->vLevels );
213 Vec_IntFreeP( &p->vFlopNums );
214 Vec_IntFreeP( &p->vFlopReprs );
215 Vec_VecFreeP( (Vec_Vec_t **)&p->vOnehots );
216 Vec_VecFreeP( &p->vClockDoms );
217 Vec_IntFreeP( &p->vProbs );
218 Vec_IntFreeP( &p->vCiNumsOrig );
219 Vec_PtrFreeP( &p->vMapped );
220 if ( p->vSeqModelVec )
221 Vec_PtrFreeFree( p->vSeqModelVec );
222 ABC_FREE( p->pTerSimData );
223 ABC_FREE( p->pFastSim );
224 ABC_FREE( p->pData );
225 ABC_FREE( p->pSeqModel );
226 ABC_FREE( p->pName );
227 ABC_FREE( p->pSpec );
228 ABC_FREE( p->pObjCopies );
229 ABC_FREE( p->pReprs );
230 ABC_FREE( p->pEquivs );
231 ABC_FREE( p->pTable );
232 ABC_FREE( p );
233}
#define ABC_PRT(a, t)
Definition abc_global.h:255
#define ABC_FREE(obj)
Definition abc_global.h:267
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
void Aig_ManFanoutStop(Aig_Man_t *p)
Definition aigFanout.c:89
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Definition aigMem.c:132
Cube * p
Definition exorList.c:222
unsigned int fMarkB
Definition aig.h:80
unsigned int fMarkA
Definition aig.h:79
void Tim_ManStopP(Tim_Man_t **p)
Definition timMan.c:387
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition tim.h:92
Here is the caller graph for this function:

◆ Dec_GraphToNetworkIvy()

Ivy_Obj_t * Dec_GraphToNetworkIvy ( Ivy_Man_t * pMan,
Dec_Graph_t * pGraph )
extern

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

Synopsis [Transforms the decomposition graph into the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 330 of file decAbc.c.

331{
332 Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized"
333 Ivy_Obj_t * pAnd0, * pAnd1;
334 int i;
335 // check for constant function
336 if ( Dec_GraphIsConst(pGraph) )
337 return Ivy_NotCond( Ivy_ManConst1(pMan), Dec_GraphIsComplement(pGraph) );
338 // check for a literal
339 if ( Dec_GraphIsVar(pGraph) )
340 return Ivy_NotCond( (Ivy_Obj_t *)Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) );
341 // build the AIG nodes corresponding to the AND gates of the graph
342 Dec_GraphForEachNode( pGraph, pNode, i )
343 {
344 pAnd0 = Ivy_NotCond( (Ivy_Obj_t *)Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl );
345 pAnd1 = Ivy_NotCond( (Ivy_Obj_t *)Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl );
346 pNode->pFunc = Ivy_And( pMan, pAnd0, pAnd1 );
347 }
348 // complement the result if necessary
349 return Ivy_NotCond( (Ivy_Obj_t *)pNode->pFunc, Dec_GraphIsComplement(pGraph) );
350}
struct Dec_Node_t_ Dec_Node_t
Definition dec.h:49
#define Dec_GraphForEachNode(pGraph, pAnd, i)
Definition dec.h:101
Ivy_Obj_t * Ivy_And(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition ivyOper.c:84
Dec_Edge_t eEdge1
Definition dec.h:53
void * pFunc
Definition dec.h:56
Dec_Edge_t eEdge0
Definition dec.h:52
Here is the call graph for this function:

◆ Gia_ManFromIvySimple()

Gia_Man_t * Gia_ManFromIvySimple ( Ivy_Man_t * p)

Definition at line 1187 of file abcIvy.c.

1188{
1189 Gia_Man_t * pNew;
1190 Ivy_Obj_t * pObj;
1191 int i, * pNodes = ABC_FALLOC( int, Ivy_ManObjIdMax(p) + 1 );
1192 pNew = Gia_ManStart( Ivy_ManObjIdMax(p) );
1193 pNew->pName = Abc_UtilStrsav( "from_ivy" );
1194 Ivy_ManForEachObj( p, pObj, i )
1195 {
1196 if ( Ivy_ObjIsAnd(pObj) )
1197 pNodes[pObj->Id] = Gia_ManAppendAnd( pNew, Gia_ObjChild0Copy4(pNodes, pObj), Gia_ObjChild1Copy4(pNodes, pObj) );
1198 else if ( Ivy_ObjIsCi(pObj) )
1199 pNodes[pObj->Id] = Gia_ManAppendCi( pNew );
1200 else if ( Ivy_ObjIsCo(pObj) )
1201 pNodes[pObj->Id] = Gia_ManAppendCo( pNew, Gia_ObjChild0Copy4(pNodes, pObj) );
1202 else if ( Ivy_ObjIsConst1(pObj) )
1203 pNodes[pObj->Id] = 1;
1204 else
1205 assert( 0 );
1206 }
1207 ABC_FREE( pNodes );
1208 return pNew;
1209}
#define ABC_FALLOC(type, num)
Definition abc_global.h:266
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
#define Ivy_ManForEachObj(p, pObj, i)
Definition ivy.h:393
char * pName
Definition gia.h:99
int Id
Definition ivy.h:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManIvyFraig()

Gia_Man_t * Gia_ManIvyFraig ( Gia_Man_t * p,
int nConfLimit,
int fUseProve,
int fVerbose )

Definition at line 1210 of file abcIvy.c.

1211{
1212 Ivy_FraigParams_t Params, * pParams = &Params;
1213 Gia_Man_t * pNew;
1214 Ivy_Man_t * pMan, * pTemp;
1215 pMan = Gia_ManToIvySimple( p );
1216 if ( pMan == NULL )
1217 return NULL;
1218 Ivy_FraigParamsDefault( pParams );
1219 pParams->nBTLimitNode = nConfLimit;
1220 pParams->fVerbose = fVerbose;
1221 pParams->fProve = fUseProve;
1222 pParams->fDoSparse = 1;
1223 pMan = Ivy_FraigPerform( pTemp = pMan, pParams );
1224 pNew = Gia_ManFromIvySimple( pMan );
1225 if ( pMan->pData )
1226 {
1227 p->pCexSeq = Abc_CexDeriveFromCombModel( (int *)pMan->pData, Ivy_ManPiNum(pMan), 0, -1 );
1228 p->pCexSeq->iPo = Gia_ManFindFailedPoCex( p, p->pCexSeq, 0 );
1229 ABC_FREE( pMan->pData );
1230 }
1231 Ivy_ManStop( pTemp );
1232 Ivy_ManStop( pMan );
1233 return pNew;
1234}
Ivy_Man_t * Gia_ManToIvySimple(Gia_Man_t *p)
Definition abcIvy.c:1159
Gia_Man_t * Gia_ManFromIvySimple(Ivy_Man_t *p)
Definition abcIvy.c:1187
int Gia_ManFindFailedPoCex(Gia_Man_t *pAig, Abc_Cex_t *p, int nOutputs)
Definition giaCex.c:91
Abc_Cex_t * Abc_CexDeriveFromCombModel(int *pModel, int nPis, int nRegs, int iPo)
Definition utilCex.c:173
Here is the call graph for this function:

◆ Gia_ManIvyFraigTest()

Gia_Man_t * Gia_ManIvyFraigTest ( Gia_Man_t * p,
int nConfLimit,
int fVerbose )

Definition at line 1235 of file abcIvy.c.

1236{
1237 Ivy_Man_t * pMan = Gia_ManToIvySimple( p );
1238 Gia_Man_t * pNew = Gia_ManFromIvySimple( pMan );
1239 Ivy_ManStop( pMan );
1240 return pNew;
1241}
Here is the call graph for this function:

◆ Gia_ManToIvySimple()

Ivy_Man_t * Gia_ManToIvySimple ( Gia_Man_t * p)

Definition at line 1159 of file abcIvy.c.

1160{
1161 Ivy_Man_t * pNew;
1162 Gia_Obj_t * pObj; int i;
1163 Ivy_Obj_t ** ppNodes = ABC_FALLOC( Ivy_Obj_t *, Gia_ManObjNum(p) );
1164 // create the new manager
1165 pNew = Ivy_ManStart();
1166 // create the PIs
1167 Gia_ManForEachObj( p, pObj, i )
1168 {
1169 if ( Gia_ObjIsAnd(pObj) )
1170 ppNodes[i] = Ivy_And( pNew, Gia_ObjChild0Copy3(ppNodes, pObj, i), Gia_ObjChild1Copy3(ppNodes, pObj, i) );
1171 else if ( Gia_ObjIsCi(pObj) )
1172 ppNodes[i] = Ivy_ObjCreatePi( pNew );
1173 else if ( Gia_ObjIsCo(pObj) )
1174 ppNodes[i] = Ivy_ObjCreatePo( pNew, Gia_ObjChild0Copy3(ppNodes, pObj, Gia_ObjId(p, pObj)) );
1175 else if ( Gia_ObjIsConst0(pObj) )
1176 ppNodes[i] = Ivy_Not(Ivy_ManConst1(pNew));
1177 else
1178 assert( 0 );
1179 assert( i == 0 || Ivy_ObjId(ppNodes[i]) == i );
1180 }
1181 ABC_FREE( ppNodes );
1182 return pNew;
1183}
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
Ivy_Man_t * Ivy_ManStart()
DECLARATIONS ///.
Definition ivyMan.c:45
Ivy_Obj_t * Ivy_ObjCreatePo(Ivy_Man_t *p, Ivy_Obj_t *pDriver)
Definition ivyObj.c:61
Ivy_Obj_t * Ivy_ObjCreatePi(Ivy_Man_t *p)
DECLARATIONS ///.
Definition ivyObj.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_CutComputeAll()

void Ivy_CutComputeAll ( Ivy_Man_t * p,
int nInputs )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1108 of file ivySeq.c.

1109{
1110 Ivy_Store_t * pStore;
1111 Ivy_Obj_t * pObj;
1112 int i, nCutsTotal, nCutsTotalM, nNodeTotal, nNodeOver;
1113 abctime clk = Abc_Clock();
1114 if ( nInputs > IVY_CUT_INPUT )
1115 {
1116 printf( "Cannot compute cuts for more than %d inputs.\n", IVY_CUT_INPUT );
1117 return;
1118 }
1119 nNodeTotal = nNodeOver = 0;
1120 nCutsTotal = nCutsTotalM = -Ivy_ManNodeNum(p);
1121 Ivy_ManForEachObj( p, pObj, i )
1122 {
1123 if ( !Ivy_ObjIsNode(pObj) )
1124 continue;
1125 pStore = Ivy_CutComputeForNode( p, pObj, nInputs );
1126 nCutsTotal += pStore->nCuts;
1127 nCutsTotalM += pStore->nCutsM;
1128 nNodeOver += pStore->fSatur;
1129 nNodeTotal++;
1130 }
1131 printf( "All = %6d. Minus = %6d. Triv = %6d. Node = %6d. Satur = %6d. ",
1132 nCutsTotal, nCutsTotalM, Ivy_ManPiNum(p) + Ivy_ManNodeNum(p), nNodeTotal, nNodeOver );
1133 ABC_PRT( "Time", Abc_Clock() - clk );
1134}
#define IVY_CUT_INPUT
Definition ivy.h:153
struct Ivy_Store_t_ Ivy_Store_t
Definition ivy.h:165
int fSatur
Definition ivy.h:171
int nCuts
Definition ivy.h:168
int nCutsM
Definition ivy.h:169
Here is the caller graph for this function:

Variable Documentation

◆ timeRetime

int timeRetime
extern

DECLARATIONS ///.

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

FileName [retCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Retiming package.]

Synopsis [The core retiming procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - Oct 31, 2006.]

Revision [

Id
retCore.c,v 1.00 2006/10/31 00:00:00 alanmi Exp

]

Definition at line 30 of file retCore.c.