00001
00021 #include "abc.h"
00022 #include "ivy.h"
00023
00027
00028 extern Ivy_Man_t * Abc_NtkIvyBefore( Abc_Ntk_t * pNtk, int fSeq, int fUseDc );
00029
00030 static void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig, Vec_Ptr_t * vMapping, int nFrames );
00031
00035
00047 void Abc_NtkBmc( Abc_Ntk_t * pNtk, int nFrames, int fInit, int fVerbose )
00048 {
00049 Ivy_FraigParams_t Params, * pParams = &Params;
00050 Ivy_Man_t * pMan, * pFrames, * pFraig;
00051 Vec_Ptr_t * vMapping;
00052
00053 pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
00054
00055 pFrames = Ivy_ManFrames( pMan, Abc_NtkLatchNum(pNtk), nFrames, fInit, &vMapping );
00056
00057 Ivy_FraigParamsDefault( pParams );
00058 pParams->nBTLimitNode = ABC_INFINITY;
00059 pParams->fVerbose = 0;
00060 pParams->fProve = 0;
00061 pFraig = Ivy_FraigPerform( pFrames, pParams );
00062 printf( "Frames have %6d nodes. ", Ivy_ManNodeNum(pFrames) );
00063 printf( "Fraig has %6d nodes.\n", Ivy_ManNodeNum(pFraig) );
00064
00065
00066
00067
00068 Vec_PtrFree( vMapping );
00069 Ivy_ManStop( pFraig );
00070 Ivy_ManStop( pFrames );
00071 Ivy_ManStop( pMan );
00072 }
00073
00085 void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig, Vec_Ptr_t * vMapping, int nFrames )
00086 {
00087 Ivy_Obj_t * pFirst1, * pFirst2, * pFirst3;
00088 int i, f, nIdMax, Prev2, Prev3;
00089 nIdMax = Ivy_ManObjIdMax(pMan);
00090
00091 Prev2 = Prev3 = 0;
00092 for ( f = 0; f < nFrames; f++ )
00093 {
00094 Ivy_ManForEachNode( pMan, pFirst1, i )
00095 {
00096 pFirst2 = Ivy_Regular( Vec_PtrEntry(vMapping, f * nIdMax + pFirst1->Id) );
00097 if ( Ivy_ObjIsConst1(pFirst2) || pFirst2->Type == 0 )
00098 continue;
00099 pFirst3 = Ivy_Regular( pFirst2->pEquiv );
00100 if ( Ivy_ObjIsConst1(pFirst3) || pFirst3->Type == 0 )
00101 continue;
00102 break;
00103 }
00104 if ( f )
00105 printf( "Frame %3d : Strash = %5d Fraig = %5d\n", f, pFirst2->Id - Prev2, pFirst3->Id - Prev3 );
00106 Prev2 = pFirst2->Id;
00107 Prev3 = pFirst3->Id;
00108 }
00109 }
00110
00114
00115