mirror of https://github.com/YosysHQ/abc.git
zero cost hop
This commit is contained in:
parent
a3fb930e44
commit
3af039d7c3
|
|
@ -16,6 +16,7 @@ extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
|
|||
extern int Abc_NtkPerformMfs( Abc_Ntk_t * pNtk, Sfm_Par_t * pPars );
|
||||
extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
|
||||
extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int nLitCountMax, int fCanonDivs, int fVerbose, int fVeryVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars );
|
||||
|
||||
Abc_Ntk_t * Gia_ManTranStochPut( Gia_Man_t * pGia ) {
|
||||
Abc_Ntk_t * pNtk;
|
||||
|
|
@ -49,6 +50,13 @@ void Gia_ManTranStochFx( Abc_Ntk_t * pNtk ) {
|
|||
Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fCanonDivs, p->fVerbose, p->fVeryVerbose );
|
||||
Abc_NtkFxuFreeInfo( p );
|
||||
}
|
||||
Abc_Ntk_t * Gia_ManTranStochDrw( Abc_Ntk_t * pNtk ) {
|
||||
Dar_RwrPar_t Pars, * pPars = &Pars;
|
||||
Dar_ManDefaultRwrParams( pPars );
|
||||
pPars->nMinSaved = 0;
|
||||
pPars->fUseZeros = 1;
|
||||
return Abc_NtkDRewrite( pNtk, pPars );
|
||||
}
|
||||
|
||||
struct Gia_ManTranStochParam {
|
||||
int nSeed;
|
||||
|
|
@ -61,6 +69,7 @@ struct Gia_ManTranStochParam {
|
|||
int fTruth;
|
||||
int fNewLine;
|
||||
Gia_Man_t * pExdc;
|
||||
int fZeroCostHop;
|
||||
int nVerbose;
|
||||
};
|
||||
|
||||
|
|
@ -109,13 +118,19 @@ Gia_Man_t * Gia_ManTranStochOpt2( Gia_ManTranStochParam * p, Gia_Man_t * pOld )
|
|||
break;
|
||||
pNtk = Gia_ManTranStochPut( pGia );
|
||||
Gia_ManStop( pGia );
|
||||
pNtkRes = Gia_ManTranStochIf( pNtk );
|
||||
Abc_NtkDelete( pNtk );
|
||||
pNtk = pNtkRes;
|
||||
Gia_ManTranStochMfs2( pNtk );
|
||||
pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
|
||||
Abc_NtkDelete( pNtk );
|
||||
pNtk = pNtkRes;
|
||||
if ( p->fZeroCostHop ) {
|
||||
pNtkRes = Gia_ManTranStochDrw( pNtk );
|
||||
Abc_NtkDelete( pNtk );
|
||||
pNtk = pNtkRes;
|
||||
} else {
|
||||
pNtkRes = Gia_ManTranStochIf( pNtk );
|
||||
Abc_NtkDelete( pNtk );
|
||||
pNtk = pNtkRes;
|
||||
Gia_ManTranStochMfs2( pNtk );
|
||||
pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
|
||||
Abc_NtkDelete( pNtk );
|
||||
pNtk = pNtkRes;
|
||||
}
|
||||
pGia = Gia_ManTranStochGet( pNtk );
|
||||
Abc_NtkDelete( pNtk );
|
||||
if ( p->nVerbose )
|
||||
|
|
@ -145,7 +160,7 @@ Gia_Man_t * Gia_ManTranStochOpt3( Gia_ManTranStochParam * p, Gia_Man_t * pOld )
|
|||
return pBest;
|
||||
}
|
||||
|
||||
Gia_Man_t * Gia_ManTranStoch( Gia_Man_t * pGia, int nRestarts, int nHops, int nSeedBase, int fMspf, int fMerge, int fResetHop, int fTruth, int fSingle, int fOriginalOnly, int fNewLine, Gia_Man_t * pExdc, int nVerbose ) {
|
||||
Gia_Man_t * Gia_ManTranStoch( Gia_Man_t * pGia, int nRestarts, int nHops, int nSeedBase, int fMspf, int fMerge, int fResetHop, int fZeroCostHop, int fTruth, int fSingle, int fOriginalOnly, int fNewLine, Gia_Man_t * pExdc, int nVerbose ) {
|
||||
int i, j = 0;
|
||||
Gia_Man_t * pNew, * pBest, * pStart;
|
||||
Abc_Ntk_t * pNtk, * pNtkRes;
|
||||
|
|
@ -156,6 +171,7 @@ Gia_Man_t * Gia_ManTranStoch( Gia_Man_t * pGia, int nRestarts, int nHops, int nS
|
|||
p->fMspf = fMspf;
|
||||
p->fMerge = fMerge;
|
||||
p->fResetHop = fResetHop;
|
||||
p->fZeroCostHop = fZeroCostHop;
|
||||
p->fTruth = fTruth;
|
||||
p->fNewLine = fNewLine;
|
||||
p->pExdc = pExdc;
|
||||
|
|
|
|||
|
|
@ -42754,11 +42754,11 @@ usage:
|
|||
***********************************************************************/
|
||||
int Abc_CommandAbc9TranStoch( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
extern Gia_Man_t * Gia_ManTranStoch( Gia_Man_t * pGia, int nRestarts, int nHops, int nSeedBase, int fMspf, int fMerge, int fResetHop, int fTruth, int fSingle, int fOriginalOnly, int fNewLine, Gia_Man_t * pExdc, int nVerbose );
|
||||
extern Gia_Man_t * Gia_ManTranStoch( Gia_Man_t * pGia, int nRestarts, int nHops, int nSeedBase, int fMspf, int fMerge, int fResetHop, int fZeroCostHop, int fTruth, int fSingle, int fOriginalOnly, int fNewLine, Gia_Man_t * pExdc, int nVerbose );
|
||||
Gia_Man_t * pTemp, * pExdc = NULL;
|
||||
int c, nRestarts = 0, nHops = 10, nSeedBase = 0, fMspf = 1, fMerge = 1, fResetHop = 1, fTruth = 0, fSingle = 0, fOriginalOnly = 0, fNewLine = 0, nVerbose = 1;
|
||||
int c, nRestarts = 0, nHops = 10, nSeedBase = 0, fMspf = 1, fMerge = 1, fResetHop = 1, fZeroCostHop = 0, fTruth = 0, fSingle = 0, fOriginalOnly = 0, fNewLine = 0, nVerbose = 1;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "NMRVmgrtsonh" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "NMRVmgrztsonh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -42807,6 +42807,9 @@ int Abc_CommandAbc9TranStoch( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
case 'r':
|
||||
fResetHop ^= 1;
|
||||
break;
|
||||
case 'z':
|
||||
fZeroCostHop ^= 1;
|
||||
break;
|
||||
case 't':
|
||||
fTruth ^= 1;
|
||||
break;
|
||||
|
|
@ -42851,14 +42854,14 @@ int Abc_CommandAbc9TranStoch( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
|
||||
pTemp = Gia_ManTranStoch( pAbc->pGia, nRestarts, nHops, nSeedBase, fMspf, fMerge, fResetHop, fTruth, fSingle, fOriginalOnly, fNewLine, pExdc, nVerbose );
|
||||
pTemp = Gia_ManTranStoch( pAbc->pGia, nRestarts, nHops, nSeedBase, fMspf, fMerge, fResetHop, fZeroCostHop, fTruth, fSingle, fOriginalOnly, fNewLine, pExdc, nVerbose );
|
||||
if ( pExdc != NULL )
|
||||
Gia_ManStop( pExdc );
|
||||
Abc_FrameUpdateGia( pAbc, pTemp );
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: &transtoch [-NMRV num] [-mgrtsonh] <file>\n" );
|
||||
Abc_Print( -2, "usage: &transtoch [-NMRV num] [-mgrztsonh] <file>\n" );
|
||||
Abc_Print( -2, "\t iterates transduction with randomized parameters\n" );
|
||||
Abc_Print( -2, "\t-N num : number of restarts [default = %d]\n", nRestarts );
|
||||
Abc_Print( -2, "\t-M num : number of hops (if; mfs2; strash) [default = %d]\n", nHops );
|
||||
|
|
@ -42867,6 +42870,7 @@ usage:
|
|||
Abc_Print( -2, "\t-m : toggles using MSPF instead of CSPF [default = %s]\n", fMspf? "yes": "no" );
|
||||
Abc_Print( -2, "\t-g : toggles using ResubShared [default = %s]\n", fMerge? "yes": "no" );
|
||||
Abc_Print( -2, "\t-r : toggles resetting hop count when new minimum is found [default = %s]\n", fResetHop? "yes": "no" );
|
||||
Abc_Print( -2, "\t-z : toggles using \"drw -z\" instead of \"if;mfs2;st\" for hop [default = %s]\n", fZeroCostHop? "yes": "no" );
|
||||
Abc_Print( -2, "\t-t : toggles using truth table instead of BDD [default = %s]\n", fTruth? "yes": "no" );
|
||||
Abc_Print( -2, "\t-s : toggles starting from the smallest starting point [default = %s]\n", fSingle? "yes": "no" );
|
||||
Abc_Print( -2, "\t-o : toggles starting from the given AIG [default = %s]\n", fOriginalOnly? "yes": "no" );
|
||||
|
|
|
|||
Loading…
Reference in New Issue