Commit 8066fdbc authored by Alan Mishchenko's avatar Alan Mishchenko

Adding generation of combinational speculative miters.

parent 06094ade
...@@ -36606,8 +36606,9 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36606,8 +36606,9 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
int fSpeculate = 1; int fSpeculate = 1;
int fSkipSome = 0; int fSkipSome = 0;
int fDualOut = 0; int fDualOut = 0;
int fComb = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Adrsfvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Adrsfcvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -36632,6 +36633,9 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36632,6 +36633,9 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'f': case 'f':
fSkipSome ^= 1; fSkipSome ^= 1;
break; break;
case 'c':
fComb ^= 1;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -36646,6 +36650,15 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36646,6 +36650,15 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" ); Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" );
return 1; return 1;
} }
if ( fComb )
{
extern int Cec4_ManSimulateOnlyTest( Gia_Man_t * p, int fVerbose );
int Result = Cec4_ManSimulateOnlyTest( pAbc->pGia, fVerbose );
extern Gia_Man_t * Gia_ManCombSpecReduce( Gia_Man_t * p );
pTemp = Gia_ManCombSpecReduce( pAbc->pGia );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
}
sprintf(pFileName, "gsrm%s.aig", fSpeculate? "" : "s" ); sprintf(pFileName, "gsrm%s.aig", fSpeculate? "" : "s" );
sprintf(pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" ); sprintf(pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" );
pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fSpeculate, fSkipSome, fVerbose ); pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fSpeculate, fSkipSome, fVerbose );
...@@ -36678,13 +36691,14 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -36678,13 +36691,14 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: &srm [-A file] [-drsfvh]\n" ); Abc_Print( -2, "usage: &srm [-A file] [-drsfcvh]\n" );
Abc_Print( -2, "\t writes speculatively reduced model into file \"%s\"\n", pFileName ); Abc_Print( -2, "\t derives or writes speculatively reduced model into file \"%s\"\n", pFileName );
Abc_Print( -2, "\t-A file : file name for dumping speculative-reduced model [default = \"gsrm.aig\"]\n" ); Abc_Print( -2, "\t-A file : file name for dumping speculative-reduced model [default = \"gsrm.aig\"]\n" );
Abc_Print( -2, "\t-d : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" ); Abc_Print( -2, "\t-d : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
Abc_Print( -2, "\t-r : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" ); Abc_Print( -2, "\t-r : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" );
Abc_Print( -2, "\t-s : toggle using speculation at the internal nodes [default = %s]\n", fSpeculate? "yes": "no" ); Abc_Print( -2, "\t-s : toggle using speculation at the internal nodes [default = %s]\n", fSpeculate? "yes": "no" );
Abc_Print( -2, "\t-f : toggle filtering to remove redundant equivalences [default = %s]\n", fSkipSome? "yes": "no" ); Abc_Print( -2, "\t-f : toggle filtering to remove redundant equivalences [default = %s]\n", fSkipSome? "yes": "no" );
Abc_Print( -2, "\t-c : toggle using combinational speculation [default = %s]\n", fComb? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
return 1; return 1;
...@@ -1651,7 +1651,7 @@ Gia_Obj_t * Cec4_ManFindRepr( Gia_Man_t * p, Cec4_Man_t * pMan, int iObj ) ...@@ -1651,7 +1651,7 @@ Gia_Obj_t * Cec4_ManFindRepr( Gia_Man_t * p, Cec4_Man_t * pMan, int iObj )
pMan->timeResimLoc += Abc_Clock() - clk; pMan->timeResimLoc += Abc_Clock() - clk;
return NULL; return NULL;
} }
int Cec4_ManPerformSweeping( Gia_Man_t * p, Cec_ParFra_t * pPars, Gia_Man_t ** ppNew ) int Cec4_ManPerformSweeping( Gia_Man_t * p, Cec_ParFra_t * pPars, Gia_Man_t ** ppNew, int fSimOnly )
{ {
Cec4_Man_t * pMan = Cec4_ManCreate( p, pPars ); Cec4_Man_t * pMan = Cec4_ManCreate( p, pPars );
Gia_Obj_t * pObj, * pRepr; Gia_Obj_t * pObj, * pRepr;
...@@ -1699,6 +1699,8 @@ int Cec4_ManPerformSweeping( Gia_Man_t * p, Cec_ParFra_t * pPars, Gia_Man_t ** p ...@@ -1699,6 +1699,8 @@ int Cec4_ManPerformSweeping( Gia_Man_t * p, Cec_ParFra_t * pPars, Gia_Man_t ** p
if ( i && i % (pPars->nRounds / 5) == 0 && pPars->fVerbose ) if ( i && i % (pPars->nRounds / 5) == 0 && pPars->fVerbose )
Cec4_ManPrintStats( p, pPars, pMan, 1 ); Cec4_ManPrintStats( p, pPars, pMan, 1 );
} }
if ( fSimOnly )
goto finalize;
// perform additional simulation // perform additional simulation
Cec4_ManCandIterStart( pMan ); Cec4_ManCandIterStart( pMan );
...@@ -1789,7 +1791,7 @@ finalize: ...@@ -1789,7 +1791,7 @@ finalize:
Gia_Man_t * Cec4_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars ) Gia_Man_t * Cec4_ManSimulateTest( Gia_Man_t * p, Cec_ParFra_t * pPars )
{ {
Gia_Man_t * pNew = NULL; Gia_Man_t * pNew = NULL;
Cec4_ManPerformSweeping( p, pPars, &pNew ); Cec4_ManPerformSweeping( p, pPars, &pNew, 0 );
return pNew; return pNew;
} }
void Cec4_ManSimulateTest2( Gia_Man_t * p, int fVerbose ) void Cec4_ManSimulateTest2( Gia_Man_t * p, int fVerbose )
...@@ -1797,7 +1799,7 @@ void Cec4_ManSimulateTest2( Gia_Man_t * p, int fVerbose ) ...@@ -1797,7 +1799,7 @@ void Cec4_ManSimulateTest2( Gia_Man_t * p, int fVerbose )
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
Cec_ParFra_t ParsFra, * pPars = &ParsFra; Cec_ParFra_t ParsFra, * pPars = &ParsFra;
Cec4_ManSetParams( pPars ); Cec4_ManSetParams( pPars );
Cec4_ManPerformSweeping( p, pPars, NULL ); Cec4_ManPerformSweeping( p, pPars, NULL, 0 );
pPars->fVerbose = fVerbose; pPars->fVerbose = fVerbose;
if ( fVerbose ) if ( fVerbose )
Abc_PrintTime( 1, "New choice computation time", Abc_Clock() - clk ); Abc_PrintTime( 1, "New choice computation time", Abc_Clock() - clk );
...@@ -1809,9 +1811,16 @@ Gia_Man_t * Cec4_ManSimulateTest3( Gia_Man_t * p, int nBTLimit, int fVerbose ) ...@@ -1809,9 +1811,16 @@ Gia_Man_t * Cec4_ManSimulateTest3( Gia_Man_t * p, int nBTLimit, int fVerbose )
Cec4_ManSetParams( pPars ); Cec4_ManSetParams( pPars );
pPars->fVerbose = fVerbose; pPars->fVerbose = fVerbose;
pPars->nBTLimit = nBTLimit; pPars->nBTLimit = nBTLimit;
Cec4_ManPerformSweeping( p, pPars, &pNew ); Cec4_ManPerformSweeping( p, pPars, &pNew, 0 );
return pNew; return pNew;
} }
int Cec4_ManSimulateOnlyTest( Gia_Man_t * p, int fVerbose )
{
Cec_ParFra_t ParsFra, * pPars = &ParsFra;
Cec4_ManSetParams( pPars );
pPars->fVerbose = fVerbose;
return Cec4_ManPerformSweeping( p, pPars, NULL, 1 );
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// END OF FILE /// /// END OF FILE ///
......
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