abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcBmc.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [abcBmc.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Network and node package.]
8 
9  Synopsis [Performs bounded model check.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: abcBmc.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "base/abc/abc.h"
22 #include "aig/ivy/ivy.h"
23 
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// DECLARATIONS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 extern Ivy_Man_t * Abc_NtkIvyBefore( Abc_Ntk_t * pNtk, int fSeq, int fUseDc );
32 
33 static void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig, Vec_Ptr_t * vMapping, int nFrames );
34 
35 ////////////////////////////////////////////////////////////////////////
36 /// FUNCTION DEFINITIONS ///
37 ////////////////////////////////////////////////////////////////////////
38 
39 /**Function*************************************************************
40 
41  Synopsis []
42 
43  Description []
44 
45  SideEffects []
46 
47  SeeAlso []
48 
49 ***********************************************************************/
50 void 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 );
65 printf( "Frames have %6d nodes. ", Ivy_ManNodeNum(pFrames) );
66 printf( "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 
77 /**Function*************************************************************
78 
79  Synopsis []
80 
81  Description []
82 
83  SideEffects []
84 
85  SeeAlso []
86 
87 ***********************************************************************/
88 void 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 
116 ////////////////////////////////////////////////////////////////////////
117 /// END OF FILE ///
118 ////////////////////////////////////////////////////////////////////////
119 
120 
122 
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Abc_NtkBmc(Abc_Ntk_t *pNtk, int nFrames, int fInit, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcBmc.c:50
void Ivy_FraigParamsDefault(Ivy_FraigParams_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: ivyFraig.c:225
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int nBTLimitNode
Definition: ivy.h:143
int Id
Definition: ivy.h:75
#define Ivy_ManForEachNode(p, pObj, i)
Definition: ivy.h:402
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
static int Ivy_ManObjIdMax(Ivy_Man_t *p)
Definition: ivy.h:226
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
unsigned Type
Definition: ivy.h:77
Definition: ivy.h:73
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
Definition: ivy.h:193
static void Abc_NtkBmcReport(Ivy_Man_t *pMan, Ivy_Man_t *pFrames, Ivy_Man_t *pFraig, Vec_Ptr_t *vMapping, int nFrames)
Definition: abcBmc.c:88
Ivy_Man_t * Ivy_ManFrames(Ivy_Man_t *pMan, int nLatches, int nFrames, int fInit, Vec_Ptr_t **pvMapping)
Definition: ivyMan.c:172
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static int Ivy_ObjIsConst1(Ivy_Obj_t *pObj)
Definition: ivy.h:233
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
Ivy_Man_t * Ivy_FraigPerform(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Definition: ivyFraig.c:451
#define assert(ex)
Definition: util_old.h:213
static int Ivy_ManNodeNum(Ivy_Man_t *p)
Definition: ivy.h:227
ABC_NAMESPACE_IMPL_START Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
DECLARATIONS ///.
Definition: abcIvy.c:84
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Ivy_Obj_t * pEquiv
Definition: ivy.h:93