ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcBmc.c
Go to the documentation of this file.
1
20
21#include "base/abc/abc.h"
22#include "aig/ivy/ivy.h"
23
25
26
30
31extern Ivy_Man_t * Abc_NtkIvyBefore( Abc_Ntk_t * pNtk, int fSeq, int fUseDc );
32
33static void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig, Vec_Ptr_t * vMapping, int nFrames );
34
38
50void Abc_NtkBmc( Abc_Ntk_t * pNtk, int nFrames, int fInit, int fVerbose )
51{
52 Ivy_FraigParams_t Params, * pParams = &Params;
53 Ivy_Man_t * pMan, * pFrames, * pFraig;
54 Vec_Ptr_t * vMapping;
55 // convert to IVY manager
56 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
57 // generate timeframes
58 pFrames = Ivy_ManFrames( pMan, Abc_NtkLatchNum(pNtk), nFrames, fInit, &vMapping );
59 // fraig the timeframes
60 Ivy_FraigParamsDefault( pParams );
61 pParams->nBTLimitNode = ABC_INFINITY;
62 pParams->fVerbose = 0;
63 pParams->fProve = 0;
64 pFraig = Ivy_FraigPerform( pFrames, pParams );
65printf( "Frames have %6d nodes. ", Ivy_ManNodeNum(pFrames) );
66printf( "Fraig has %6d nodes.\n", Ivy_ManNodeNum(pFraig) );
67 // report the classes
68// if ( fVerbose )
69// Abc_NtkBmcReport( pMan, pFrames, pFraig, vMapping, nFrames );
70 // free stuff
71 Vec_PtrFree( vMapping );
72 Ivy_ManStop( pFraig );
73 Ivy_ManStop( pFrames );
74 Ivy_ManStop( pMan );
75}
76
88void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig, Vec_Ptr_t * vMapping, int nFrames )
89{
90 Ivy_Obj_t * pFirst1, * pFirst2 = NULL, * pFirst3 = NULL;
91 int i, f, nIdMax, Prev2, Prev3;
92 nIdMax = Ivy_ManObjIdMax(pMan);
93 // check what is the number of nodes in each frame
94 Prev2 = Prev3 = 0;
95 for ( f = 0; f < nFrames; f++ )
96 {
97 Ivy_ManForEachNode( pMan, pFirst1, i )
98 {
99 pFirst2 = Ivy_Regular( (Ivy_Obj_t *)Vec_PtrEntry(vMapping, f * nIdMax + pFirst1->Id) );
100 if ( Ivy_ObjIsConst1(pFirst2) || pFirst2->Type == 0 )
101 continue;
102 pFirst3 = Ivy_Regular( pFirst2->pEquiv );
103 if ( Ivy_ObjIsConst1(pFirst3) || pFirst3->Type == 0 )
104 continue;
105 break;
106 }
107 assert(pFirst2);
108 assert(pFirst3);
109 if ( f )
110 printf( "Frame %3d : Strash = %5d Fraig = %5d\n", f, pFirst2->Id - Prev2, pFirst3->Id - Prev3 );
111 Prev2 = pFirst2->Id;
112 Prev3 = pFirst3->Id;
113 }
114}
115
119
120
122
void Abc_NtkBmc(Abc_Ntk_t *pNtk, int nFrames, int fInit, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition abcBmc.c:50
ABC_NAMESPACE_IMPL_START Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
DECLARATIONS ///.
Definition abcIvy.c:88
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Ivy_Man_t * Ivy_FraigPerform(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Definition ivyFraig.c:451
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition ivy.h:46
#define Ivy_ManForEachNode(p, pObj, i)
Definition ivy.h:402
void Ivy_FraigParamsDefault(Ivy_FraigParams_t *pParams)
FUNCTION DEFINITIONS ///.
Definition ivyFraig.c:225
struct Ivy_FraigParams_t_ Ivy_FraigParams_t
Definition ivy.h:49
void Ivy_ManStop(Ivy_Man_t *p)
Definition ivyMan.c:238
struct Ivy_Obj_t_ Ivy_Obj_t
Definition ivy.h:47
Ivy_Man_t * Ivy_ManFrames(Ivy_Man_t *pMan, int nLatches, int nFrames, int fInit, Vec_Ptr_t **pvMapping)
Definition ivyMan.c:172
Ivy_Obj_t * pEquiv
Definition ivy.h:93
int Id
Definition ivy.h:75
unsigned Type
Definition ivy.h:77
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42