Commit e2e3f6a2 by Alan Mishchenko

Improvements in sequential verification.

parent a0cc6215
...@@ -870,8 +870,11 @@ int Ssw_SecSpecial( Aig_Man_t * pPart0, Aig_Man_t * pPart1, int nFrames, int fVe ...@@ -870,8 +870,11 @@ int Ssw_SecSpecial( Aig_Man_t * pPart0, Aig_Man_t * pPart1, int nFrames, int fVe
int iOut, nOuts; int iOut, nOuts;
Aig_Man_t * pMiterCec; Aig_Man_t * pMiterCec;
int RetValue, clkTotal = clock(); int RetValue, clkTotal = clock();
Aig_ManPrintStats( pPart0 ); if ( fVerbose )
Aig_ManPrintStats( pPart1 ); {
Aig_ManPrintStats( pPart0 );
Aig_ManPrintStats( pPart1 );
}
// Aig_ManDumpBlif( pPart0, "file0.blif", NULL, NULL ); // Aig_ManDumpBlif( pPart0, "file0.blif", NULL, NULL );
// Aig_ManDumpBlif( pPart1, "file1.blif", NULL, NULL ); // Aig_ManDumpBlif( pPart1, "file1.blif", NULL, NULL );
// assert( Aig_ManNodeNum(pPart0) <= Aig_ManNodeNum(pPart1) ); // assert( Aig_ManNodeNum(pPart0) <= Aig_ManNodeNum(pPart1) );
...@@ -879,8 +882,8 @@ int Ssw_SecSpecial( Aig_Man_t * pPart0, Aig_Man_t * pPart1, int nFrames, int fVe ...@@ -879,8 +882,8 @@ int Ssw_SecSpecial( Aig_Man_t * pPart0, Aig_Man_t * pPart1, int nFrames, int fVe
{ {
printf( "Warning: The design after synthesis is smaller!\n" ); printf( "Warning: The design after synthesis is smaller!\n" );
printf( "This warning may indicate that the order of designs is changed.\n" ); printf( "This warning may indicate that the order of designs is changed.\n" );
printf( "The solver expects the original disign as first argument and\n" ); printf( "The solver expects the original design as first argument and\n" );
printf( "the modified design as the second argument in Ssw_SecSpecial().\n" ); printf( "the modified design as the second argument in \"absec\".\n" );
} }
// create two-level miter // create two-level miter
pMiterCec = Saig_ManCreateMiterTwo( pPart0, pPart1, nFrames ); pMiterCec = Saig_ManCreateMiterTwo( pPart0, pPart1, nFrames );
...@@ -950,7 +953,7 @@ int Ssw_SecSpecialMiter( Aig_Man_t * p0, Aig_Man_t * p1, int nFrames, int fVerbo ...@@ -950,7 +953,7 @@ int Ssw_SecSpecialMiter( Aig_Man_t * p0, Aig_Man_t * p1, int nFrames, int fVerbo
Aig_Man_t * pPart0, * pPart1; Aig_Man_t * pPart0, * pPart1;
int RetValue; int RetValue;
if ( fVerbose ) if ( fVerbose )
printf( "Performing sequential verification combinational A/B miter.\n" ); printf( "Performing sequential verification using combinational A/B miter.\n" );
// consider the case when a miter is given // consider the case when a miter is given
if ( p1 == NULL ) if ( p1 == NULL )
{ {
...@@ -964,6 +967,13 @@ int Ssw_SecSpecialMiter( Aig_Man_t * p0, Aig_Man_t * p1, int nFrames, int fVerbo ...@@ -964,6 +967,13 @@ int Ssw_SecSpecialMiter( Aig_Man_t * p0, Aig_Man_t * p1, int nFrames, int fVerbo
printf( "Demitering has failed.\n" ); printf( "Demitering has failed.\n" );
return -1; return -1;
} }
if ( Aig_ManRegNum(pPart0) != Aig_ManRegNum(pPart1) )
{
Aig_ManStop( pPart0 );
Aig_ManStop( pPart1 );
printf( "After demitering AIGs have different number of flops. Quitting.\n" );
return -1;
}
} }
else else
{ {
......
...@@ -17011,12 +17011,12 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -17011,12 +17011,12 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
int fMiter, nFrames, fVerbose, c; int fMiter, nFrames, fVerbose, c;
extern int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVerbose ); extern int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc); pNtk = Abc_FrameReadNtk(pAbc);
// set defaults // set defaults
fMiter = 1; fMiter = 1;
nFrames = 2; nFrames = 2;
fVerbose = 1; fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
{ {
...@@ -17033,7 +17033,7 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -17033,7 +17033,7 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nFrames < 0 ) if ( nFrames < 0 )
goto usage; goto usage;
break; break;
case 'm': case 'm':
fMiter ^= 1; fMiter ^= 1;
break; break;
case 'v': case 'v':
...@@ -17044,14 +17044,26 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -17044,14 +17044,26 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
} }
} }
if ( fMiter ) if ( fMiter )
{ {
if ( argc == globalUtilOptind + 1 )
{
pNtk = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1 );
if ( pNtk == NULL )
{
Abc_Print( -1, "Cannot read network from file \"%s\".\n", argv[globalUtilOptind] );
return 0;
}
}
else
pNtk = Abc_NtkDup( pNtk );
if ( !Abc_NtkIsStrash(pNtk) ) if ( !Abc_NtkIsStrash(pNtk) )
{ {
Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" ); pNtk = Abc_NtkStrash( pNtk2 = pNtk, 0, 1, 0 );
return 0; Abc_NtkDelete( pNtk2 );
} }
Abc_NtkDarAbSec( pNtk, NULL, nFrames, fVerbose ); Abc_NtkDarAbSec( pNtk, NULL, nFrames, fVerbose );
Abc_NtkDelete( pNtk );
} }
else else
{ {
......
...@@ -2017,6 +2017,7 @@ int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t * ...@@ -2017,6 +2017,7 @@ int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t *
***********************************************************************/ ***********************************************************************/
int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk ) int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk )
{ {
char * pFileNameGeneric, pFileName0[1000], pFileName1[1000];
Aig_Man_t * pMan, * pPart0, * pPart1;//, * pMiter; Aig_Man_t * pMan, * pPart0, * pPart1;//, * pMiter;
// derive the AIG manager // derive the AIG manager
pMan = Abc_NtkToDar( pNtk, 0, 1 ); pMan = Abc_NtkToDar( pNtk, 0, 1 );
...@@ -2031,15 +2032,20 @@ int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk ) ...@@ -2031,15 +2032,20 @@ int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk )
printf( "Demitering has failed.\n" ); printf( "Demitering has failed.\n" );
return 0; return 0;
} }
Aig_ManDumpBlif( pPart0, "part0.blif", NULL, NULL ); // create file names
Aig_ManDumpBlif( pPart1, "part1.blif", NULL, NULL ); pFileNameGeneric = Extra_FileNameGeneric( pNtk->pSpec );
printf( "The result of demitering is written into files \"%s\" and \"%s\".\n", "part0.blif", "part1.blif" ); sprintf( pFileName0, "%s%s", pFileNameGeneric, "_part0.aig" );
sprintf( pFileName1, "%s%s", pFileNameGeneric, "_part1.aig" );
ABC_FREE( pFileNameGeneric );
// dump files
Ioa_WriteAiger( pPart0, pFileName0, 0, 0 );
Ioa_WriteAiger( pPart1, pFileName1, 0, 0 );
printf( "Demitering produced two files \"%s\" and \"%s\".\n", pFileName0, pFileName1 );
// create two-level miter // create two-level miter
// pMiter = Saig_ManCreateMiterTwo( pPart0, pPart1, 2 ); // pMiter = Saig_ManCreateMiterTwo( pPart0, pPart1, 2 );
// Aig_ManDumpBlif( pMiter, "miter01.blif", NULL, NULL ); // Aig_ManDumpBlif( pMiter, "miter01.blif", NULL, NULL );
// Aig_ManStop( pMiter ); // Aig_ManStop( pMiter );
// printf( "The new miter is written into file \"%s\".\n", "miter01.blif" ); // printf( "The new miter is written into file \"%s\".\n", "miter01.blif" );
Aig_ManStop( pPart0 ); Aig_ManStop( pPart0 );
Aig_ManStop( pPart1 ); Aig_ManStop( pPart1 );
Aig_ManStop( pMan ); Aig_ManStop( pMan );
...@@ -2315,12 +2321,33 @@ int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVer ...@@ -2315,12 +2321,33 @@ int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVer
pMan2 = Abc_NtkToDar( pNtk2, 0, 1 ); pMan2 = Abc_NtkToDar( pNtk2, 0, 1 );
if ( pMan2 == NULL ) if ( pMan2 == NULL )
{ {
Aig_ManStop( pMan1 );
printf( "Converting miter into AIG has failed.\n" ); printf( "Converting miter into AIG has failed.\n" );
return -1; return -1;
} }
assert( Aig_ManRegNum(pMan2) > 0 ); assert( Aig_ManRegNum(pMan2) > 0 );
if ( Saig_ManPiNum(pMan1) != Saig_ManPiNum(pMan2) )
{
Aig_ManStop( pMan1 );
Aig_ManStop( pMan2 );
printf( "The networks have different number of PIs.\n" );
return -1;
}
if ( Saig_ManPoNum(pMan1) != Saig_ManPoNum(pMan2) )
{
Aig_ManStop( pMan1 );
Aig_ManStop( pMan2 );
printf( "The networks have different number of POs.\n" );
return -1;
}
if ( Aig_ManRegNum(pMan1) != Aig_ManRegNum(pMan2) )
{
Aig_ManStop( pMan1 );
Aig_ManStop( pMan2 );
printf( "The networks have different number of flops.\n" );
return -1;
}
} }
// perform verification // perform verification
RetValue = Ssw_SecSpecialMiter( pMan1, pMan2, nFrames, fVerbose ); RetValue = Ssw_SecSpecialMiter( pMan1, pMan2, nFrames, fVerbose );
Aig_ManStop( pMan1 ); Aig_ManStop( pMan1 );
......
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