Commit d80ee832 by Alan Mishchenko

Version abc81027

parent d2b735f7
...@@ -129,7 +129,7 @@ alias chnewrs "st; haig_start; resyn2rs; haig_use" ...@@ -129,7 +129,7 @@ alias chnewrs "st; haig_start; resyn2rs; haig_use"
alias stdsd "r test/6in.blif; st; ps; u; bdd; dsd -g; st; ps" alias stdsd "r test/6in.blif; st; ps; u; bdd; dsd -g; st; ps"
alias trec "rec_start; r c.blif; st; rec_add; rec_use" alias trec "rec_start; r c.blif; st; rec_add; rec_use"
alias trec4 "rec_start -K 4; r i10.blif; st; rec_add; rec_use" alias trec4 "rec_start -K 4; r i10.blif; st; rec_add; rec_use"
alias bmc2 "frames -i -F 10; orpos; iprove" alias bmcf "frames -i -F 10; orpos; iprove"
alias pjsolve "scl; dc2; fr; dc2; ic; ic -t; if -a; cs tacas/005_care.aig; mfs; lp; st; ic" alias pjsolve "scl; dc2; fr; dc2; ic; ic -t; if -a; cs tacas/005_care.aig; mfs; lp; st; ic"
......
...@@ -431,6 +431,7 @@ void Aig_ManSetRegNum( Aig_Man_t * p, int nRegs ) ...@@ -431,6 +431,7 @@ void Aig_ManSetRegNum( Aig_Man_t * p, int nRegs )
p->nRegs = nRegs; p->nRegs = nRegs;
p->nTruePis = Aig_ManPiNum(p) - nRegs; p->nTruePis = Aig_ManPiNum(p) - nRegs;
p->nTruePos = Aig_ManPoNum(p) - nRegs; p->nTruePos = Aig_ManPoNum(p) - nRegs;
Aig_ManSetPioNumbers( p );
} }
/**Function************************************************************* /**Function*************************************************************
......
...@@ -122,6 +122,7 @@ Vec_Int_t * Cnf_DataCollectPiSatNums( Cnf_Dat_t * pCnf, Aig_Man_t * p ) ...@@ -122,6 +122,7 @@ Vec_Int_t * Cnf_DataCollectPiSatNums( Cnf_Dat_t * pCnf, Aig_Man_t * p )
Cnf_Dat_t * Cnf_DataAlloc( Aig_Man_t * pAig, int nVars, int nClauses, int nLiterals ) Cnf_Dat_t * Cnf_DataAlloc( Aig_Man_t * pAig, int nVars, int nClauses, int nLiterals )
{ {
Cnf_Dat_t * pCnf; Cnf_Dat_t * pCnf;
int i;
pCnf = ALLOC( Cnf_Dat_t, 1 ); pCnf = ALLOC( Cnf_Dat_t, 1 );
memset( pCnf, 0, sizeof(Cnf_Dat_t) ); memset( pCnf, 0, sizeof(Cnf_Dat_t) );
pCnf->pMan = pAig; pCnf->pMan = pAig;
...@@ -132,7 +133,9 @@ Cnf_Dat_t * Cnf_DataAlloc( Aig_Man_t * pAig, int nVars, int nClauses, int nLiter ...@@ -132,7 +133,9 @@ Cnf_Dat_t * Cnf_DataAlloc( Aig_Man_t * pAig, int nVars, int nClauses, int nLiter
pCnf->pClauses[0] = ALLOC( int, nLiterals ); pCnf->pClauses[0] = ALLOC( int, nLiterals );
pCnf->pClauses[nClauses] = pCnf->pClauses[0] + nLiterals; pCnf->pClauses[nClauses] = pCnf->pClauses[0] + nLiterals;
pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(pAig) ); pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(pAig) );
memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(pAig) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(pAig) );
for ( i = 0; i < Aig_ManObjNumMax(pAig); i++ )
pCnf->pVarNums[i] = -1;
return pCnf; return pCnf;
} }
...@@ -196,7 +199,7 @@ void Cnf_DataLift( Cnf_Dat_t * p, int nVarsPlus ) ...@@ -196,7 +199,7 @@ void Cnf_DataLift( Cnf_Dat_t * p, int nVarsPlus )
Aig_Obj_t * pObj; Aig_Obj_t * pObj;
int v; int v;
Aig_ManForEachObj( p->pMan, pObj, v ) Aig_ManForEachObj( p->pMan, pObj, v )
if ( p->pVarNums[pObj->Id] ) if ( p->pVarNums[pObj->Id] >= 0 )
p->pVarNums[pObj->Id] += nVarsPlus; p->pVarNums[pObj->Id] += nVarsPlus;
for ( v = 0; v < p->nLiterals; v++ ) for ( v = 0; v < p->nLiterals; v++ )
p->pClauses[0][v] += 2*nVarsPlus; p->pClauses[0][v] += 2*nVarsPlus;
......
...@@ -216,7 +216,9 @@ Cnf_Dat_t * Cnf_ManWriteCnf( Cnf_Man_t * p, Vec_Ptr_t * vMapped, int nOutputs ) ...@@ -216,7 +216,9 @@ Cnf_Dat_t * Cnf_ManWriteCnf( Cnf_Man_t * p, Vec_Ptr_t * vMapped, int nOutputs )
// create room for variable numbers // create room for variable numbers
pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p->pManAig) ); pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p->pManAig) );
memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p->pManAig) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p->pManAig) );
for ( i = 0; i < Aig_ManObjNumMax(p->pManAig); i++ )
pCnf->pVarNums[i] = -1;
// assign variables to the last (nOutputs) POs // assign variables to the last (nOutputs) POs
Number = 1; Number = 1;
if ( nOutputs ) if ( nOutputs )
...@@ -365,7 +367,9 @@ Cnf_Dat_t * Cnf_DeriveSimple( Aig_Man_t * p, int nOutputs ) ...@@ -365,7 +367,9 @@ Cnf_Dat_t * Cnf_DeriveSimple( Aig_Man_t * p, int nOutputs )
// create room for variable numbers // create room for variable numbers
pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p) ); pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p) );
memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p) );
for ( i = 0; i < Aig_ManObjNumMax(p); i++ )
pCnf->pVarNums[i] = -1;
// assign variables to the last (nOutputs) POs // assign variables to the last (nOutputs) POs
Number = 1; Number = 1;
if ( nOutputs ) if ( nOutputs )
...@@ -485,7 +489,9 @@ Cnf_Dat_t * Cnf_DeriveSimpleForRetiming( Aig_Man_t * p ) ...@@ -485,7 +489,9 @@ Cnf_Dat_t * Cnf_DeriveSimpleForRetiming( Aig_Man_t * p )
// create room for variable numbers // create room for variable numbers
pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p) ); pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p) );
memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p) );
for ( i = 0; i < Aig_ManObjNumMax(p); i++ )
pCnf->pVarNums[i] = -1;
// assign variables to the last (nOutputs) POs // assign variables to the last (nOutputs) POs
Number = 1; Number = 1;
Aig_ManForEachPo( p, pObj, i ) Aig_ManForEachPo( p, pObj, i )
......
...@@ -80,6 +80,7 @@ static inline Aig_Obj_t * Saig_ObjLiToLo( Aig_Man_t * p, Aig_Obj_t * pObj ) { ...@@ -80,6 +80,7 @@ static inline Aig_Obj_t * Saig_ObjLiToLo( Aig_Man_t * p, Aig_Obj_t * pObj ) {
/*=== saigBmc.c ==========================================================*/ /*=== saigBmc.c ==========================================================*/
extern int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nBTLimit, int fRewrite, int fVerbose, int * piFrame ); extern int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nBTLimit, int fRewrite, int fVerbose, int * piFrame );
extern void Saig_BmcPerform( Aig_Man_t * pAig, int nFramesMax, int nNodesMax, int nConfMaxOne, int nConfMaxAll, int fVerbose );
/*=== saigCone.c ==========================================================*/ /*=== saigCone.c ==========================================================*/
extern void Saig_ManPrintCones( Aig_Man_t * p ); extern void Saig_ManPrintCones( Aig_Man_t * p );
/*=== saigDup.c ==========================================================*/ /*=== saigDup.c ==========================================================*/
......
...@@ -108,13 +108,12 @@ Aig_Man_t * Saig_ManAbstraction( Aig_Man_t * pAig, Vec_Int_t * vFlops ) ...@@ -108,13 +108,12 @@ Aig_Man_t * Saig_ManAbstraction( Aig_Man_t * pAig, Vec_Int_t * vFlops )
pObj->fMarkA = 0; pObj->fMarkA = 0;
pObj->pData = Aig_ObjCreatePi( pAigNew ); pObj->pData = Aig_ObjCreatePi( pAigNew );
} }
// add internal nodes of this frame // add internal nodes
Aig_ManForEachNode( pAig, pObj, i ) Aig_ManForEachNode( pAig, pObj, i )
pObj->pData = Aig_And( pAigNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) ); pObj->pData = Aig_And( pAigNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
// create POs // create POs
Aig_ManForEachPo( pAig, pObj, i ) Saig_ManForEachPo( pAig, pObj, i )
if ( !pObj->fMarkA ) Aig_ObjCreatePo( pAigNew, Aig_ObjChild0Copy(pObj) );
Aig_ObjCreatePo( pAigNew, Aig_ObjChild0Copy(pObj) );
// create LIs // create LIs
Aig_ManForEachPo( pAig, pObj, i ) Aig_ManForEachPo( pAig, pObj, i )
if ( pObj->fMarkA ) if ( pObj->fMarkA )
...@@ -122,8 +121,8 @@ Aig_Man_t * Saig_ManAbstraction( Aig_Man_t * pAig, Vec_Int_t * vFlops ) ...@@ -122,8 +121,8 @@ Aig_Man_t * Saig_ManAbstraction( Aig_Man_t * pAig, Vec_Int_t * vFlops )
pObj->fMarkA = 0; pObj->fMarkA = 0;
Aig_ObjCreatePo( pAigNew, Aig_ObjChild0Copy(pObj) ); Aig_ObjCreatePo( pAigNew, Aig_ObjChild0Copy(pObj) );
} }
Aig_ManCleanup( pAigNew );
Aig_ManSetRegNum( pAigNew, Vec_IntSize(vFlops) ); Aig_ManSetRegNum( pAigNew, Vec_IntSize(vFlops) );
Aig_ManSeqCleanup( pAigNew );
return pAigNew; return pAigNew;
} }
......
...@@ -1462,7 +1462,7 @@ Abc_Ntk_t * Abc_NtkDarLcorrNew( Abc_Ntk_t * pNtk, int nVarsMax, int nConfMax, in ...@@ -1462,7 +1462,7 @@ Abc_Ntk_t * Abc_NtkDarLcorrNew( Abc_Ntk_t * pNtk, int nVarsMax, int nConfMax, in
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, int fRewrite, int fNewAlgo, int fVerbose ) int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nNodeDelta, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int fVerbose )
{ {
Aig_Man_t * pMan; Aig_Man_t * pMan;
int status, RetValue = -1, clk = clock(); int status, RetValue = -1, clk = clock();
...@@ -1511,6 +1511,7 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, in ...@@ -1511,6 +1511,7 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, in
RetValue = 1; RetValue = 1;
} }
*/ */
/*
int iFrame; int iFrame;
RetValue = Ssw_BmcDynamic( pMan, nFrames, nBTLimit, fVerbose, &iFrame ); RetValue = Ssw_BmcDynamic( pMan, nFrames, nBTLimit, fVerbose, &iFrame );
FREE( pNtk->pModel ); FREE( pNtk->pModel );
...@@ -1525,6 +1526,11 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, in ...@@ -1525,6 +1526,11 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, in
Fra_Cex_t * pCex = pNtk->pSeqModel; Fra_Cex_t * pCex = pNtk->pSeqModel;
printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness). ", pCex->iPo, pCex->iFrame ); printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness). ", pCex->iPo, pCex->iFrame );
} }
*/
Saig_BmcPerform( pMan, nFrames, nNodeDelta, nBTLimit, nBTLimitAll, fVerbose );
FREE( pNtk->pModel );
FREE( pNtk->pSeqModel );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
} }
PRT( "Time", clock() - clk ); PRT( "Time", clock() - clk );
// verify counter-example // verify counter-example
...@@ -1667,7 +1673,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar ) ...@@ -1667,7 +1673,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar )
} }
if ( pSecPar->fTryBmc ) if ( pSecPar->fTryBmc )
{ {
RetValue = Abc_NtkDarBmc( pNtk, 20, 100000, 2000, 0, 1, 0 ); RetValue = Abc_NtkDarBmc( pNtk, 20, 100000, -1, 2000, -1, 0, 1, 0 );
if ( RetValue == 0 ) if ( RetValue == 0 )
{ {
printf( "Networks are not equivalent.\n" ); printf( "Networks are not equivalent.\n" );
...@@ -2132,9 +2138,10 @@ Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose ) ...@@ -2132,9 +2138,10 @@ Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
Aig_ManStop( pMan ); Aig_ManStop( pMan );
return pNtkAig; return pNtkAig;
} }
/**Function************************************************************* /**Function*************************************************************
Synopsis [Performs targe enlargement.] Synopsis [Performs induction for property only.]
Description [] Description []
...@@ -2143,7 +2150,7 @@ Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose ) ...@@ -2143,7 +2150,7 @@ Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_NtkDarLocalize( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fVerbose ) void Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fVerbose )
{ {
Aig_Man_t * pMan, * pTemp; Aig_Man_t * pMan, * pTemp;
int clkTotal = clock(); int clkTotal = clock();
...@@ -2173,6 +2180,41 @@ PRT( "Time", clock() - clkTotal ); ...@@ -2173,6 +2180,41 @@ PRT( "Time", clock() - clkTotal );
/**Function************************************************************* /**Function*************************************************************
Synopsis [Performs proof-based abstraction.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t * Abc_NtkDarPBAbstraction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fVerbose )
{
Aig_Man_t * Saig_ManProofAbstraction( Aig_Man_t * p, int nFrames, int nConfMax, int fVerbose );
Abc_Ntk_t * pNtkAig;
Aig_Man_t * pMan, * pTemp;
assert( Abc_NtkIsStrash(pNtk) );
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL )
return NULL;
Aig_ManSetRegNum( pMan, pMan->nRegs );
pMan = Saig_ManProofAbstraction( pTemp = pMan, nFramesMax, nConfMax, fVerbose );
Aig_ManStop( pTemp );
if ( pMan == NULL )
return NULL;
pNtkAig = Abc_NtkFromAigPhase( pMan );
pNtkAig->pName = Extra_UtilStrsav(pNtk->pName);
pNtkAig->pSpec = Extra_UtilStrsav(pNtk->pSpec);
Aig_ManStop( pMan );
return pNtkAig;
}
/**Function*************************************************************
Synopsis [Interplates two networks.] Synopsis [Interplates two networks.]
Description [] Description []
...@@ -2683,8 +2725,10 @@ Abc_Ntk_t * Abc_NtkDarTestNtk( Abc_Ntk_t * pNtk ) ...@@ -2683,8 +2725,10 @@ Abc_Ntk_t * Abc_NtkDarTestNtk( Abc_Ntk_t * pNtk )
return NULL; return NULL;
Aig_ManSetRegNum( pMan, pMan->nRegs ); Aig_ManSetRegNum( pMan, pMan->nRegs );
pMan = Saig_ManProofAbstraction( pTemp = pMan, 10, 1000, 1 ); pMan = Saig_ManProofAbstraction( pTemp = pMan, 5, 10000, 1 );
Aig_ManStop( pTemp ); Aig_ManStop( pTemp );
if ( pMan == NULL )
return NULL;
pNtkAig = Abc_NtkFromAigPhase( pMan ); pNtkAig = Abc_NtkFromAigPhase( pMan );
pNtkAig->pName = Extra_UtilStrsav(pNtk->pName); pNtkAig->pName = Extra_UtilStrsav(pNtk->pName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment