abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcBmc.c File Reference
#include "base/abc/abc.h"
#include "aig/ivy/ivy.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Ivy_Man_t
Abc_NtkIvyBefore (Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
 DECLARATIONS ///. More...
 
static void Abc_NtkBmcReport (Ivy_Man_t *pMan, Ivy_Man_t *pFrames, Ivy_Man_t *pFraig, Vec_Ptr_t *vMapping, int nFrames)
 
void Abc_NtkBmc (Abc_Ntk_t *pNtk, int nFrames, int fInit, int fVerbose)
 FUNCTION DEFINITIONS ///. More...
 

Function Documentation

void Abc_NtkBmc ( Abc_Ntk_t pNtk,
int  nFrames,
int  fInit,
int  fVerbose 
)

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 50 of file abcBmc.c.

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 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
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
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
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_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
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
void Abc_NtkBmcReport ( Ivy_Man_t pMan,
Ivy_Man_t pFrames,
Ivy_Man_t pFraig,
Vec_Ptr_t vMapping,
int  nFrames 
)
static

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file abcBmc.c.

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 }
int Id
Definition: ivy.h:75
#define Ivy_ManForEachNode(p, pObj, i)
Definition: ivy.h:402
static int Ivy_ManObjIdMax(Ivy_Man_t *p)
Definition: ivy.h:226
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 * 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 assert(ex)
Definition: util_old.h:213
Ivy_Obj_t * pEquiv
Definition: ivy.h:93
ABC_NAMESPACE_IMPL_START Ivy_Man_t* Abc_NtkIvyBefore ( Abc_Ntk_t pNtk,
int  fSeq,
int  fUseDc 
)

DECLARATIONS ///.

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

FileName [abcBmc.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Performs bounded model check.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

DECLARATIONS ///.

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

Synopsis [Prepares the IVY package.]

Description []

SideEffects []

SeeAlso []

Definition at line 84 of file abcIvy.c.

85 {
86  Ivy_Man_t * pMan;
87 //timeRetime = Abc_Clock();
88  assert( !Abc_NtkIsNetlist(pNtk) );
89  if ( Abc_NtkIsBddLogic(pNtk) )
90  {
91  if ( !Abc_NtkBddToSop(pNtk, 0) )
92  {
93  printf( "Abc_NtkIvyBefore(): Converting to SOPs has failed.\n" );
94  return NULL;
95  }
96  }
97  if ( fSeq && Abc_NtkCountSelfFeedLatches(pNtk) )
98  {
99  printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtk) );
100 // return NULL;
101  }
102  // print warning about choice nodes
103  if ( Abc_NtkGetChoiceNum( pNtk ) )
104  printf( "Warning: The choice nodes in the initial AIG are removed by strashing.\n" );
105  // convert to the AIG manager
106  pMan = Abc_NtkToIvy( pNtk );
107  if ( !Ivy_ManCheck( pMan ) )
108  {
109  printf( "AIG check has failed.\n" );
110  Ivy_ManStop( pMan );
111  return NULL;
112  }
113 // Ivy_ManPrintStats( pMan );
114  if ( fSeq )
115  {
116  int nLatches = Abc_NtkLatchNum(pNtk);
117  Vec_Int_t * vInit = Abc_NtkCollectLatchValuesIvy( pNtk, fUseDc );
118  Ivy_ManMakeSeq( pMan, nLatches, vInit->pArray );
119  Vec_IntFree( vInit );
120 // Ivy_ManPrintStats( pMan );
121  }
122 //timeRetime = Abc_Clock() - timeRetime;
123  return pMan;
124 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
void Ivy_ManMakeSeq(Ivy_Man_t *p, int nLatches, int *pInits)
Definition: ivyMan.c:482
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
static Vec_Int_t * Abc_NtkCollectLatchValuesIvy(Abc_Ntk_t *pNtk, int fUseDcs)
Definition: abcIvy.c:1119
static Ivy_Man_t * Abc_NtkToIvy(Abc_Ntk_t *pNtkOld)
Definition: abcIvy.c:892
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
ABC_DLL int Abc_NtkBddToSop(Abc_Ntk_t *pNtk, int fDirect)
Definition: abcFunc.c:359
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_DLL int Abc_NtkCountSelfFeedLatches(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:89
int Ivy_ManCheck(Ivy_Man_t *p)
DECLARATIONS ///.
Definition: ivyCheck.c:45