mirror of https://github.com/YosysHQ/abc.git
Add '-p' option to 'constr' to allow fully removing constraints
Invoking 'constr -r' converts constraints into POs but does not fully
remove them. Now 'constr -pr' can be used to completely remove them,
leaving the set of non-constraint POs unchanged.
(cherry picked from commit 8c923ad492)
This commit is contained in:
parent
6d52a1e449
commit
adbcb914b2
|
|
@ -29337,17 +29337,20 @@ usage:
|
|||
int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
Abc_Ntk_t * pNtk;
|
||||
Abc_Ntk_t * pNtkRes;
|
||||
int c;
|
||||
int nFrames;
|
||||
int nConfs;
|
||||
int nProps;
|
||||
int fRemove;
|
||||
int fPurge;
|
||||
int fStruct;
|
||||
int fInvert;
|
||||
int fOldAlgo;
|
||||
int fVerbose;
|
||||
int nConstrs;
|
||||
extern void Abc_NtkDarConstr( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, int Output, int nRange );
|
||||
|
||||
pNtk = Abc_FrameReadNtk(pAbc);
|
||||
// set defaults
|
||||
|
|
@ -29355,13 +29358,14 @@ int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
nConfs = 1000;
|
||||
nProps = 1000;
|
||||
fRemove = 0;
|
||||
fPurge = 0;
|
||||
fStruct = 0;
|
||||
fInvert = 0;
|
||||
fOldAlgo = 0;
|
||||
fVerbose = 0;
|
||||
nConstrs = -1;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "FCPNrsiavh" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "FCPNrpsiavh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -29412,6 +29416,9 @@ int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
case 'r':
|
||||
fRemove ^= 1;
|
||||
break;
|
||||
case 'p':
|
||||
fPurge ^= 1;
|
||||
break;
|
||||
case 's':
|
||||
fStruct ^= 1;
|
||||
break;
|
||||
|
|
@ -29447,7 +29454,22 @@ int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
Abc_Print( -1, "Constraints are not defined.\n" );
|
||||
return 0;
|
||||
}
|
||||
Abc_Print( 1, "Constraints are converted to be primary outputs.\n" );
|
||||
|
||||
if ( fPurge )
|
||||
{
|
||||
Abc_Print( 1, "Constraints are removed.\n" );
|
||||
pNtkRes = Abc_NtkMakeOnePo( pNtk, 0, Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk) );
|
||||
if ( pNtkRes == NULL )
|
||||
{
|
||||
Abc_Print( 1,"Transformation has failed.\n" );
|
||||
return 1;
|
||||
}
|
||||
// replace the current network
|
||||
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
|
||||
pNtk = Abc_FrameReadNtk(pAbc);
|
||||
}
|
||||
else
|
||||
Abc_Print( 1, "Constraints are converted to be primary outputs.\n" );
|
||||
pNtk->nConstrs = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -29492,7 +29514,7 @@ int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
Abc_NtkDarConstr( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
|
||||
return 0;
|
||||
usage:
|
||||
Abc_Print( -2, "usage: constr [-FCPN num] [-risavh]\n" );
|
||||
Abc_Print( -2, "usage: constr [-FCPN num] [-rpisavh]\n" );
|
||||
Abc_Print( -2, "\t a toolkit for constraint manipulation\n" );
|
||||
Abc_Print( -2, "\t if constraints are absent, detect them functionally\n" );
|
||||
Abc_Print( -2, "\t if constraints are present, profiles them using random simulation\n" );
|
||||
|
|
@ -29501,7 +29523,8 @@ usage:
|
|||
Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
|
||||
Abc_Print( -2, "\t-P num : the max number of propagations in SAT solving [default = %d]\n", nProps );
|
||||
Abc_Print( -2, "\t-N num : manually set the last <num> POs to be constraints [default = %d]\n", nConstrs );
|
||||
Abc_Print( -2, "\t-r : manually remove the constraints [default = %s]\n", fRemove? "yes": "no" );
|
||||
Abc_Print( -2, "\t-r : manually remove the constraints, converting them to POs [default = %s]\n", fRemove? "yes": "no" );
|
||||
Abc_Print( -2, "\t-p : remove constraints instead of converting them to POs [default = %s]\n", fPurge? "yes": "no" );
|
||||
Abc_Print( -2, "\t-i : toggle inverting already defined constraints [default = %s]\n", fInvert? "yes": "no" );
|
||||
Abc_Print( -2, "\t-s : toggle using structural detection methods [default = %s]\n", fStruct? "yes": "no" );
|
||||
Abc_Print( -2, "\t-a : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
|
||||
|
|
|
|||
Loading…
Reference in New Issue