Commit 74ff01bf by Alan Mishchenko

Version abc80515

parent 37b6c727
...@@ -56,6 +56,7 @@ alias r3f retime -M 3 -f ...@@ -56,6 +56,7 @@ alias r3f retime -M 3 -f
alias r3b retime -M 3 -b alias r3b retime -M 3 -b
alias ren renode alias ren renode
alias rh read_hie alias rh read_hie
alias ri read_init
alias rl read_blif alias rl read_blif
alias rb read_bench alias rb read_bench
alias ret retime alias ret retime
......
...@@ -51,6 +51,7 @@ extern "C" { ...@@ -51,6 +51,7 @@ extern "C" {
typedef struct Fra_Par_t_ Fra_Par_t; typedef struct Fra_Par_t_ Fra_Par_t;
typedef struct Fra_Ssw_t_ Fra_Ssw_t; typedef struct Fra_Ssw_t_ Fra_Ssw_t;
typedef struct Fra_Sec_t_ Fra_Sec_t;
typedef struct Fra_Man_t_ Fra_Man_t; typedef struct Fra_Man_t_ Fra_Man_t;
typedef struct Fra_Cla_t_ Fra_Cla_t; typedef struct Fra_Cla_t_ Fra_Cla_t;
typedef struct Fra_Sml_t_ Fra_Sml_t; typedef struct Fra_Sml_t_ Fra_Sml_t;
...@@ -87,7 +88,7 @@ struct Fra_Par_t_ ...@@ -87,7 +88,7 @@ struct Fra_Par_t_
int fDontShowBar; // does not show progressbar during fraiging int fDontShowBar; // does not show progressbar during fraiging
}; };
// seq SAT sweeping parametesr // seq SAT sweeping parameters
struct Fra_Ssw_t_ struct Fra_Ssw_t_
{ {
int nPartSize; // size of the partition int nPartSize; // size of the partition
...@@ -107,6 +108,27 @@ struct Fra_Ssw_t_ ...@@ -107,6 +108,27 @@ struct Fra_Ssw_t_
float TimeLimit; // the runtime budget for this call float TimeLimit; // the runtime budget for this call
}; };
// SEC parametesr
struct Fra_Sec_t_
{
int fTryComb; // try CEC call as a preprocessing step
int fTryBmc; // try BMC call as a preprocessing step
int nFramesMax; // the max number of frames used for induction
int fPhaseAbstract; // enables phase abstraction
int fRetimeFirst; // enables most-forward retiming at the beginning
int fRetimeRegs; // enables min-register retiming at the beginning
int fFraiging; // enables fraiging at the beginning
int fInterpolation; // enables interpolation
int fReachability; // enables BDD based reachability
int fStopOnFirstFail; // enables stopping after first output of a miter has failed to prove
int fVerbose; // enables verbose reporting of statistics
int fVeryVerbose; // enables very verbose reporting
int TimeLimit; // enables the timeout
// internal parameters
int fRecursive; // set to 1 when SEC is called recursively
int fReportSolution; // enables report solution in a special form
};
// FRAIG equivalence classes // FRAIG equivalence classes
struct Fra_Cla_t_ struct Fra_Cla_t_
{ {
...@@ -329,7 +351,8 @@ extern int Fra_NodesAreImp( Fra_Man_t * p, Aig_Obj_t * pOld, Aig ...@@ -329,7 +351,8 @@ extern int Fra_NodesAreImp( Fra_Man_t * p, Aig_Obj_t * pOld, Aig
extern int Fra_NodesAreClause( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew, int fComplL, int fComplR ); extern int Fra_NodesAreClause( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew, int fComplL, int fComplR );
extern int Fra_NodeIsConst( Fra_Man_t * p, Aig_Obj_t * pNew ); extern int Fra_NodeIsConst( Fra_Man_t * p, Aig_Obj_t * pNew );
/*=== fraSec.c ========================================================*/ /*=== fraSec.c ========================================================*/
extern int Fra_FraigSec( Aig_Man_t * p, int nFrames, int fPhaseAbstract, int fRetimeFirst, int fRetimeRegs, int fFraiging, int fVerbose, int fVeryVerbose, int TimeLimit ); extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
extern int Fra_FraigSec( Aig_Man_t * p, Fra_Sec_t * pParSec );
/*=== fraSim.c ========================================================*/ /*=== fraSim.c ========================================================*/
extern int Fra_SmlNodeHash( Aig_Obj_t * pObj, int nTableSize ); extern int Fra_SmlNodeHash( Aig_Obj_t * pObj, int nTableSize );
extern int Fra_SmlNodeIsConst( Aig_Obj_t * pObj ); extern int Fra_SmlNodeIsConst( Aig_Obj_t * pObj );
......
...@@ -69,20 +69,10 @@ int Ioa_FileSize( char * pFileName ) ...@@ -69,20 +69,10 @@ int Ioa_FileSize( char * pFileName )
***********************************************************************/ ***********************************************************************/
char * Ioa_FileNameGeneric( char * FileName ) char * Ioa_FileNameGeneric( char * FileName )
{ {
char * pDot; char * pDot, * pRes;
char * pUnd;
char * pRes;
// find the generic name of the file
pRes = Aig_UtilStrsav( FileName ); pRes = Aig_UtilStrsav( FileName );
// find the pointer to the "." symbol in the file name if ( (pDot = strrchr( pRes, '.' )) )
// pUnd = strstr( FileName, "_" ); *pDot = 0;
pUnd = NULL;
pDot = strstr( FileName, "." );
if ( pUnd )
pRes[pUnd - FileName] = 0;
else if ( pDot )
pRes[pDot - FileName] = 0;
return pRes; return pRes;
} }
...@@ -107,8 +97,7 @@ char * Ioa_FileNameGenericAppend( char * pBase, char * pSuffix ) ...@@ -107,8 +97,7 @@ char * Ioa_FileNameGenericAppend( char * pBase, char * pSuffix )
return Buffer; return Buffer;
} }
strcpy( Buffer, pBase ); strcpy( Buffer, pBase );
pDot = strstr( Buffer, "." ); if ( (pDot = strrchr( Buffer, '.' )) )
if ( pDot )
*pDot = 0; *pDot = 0;
strcat( Buffer, pSuffix ); strcat( Buffer, pSuffix );
// find the last occurrance of slash // find the last occurrance of slash
......
...@@ -174,19 +174,10 @@ int Nwk_ManCompareAndSaveBest( Nwk_Man_t * pNtk, void * pNtl ) ...@@ -174,19 +174,10 @@ int Nwk_ManCompareAndSaveBest( Nwk_Man_t * pNtk, void * pNtl )
***********************************************************************/ ***********************************************************************/
char * Nwk_FileNameGeneric( char * FileName ) char * Nwk_FileNameGeneric( char * FileName )
{ {
char * pDot; char * pDot, * pRes;
char * pUnd;
char * pRes;
// find the generic name of the file
pRes = Aig_UtilStrsav( FileName ); pRes = Aig_UtilStrsav( FileName );
// find the pointer to the "." symbol in the file name if ( (pDot = strrchr( pRes, '.' )) )
// pUnd = strstr( FileName, "_" ); *pDot = 0;
pUnd = NULL;
pDot = strstr( FileName, "." );
if ( pUnd )
pRes[pUnd - FileName] = 0;
else if ( pDot )
pRes[pDot - FileName] = 0;
return pRes; return pRes;
} }
......
...@@ -182,7 +182,6 @@ int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nConfLim ...@@ -182,7 +182,6 @@ int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nConfLim
Aig_Man_t * pFrames, * pAigTemp; Aig_Man_t * pFrames, * pAigTemp;
Aig_Obj_t * pObj; Aig_Obj_t * pObj;
int status, clk, Lit, i, RetValue = 1; int status, clk, Lit, i, RetValue = 1;
*piFrame = -1;
// derive the timeframes // derive the timeframes
clk = clock(); clk = clock();
if ( nSizeMax > 0 ) if ( nSizeMax > 0 )
...@@ -192,6 +191,7 @@ int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nConfLim ...@@ -192,6 +191,7 @@ int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nConfLim
} }
else else
pFrames = Saig_ManFramesBmc( pAig, nFrames ); pFrames = Saig_ManFramesBmc( pAig, nFrames );
*piFrame = nFrames;
if ( fVerbose ) if ( fVerbose )
{ {
printf( "AIG: PI/PO/Reg = %d/%d/%d. Node = %6d. Lev = %5d.\n", printf( "AIG: PI/PO/Reg = %d/%d/%d. Node = %6d. Lev = %5d.\n",
......
...@@ -178,6 +178,7 @@ Aig_Man_t * Saig_ManTransformed( Aig_Man_t * p ) ...@@ -178,6 +178,7 @@ Aig_Man_t * Saig_ManTransformed( Aig_Man_t * p )
Saig_ManForEachLiLo( p, pObjLi, pObjLo, i ) Saig_ManForEachLiLo( p, pObjLi, pObjLo, i )
{ {
pObj = Aig_Mux( pNew, pCtrl, pObjLo->pData, Aig_ObjChild0Copy(pObjLi) ); pObj = Aig_Mux( pNew, pCtrl, pObjLo->pData, Aig_ObjChild0Copy(pObjLi) );
// pObj = Aig_Mux( pNew, pCtrl, Aig_ManConst0(pNew), Aig_ObjChild0Copy(pObjLi) );
Aig_ObjCreatePo( pNew, pObj ); Aig_ObjCreatePo( pNew, pObj );
} }
Aig_ManCleanup( pNew ); Aig_ManCleanup( pNew );
...@@ -566,10 +567,10 @@ p->timeCnf += clock() - clk; ...@@ -566,10 +567,10 @@ p->timeCnf += clock() - clk;
// iterate the interpolation procedure // iterate the interpolation procedure
for ( i = 0; ; i++ ) for ( i = 0; ; i++ )
{ {
if ( p->nFrames + i >= 100 ) if ( p->nFrames + i >= 75 )
{ {
if ( fVerbose ) if ( fVerbose )
printf( "Reached limit (%d) on the number of timeframes.\n", 100 ); printf( "Reached limit (%d) on the number of timeframes.\n", 75 );
p->timeTotal = clock() - clkTotal; p->timeTotal = clock() - clkTotal;
Saig_ManagerFree( p ); Saig_ManagerFree( p );
return -1; return -1;
......
Comparing files abcDfs.c and C:\_PROJECTS\AARON\FRETIME\SRC\BASE\ABC\ABCDFS.C
***** abcDfs.c
return pNode->Level;
assert( Abc_ObjIsNode( pNode ) );
// if this node is already visited, return
***** C:\_PROJECTS\AARON\FRETIME\SRC\BASE\ABC\ABCDFS.C
return pNode->Level;
assert( Abc_ObjIsNode( pNode ) || pNode->Type == ABC_OBJ_CONST1);
// if this node is already visited, return
*****
***** abcDfs.c
return pNode->Level;
assert( Abc_ObjIsNode( pNode ) );
// if this node is already visited, return
***** C:\_PROJECTS\AARON\FRETIME\SRC\BASE\ABC\ABCDFS.C
return pNode->Level;
assert( Abc_ObjIsNode( pNode ) || pNode->Type == ABC_OBJ_CONST1);
// if this node is already visited, return
*****
...@@ -135,6 +135,7 @@ static inline int Abc_StringGetNumber( char ** ppStr ) ...@@ -135,6 +135,7 @@ static inline int Abc_StringGetNumber( char ** ppStr )
***********************************************************************/ ***********************************************************************/
int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj ) int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
{ {
int fAddFreeVars = 1;
char * pSop; char * pSop;
Abc_Obj_t ** pValues, ** pValuesF, ** pValuesF2; Abc_Obj_t ** pValues, ** pValuesF, ** pValuesF2;
Abc_Obj_t * pTemp, * pTemp2, * pFanin, * pFanin2, * pNet; Abc_Obj_t * pTemp, * pTemp2, * pFanin, * pFanin2, * pNet;
...@@ -168,7 +169,17 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj ) ...@@ -168,7 +169,17 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
else else
Index = Abc_StringGetNumber( &pSop ); Index = Abc_StringGetNumber( &pSop );
assert( Index < nValues ); assert( Index < nValues );
////////////////////////////////////////////
// adding free variables for binary ND-constants
if ( fAddFreeVars && nValues == 2 && *pSop == '-' )
{
pValues[1] = Abc_NtkCreatePi(pNtkNew);
pValues[0] = Abc_ObjNot( pValues[1] );
Abc_ObjAssignName( pValues[1], "free_var_", Abc_ObjName(pValues[1]) );
}
else
pValues[Index] = Abc_AigConst1(pNtkNew); pValues[Index] = Abc_AigConst1(pNtkNew);
////////////////////////////////////////////
// save the values in the fanout net // save the values in the fanout net
pNet->pCopy = (Abc_Obj_t *)pValues; pNet->pCopy = (Abc_Obj_t *)pValues;
return 1; return 1;
...@@ -414,6 +425,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -414,6 +425,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
for ( v = 0; v < nValues; v++ ) for ( v = 0; v < nValues; v++ )
{ {
pValues[v] = Abc_NtkCreatePi( pNtkNew ); pValues[v] = Abc_NtkCreatePi( pNtkNew );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pValues[v], Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pValues[v], pNet, v ); Abc_NtkConvertAssignName( pValues[v], pNet, v );
} }
// save the values in the fanout net // save the values in the fanout net
...@@ -432,6 +446,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -432,6 +446,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
for ( v = 0; v < nValues; v++ ) for ( v = 0; v < nValues; v++ )
{ {
pValues[v] = Abc_NtkCreateBo( pNtkNew ); pValues[v] = Abc_NtkCreateBo( pNtkNew );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pValues[v], Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pValues[v], pNet, v ); Abc_NtkConvertAssignName( pValues[v], pNet, v );
nCount1++; nCount1++;
} }
...@@ -455,6 +472,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -455,6 +472,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
for ( k = 0; k < nBits; k++ ) for ( k = 0; k < nBits; k++ )
{ {
pBits[k] = Abc_NtkCreatePi( pNtkNew ); pBits[k] = Abc_NtkCreatePi( pNtkNew );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pBits[k], Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pBits[k], pNet, k ); Abc_NtkConvertAssignName( pBits[k], pNet, k );
} }
// encode the values // encode the values
...@@ -484,6 +504,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -484,6 +504,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
for ( k = 0; k < nBits; k++ ) for ( k = 0; k < nBits; k++ )
{ {
pBits[k] = Abc_NtkCreateBo( pNtkNew ); pBits[k] = Abc_NtkCreateBo( pNtkNew );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pBits[k], Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pBits[k], pNet, k ); Abc_NtkConvertAssignName( pBits[k], pNet, k );
nCount1++; nCount1++;
} }
...@@ -522,15 +545,18 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -522,15 +545,18 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
continue; continue;
pNet = Abc_ObjFanin0(pObj); pNet = Abc_ObjFanin0(pObj);
// skip marked nets // skip marked nets
if ( Abc_NodeIsTravIdCurrent(pNet) ) // if ( Abc_NodeIsTravIdCurrent(pNet) )
continue; // continue;
Abc_NodeSetTravIdCurrent( pNet ); // Abc_NodeSetTravIdCurrent( pNet );
nValues = Abc_ObjMvVarNum(pNet); nValues = Abc_ObjMvVarNum(pNet);
pValues = (Abc_Obj_t **)pNet->pCopy; pValues = (Abc_Obj_t **)pNet->pCopy;
for ( v = 0; v < nValues; v++ ) for ( v = 0; v < nValues; v++ )
{ {
pTemp = Abc_NtkCreatePo( pNtkNew ); pTemp = Abc_NtkCreatePo( pNtkNew );
Abc_ObjAddFanin( pTemp, pValues[v] ); Abc_ObjAddFanin( pTemp, pValues[v] );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pTemp, pNet, v ); Abc_NtkConvertAssignName( pTemp, pNet, v );
} }
} }
...@@ -540,21 +566,24 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -540,21 +566,24 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
continue; continue;
pNet = Abc_ObjFanin0(pObj); pNet = Abc_ObjFanin0(pObj);
// skip marked nets // skip marked nets
if ( Abc_NodeIsTravIdCurrent(pNet) ) // if ( Abc_NodeIsTravIdCurrent(pNet) )
continue; // continue;
Abc_NodeSetTravIdCurrent( pNet ); // Abc_NodeSetTravIdCurrent( pNet );
nValues = Abc_ObjMvVarNum(pNet); nValues = Abc_ObjMvVarNum(pNet);
pValues = (Abc_Obj_t **)pNet->pCopy; pValues = (Abc_Obj_t **)pNet->pCopy;
for ( v = 0; v < nValues; v++ ) for ( v = 0; v < nValues; v++ )
{ {
pTemp = Abc_NtkCreateBi( pNtkNew ); pTemp = Abc_NtkCreateBi( pNtkNew );
Abc_ObjAddFanin( pTemp, pValues[v] ); Abc_ObjAddFanin( pTemp, pValues[v] );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pTemp, pNet, v ); Abc_NtkConvertAssignName( pTemp, pNet, v );
nCount2++; nCount2++;
} }
} }
} }
else else // if ( fPositional == 0 )
{ {
Abc_NtkForEachCo( pNtk, pObj, i ) Abc_NtkForEachCo( pNtk, pObj, i )
{ {
...@@ -562,9 +591,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -562,9 +591,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
continue; continue;
pNet = Abc_ObjFanin0(pObj); pNet = Abc_ObjFanin0(pObj);
// skip marked nets // skip marked nets
if ( Abc_NodeIsTravIdCurrent(pNet) ) // if ( Abc_NodeIsTravIdCurrent(pNet) )
continue; // continue;
Abc_NodeSetTravIdCurrent( pNet ); // Abc_NodeSetTravIdCurrent( pNet );
nValues = Abc_ObjMvVarNum(pNet); nValues = Abc_ObjMvVarNum(pNet);
pValues = (Abc_Obj_t **)pNet->pCopy; pValues = (Abc_Obj_t **)pNet->pCopy;
nBits = Extra_Base2Log( nValues ); nBits = Extra_Base2Log( nValues );
...@@ -576,6 +605,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -576,6 +605,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] ); pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] );
pTemp = Abc_NtkCreatePo( pNtkNew ); pTemp = Abc_NtkCreatePo( pNtkNew );
Abc_ObjAddFanin( pTemp, pBit ); Abc_ObjAddFanin( pTemp, pBit );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pTemp, pNet, k ); Abc_NtkConvertAssignName( pTemp, pNet, k );
} }
} }
...@@ -585,9 +617,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -585,9 +617,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
continue; continue;
pNet = Abc_ObjFanin0(pObj); pNet = Abc_ObjFanin0(pObj);
// skip marked nets // skip marked nets
if ( Abc_NodeIsTravIdCurrent(pNet) ) // if ( Abc_NodeIsTravIdCurrent(pNet) )
continue; // continue;
Abc_NodeSetTravIdCurrent( pNet ); // Abc_NodeSetTravIdCurrent( pNet );
nValues = Abc_ObjMvVarNum(pNet); nValues = Abc_ObjMvVarNum(pNet);
pValues = (Abc_Obj_t **)pNet->pCopy; pValues = (Abc_Obj_t **)pNet->pCopy;
nBits = Extra_Base2Log( nValues ); nBits = Extra_Base2Log( nValues );
...@@ -599,6 +631,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -599,6 +631,9 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] ); pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] );
pTemp = Abc_NtkCreateBi( pNtkNew ); pTemp = Abc_NtkCreateBi( pNtkNew );
Abc_ObjAddFanin( pTemp, pBit ); Abc_ObjAddFanin( pTemp, pBit );
if ( nValuesMax == 2 )
Abc_ObjAssignName( pTemp, Abc_ObjName(pNet), NULL );
else
Abc_NtkConvertAssignName( pTemp, pNet, k ); Abc_NtkConvertAssignName( pTemp, pNet, k );
nCount2++; nCount2++;
} }
...@@ -607,8 +642,32 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) ...@@ -607,8 +642,32 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
if ( Abc_NtkLatchNum(pNtk) ) if ( Abc_NtkLatchNum(pNtk) )
{ {
Vec_Ptr_t * vTemp;
Abc_Obj_t * pLatch, * pObjLi, * pObjLo; Abc_Obj_t * pLatch, * pObjLi, * pObjLo;
int i; int i;
// move free vars to the front among the PIs
vTemp = Vec_PtrAlloc( Vec_PtrSize(pNtkNew->vPis) );
Abc_NtkForEachPi( pNtkNew, pObj, i )
if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) == 0 )
Vec_PtrPush( vTemp, pObj );
Abc_NtkForEachPi( pNtkNew, pObj, i )
if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) != 0 )
Vec_PtrPush( vTemp, pObj );
assert( Vec_PtrSize(vTemp) == Vec_PtrSize(pNtkNew->vPis) );
Vec_PtrFree( pNtkNew->vPis );
pNtkNew->vPis = vTemp;
// move free vars to the front among the CIs
vTemp = Vec_PtrAlloc( Vec_PtrSize(pNtkNew->vCis) );
Abc_NtkForEachCi( pNtkNew, pObj, i )
if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) == 0 )
Vec_PtrPush( vTemp, pObj );
Abc_NtkForEachCi( pNtkNew, pObj, i )
if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) != 0 )
Vec_PtrPush( vTemp, pObj );
assert( Vec_PtrSize(vTemp) == Vec_PtrSize(pNtkNew->vCis) );
Vec_PtrFree( pNtkNew->vCis );
pNtkNew->vCis = vTemp;
// create registers
assert( nCount1 == nCount2 ); assert( nCount1 == nCount2 );
for ( i = 0; i < nCount1; i++ ) for ( i = 0; i < nCount1; i++ )
{ {
......
...@@ -92,6 +92,10 @@ void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin ) ...@@ -92,6 +92,10 @@ void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin )
{ {
int x = 0; int x = 0;
} }
if ( pObj->Id == 1960 )
{
int x = 0;
}
// printf( "Adding fanin of %s ", Abc_ObjName(pObj) ); // printf( "Adding fanin of %s ", Abc_ObjName(pObj) );
// printf( "to be %s\n", Abc_ObjName(pFanin) ); // printf( "to be %s\n", Abc_ObjName(pFanin) );
} }
......
...@@ -1229,7 +1229,7 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, in ...@@ -1229,7 +1229,7 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nFrames, int nSizeMax, int nBTLimit, in
RetValue = Saig_ManBmcSimple( pMan, nFrames, nSizeMax, nBTLimit, fRewrite, fVerbose, &iFrame ); RetValue = Saig_ManBmcSimple( pMan, nFrames, nSizeMax, nBTLimit, fRewrite, fVerbose, &iFrame );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL; pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
if ( RetValue == 1 ) if ( RetValue == 1 )
printf( "No output was asserted in %d frames. ", nFrames ); printf( "No output was asserted in %d frames. ", iFrame );
else if ( RetValue == -1 ) else if ( RetValue == -1 )
printf( "No output was asserted in %d frames. Reached conflict limit (%d). ", iFrame, nBTLimit ); printf( "No output was asserted in %d frames. Reached conflict limit (%d). ", iFrame, nBTLimit );
else // if ( RetValue == 0 ) else // if ( RetValue == 0 )
...@@ -1309,15 +1309,17 @@ PRT( "Time", clock() - clk ); ...@@ -1309,15 +1309,17 @@ PRT( "Time", clock() - clk );
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, int fPhaseAbstract, int fRetimeFirst, int fRetimeRegs, int fFraiging, int fVerbose, int fVeryVerbose, int TimeLimit ) int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar )
{ {
Aig_Man_t * pMan; Aig_Man_t * pMan;
int RetValue; int RetValue, clkTotal = clock();
if ( fTryComb ) if ( pSecPar->fTryComb || Abc_NtkLatchNum(pNtk) == 0 )
{ {
Prove_Params_t Params, * pParams = &Params; Prove_Params_t Params, * pParams = &Params;
Abc_Ntk_t * pNtkComb; Abc_Ntk_t * pNtkComb;
int RetValue, clk = clock(); int RetValue, clk = clock();
if ( Abc_NtkLatchNum(pNtk) == 0 )
printf( "The network has no latches. Running CEC.\n" );
// create combinational network // create combinational network
pNtkComb = Abc_NtkDup( pNtk ); pNtkComb = Abc_NtkDup( pNtk );
Abc_NtkMakeComb( pNtkComb, 1 ); Abc_NtkMakeComb( pNtkComb, 1 );
...@@ -1332,15 +1334,28 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, i ...@@ -1332,15 +1334,28 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, i
{ {
printf( "Networks are equivalent after CEC. " ); printf( "Networks are equivalent after CEC. " );
PRT( "Time", clock() - clk ); PRT( "Time", clock() - clk );
if ( pSecPar->fReportSolution )
{
printf( "SOLUTION: PASS " );
PRT( "Time", clock() - clkTotal );
}
return RetValue; return RetValue;
} }
} }
if ( fTryBmc ) if ( pSecPar->fTryBmc )
{ {
RetValue = Abc_NtkDarBmc( pNtk, 20, 100000, 1000, 0, 1, 0 ); RetValue = Abc_NtkDarBmc( pNtk, 20, 100000, 2000, 0, 1, 0 );
if ( RetValue == 0 ) if ( RetValue == 0 )
{
printf( "Networks are not equivalent.\n" );
if ( pSecPar->fReportSolution )
{
printf( "SOLUTION: FAIL " );
PRT( "Time", clock() - clkTotal );
}
return RetValue; return RetValue;
} }
}
// derive the AIG manager // derive the AIG manager
pMan = Abc_NtkToDar( pNtk, 0, 1 ); pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL ) if ( pMan == NULL )
...@@ -1350,7 +1365,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, i ...@@ -1350,7 +1365,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, i
} }
assert( pMan->nRegs > 0 ); assert( pMan->nRegs > 0 );
// perform verification // perform verification
RetValue = Fra_FraigSec( pMan, nFrames, fPhaseAbstract, fRetimeFirst, fRetimeRegs, fFraiging, fVerbose, fVeryVerbose, TimeLimit ); RetValue = Fra_FraigSec( pMan, pSecPar );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL; pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
if ( pNtk->pSeqModel ) if ( pNtk->pSeqModel )
{ {
...@@ -1372,7 +1387,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, i ...@@ -1372,7 +1387,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, int fTryComb, int fTryBmc, int nFrames, i
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fPhaseAbstract, int fRetimeFirst, int fRetimeRegs, int fFraiging, int fVerbose, int fVeryVerbose ) int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * pSecPar )
{ {
// Fraig_Params_t Params; // Fraig_Params_t Params;
Aig_Man_t * pMan; Aig_Man_t * pMan;
...@@ -1392,8 +1407,8 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fPhase ...@@ -1392,8 +1407,8 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fPhase
extern void Abc_NtkVerifyReportErrorSeq( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel, int nFrames ); extern void Abc_NtkVerifyReportErrorSeq( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel, int nFrames );
printf( "Networks are NOT EQUIVALENT after structural hashing.\n" ); printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
// report the error // report the error
pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, nFrames ); pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, pSecPar->nFramesMax );
Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, pMiter->pModel, nFrames ); Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, pMiter->pModel, pSecPar->nFramesMax );
FREE( pMiter->pModel ); FREE( pMiter->pModel );
Abc_NtkDelete( pMiter ); Abc_NtkDelete( pMiter );
return 0; return 0;
...@@ -1444,7 +1459,7 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fPhase ...@@ -1444,7 +1459,7 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fPhase
assert( pMan->nRegs > 0 ); assert( pMan->nRegs > 0 );
// perform verification // perform verification
RetValue = Fra_FraigSec( pMan, nFrames, fPhaseAbstract, fRetimeFirst, fRetimeRegs, fFraiging, fVerbose, fVeryVerbose, 0 ); RetValue = Fra_FraigSec( pMan, pSecPar );
Aig_ManStop( pMan ); Aig_ManStop( pMan );
return RetValue; return RetValue;
} }
......
...@@ -683,7 +683,7 @@ int IoCommandReadInit( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -683,7 +683,7 @@ int IoCommandReadInit( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage; goto usage;
} }
} }
if ( argc != globalUtilOptind + 1 ) if ( argc != globalUtilOptind && argc != globalUtilOptind + 1 )
goto usage; goto usage;
if ( pNtk == NULL ) if ( pNtk == NULL )
...@@ -692,7 +692,16 @@ int IoCommandReadInit( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -692,7 +692,16 @@ int IoCommandReadInit( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1; return 1;
} }
// get the input file name // get the input file name
if ( argc == globalUtilOptind + 1 )
pFileName = argv[globalUtilOptind]; pFileName = argv[globalUtilOptind];
else if ( pNtk->pSpec )
pFileName = Extra_FileNameGenericAppend( pNtk->pSpec, ".init" );
else
{
printf( "File name should be given on the command line.\n" );
return 1;
}
// read the file using the corresponding file reader // read the file using the corresponding file reader
pNtk = Abc_NtkDup( pNtk ); pNtk = Abc_NtkDup( pNtk );
Io_ReadBenchInit( pNtk, pFileName ); Io_ReadBenchInit( pNtk, pFileName );
......
...@@ -160,20 +160,10 @@ char * Extra_FileNameAppend( char * pBase, char * pSuffix ) ...@@ -160,20 +160,10 @@ char * Extra_FileNameAppend( char * pBase, char * pSuffix )
***********************************************************************/ ***********************************************************************/
char * Extra_FileNameGeneric( char * FileName ) char * Extra_FileNameGeneric( char * FileName )
{ {
char * pDot; char * pDot, * pRes;
char * pUnd;
char * pRes;
// find the generic name of the file
pRes = Extra_UtilStrsav( FileName ); pRes = Extra_UtilStrsav( FileName );
// find the pointer to the "." symbol in the file name if ( (pDot = strrchr( pRes, '.' )) )
// pUnd = strstr( FileName, "_" ); *pDot = 0;
pUnd = NULL;
pDot = strstr( FileName, "." );
if ( pUnd )
pRes[pUnd - FileName] = 0;
else if ( pDot )
pRes[pDot - FileName] = 0;
return pRes; return pRes;
} }
...@@ -193,8 +183,7 @@ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix ) ...@@ -193,8 +183,7 @@ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
static char Buffer[1000]; static char Buffer[1000];
char * pDot; char * pDot;
strcpy( Buffer, pBase ); strcpy( Buffer, pBase );
pDot = strstr( Buffer, "." ); if ( (pDot = strrchr( Buffer, '.' )) )
if ( pDot )
*pDot = 0; *pDot = 0;
strcat( Buffer, pSuffix ); strcat( Buffer, pSuffix );
return Buffer; return Buffer;
......
...@@ -789,7 +789,7 @@ clause* sat_solver_propagate(sat_solver* s) ...@@ -789,7 +789,7 @@ clause* sat_solver_propagate(sat_solver* s)
return confl; return confl;
} }
static inline int clause_cmp (const void* x, const void* y) { static int clause_cmp (const void* x, const void* y) {
return clause_size((clause*)x) > 2 && (clause_size((clause*)y) == 2 || clause_activity((clause*)x) < clause_activity((clause*)y)) ? -1 : 1; } return clause_size((clause*)x) > 2 && (clause_size((clause*)y) == 2 || clause_activity((clause*)x) < clause_activity((clause*)y)) ? -1 : 1; }
void sat_solver_reducedb(sat_solver* s) void sat_solver_reducedb(sat_solver* s)
......
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