mirror of https://github.com/YosysHQ/abc.git
Adding switch -C <num> to 'amap' to control max number of cuts at a node.
This commit is contained in:
parent
140fd9ad9f
commit
f39369a415
|
|
@ -14063,7 +14063,7 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
fSweep = 0;
|
fSweep = 0;
|
||||||
Amap_ManSetDefaultParams( pPars );
|
Amap_ManSetDefaultParams( pPars );
|
||||||
Extra_UtilGetoptReset();
|
Extra_UtilGetoptReset();
|
||||||
while ( ( c = Extra_UtilGetopt( argc, argv, "FAEQmxisvh" ) ) != EOF )
|
while ( ( c = Extra_UtilGetopt( argc, argv, "FACEQmxisvh" ) ) != EOF )
|
||||||
{
|
{
|
||||||
switch ( c )
|
switch ( c )
|
||||||
{
|
{
|
||||||
|
|
@ -14089,6 +14089,17 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
if ( pPars->nIterArea < 0 )
|
if ( pPars->nIterArea < 0 )
|
||||||
goto usage;
|
goto usage;
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
if ( globalUtilOptind >= argc )
|
||||||
|
{
|
||||||
|
Abc_Print( -1, "Command line switch \"-C\" should be followed by a floating point number.\n" );
|
||||||
|
goto usage;
|
||||||
|
}
|
||||||
|
pPars->nCutsMax = atoi(argv[globalUtilOptind]);
|
||||||
|
globalUtilOptind++;
|
||||||
|
if ( pPars->nCutsMax < 0 )
|
||||||
|
goto usage;
|
||||||
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
if ( globalUtilOptind >= argc )
|
if ( globalUtilOptind >= argc )
|
||||||
{
|
{
|
||||||
|
|
@ -14190,10 +14201,11 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
Abc_Print( -2, "usage: amap [-FA <num>] [-EQ <float>] [-mxisvh]\n" );
|
Abc_Print( -2, "usage: amap [-FAC <num>] [-EQ <float>] [-mxisvh]\n" );
|
||||||
Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
|
Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
|
||||||
Abc_Print( -2, "\t-F num : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
|
Abc_Print( -2, "\t-F num : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
|
||||||
Abc_Print( -2, "\t-A num : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
|
Abc_Print( -2, "\t-A num : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
|
||||||
|
Abc_Print( -2, "\t-C num : the maximum number of cuts at a node [default = %d]\n", pPars->nCutsMax );
|
||||||
Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
|
Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
|
||||||
Abc_Print( -2, "\t-Q float : area/delay preference ratio [default = %.2f (area-only)] \n", pPars->fADratio );
|
Abc_Print( -2, "\t-Q float : area/delay preference ratio [default = %.2f (area-only)] \n", pPars->fADratio );
|
||||||
Abc_Print( -2, "\t-m : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
|
Abc_Print( -2, "\t-m : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ struct Amap_Par_t_
|
||||||
{
|
{
|
||||||
int nIterFlow; // iterations of area flow
|
int nIterFlow; // iterations of area flow
|
||||||
int nIterArea; // iteratoins of exact area
|
int nIterArea; // iteratoins of exact area
|
||||||
|
int nCutsMax; // the maximum number of cuts at a node
|
||||||
int fUseMuxes; // enables the use of MUXes
|
int fUseMuxes; // enables the use of MUXes
|
||||||
int fUseXors; // enables the use of XORs
|
int fUseXors; // enables the use of XORs
|
||||||
int fFreeInvs; // assume inverters are free (area = 0)
|
int fFreeInvs; // assume inverters are free (area = 0)
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ void Amap_ManSetDefaultParams( Amap_Par_t * p )
|
||||||
memset( p, 0, sizeof(Amap_Par_t) );
|
memset( p, 0, sizeof(Amap_Par_t) );
|
||||||
p->nIterFlow = 1; // iterations of area flow
|
p->nIterFlow = 1; // iterations of area flow
|
||||||
p->nIterArea = 4; // iteratoins of exact area
|
p->nIterArea = 4; // iteratoins of exact area
|
||||||
|
p->nCutsMax = 500; // the maximum number of cuts at a node
|
||||||
p->fUseMuxes = 0; // enables the use of MUXes
|
p->fUseMuxes = 0; // enables the use of MUXes
|
||||||
p->fUseXors = 1; // enables the use of XORs
|
p->fUseXors = 1; // enables the use of XORs
|
||||||
p->fFreeInvs = 0; // assume inverters are free (area = 0)
|
p->fFreeInvs = 0; // assume inverters are free (area = 0)
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ Amap_Cut_t * Amap_ManCutCreate3( Amap_Man_t * p,
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
void Amap_ManCutSaveStored( Amap_Man_t * p, Amap_Obj_t * pNode )
|
void Amap_ManCutSaveStored( Amap_Man_t * p, Amap_Obj_t * pNode )
|
||||||
{
|
{
|
||||||
int nMaxCuts = 500;
|
int nMaxCuts = p->pPars->nCutsMax;
|
||||||
int * pBuffer;
|
int * pBuffer;
|
||||||
Amap_Cut_t * pNext, * pCut;
|
Amap_Cut_t * pNext, * pCut;
|
||||||
int i, nWords, Entry, nCuts, nCuts2;
|
int i, nWords, Entry, nCuts, nCuts2;
|
||||||
|
|
@ -522,8 +522,8 @@ void Amap_ManMerge( Amap_Man_t * p )
|
||||||
if ( p->pPars->fVerbose )
|
if ( p->pPars->fVerbose )
|
||||||
{
|
{
|
||||||
printf( "AIG object is %d bytes. ", (int)sizeof(Amap_Obj_t) );
|
printf( "AIG object is %d bytes. ", (int)sizeof(Amap_Obj_t) );
|
||||||
printf( "Internal AIG = %5.2f MB. Cuts = %5.2f MB.\n",
|
printf( "Internal AIG = %5.2f MB. Cuts = %5.2f MB. CutsMax = %d.\n",
|
||||||
1.0*Amap_ManObjNum(p)*sizeof(Amap_Obj_t)/(1<<20), 1.0*p->nBytesUsed/(1<<20) );
|
1.0*Amap_ManObjNum(p)*sizeof(Amap_Obj_t)/(1<<20), 1.0*p->nBytesUsed/(1<<20), p->pPars->nCutsMax );
|
||||||
printf( "Node =%6d. Try =%9d. Try3 =%10d. Used =%7d. R =%6.2f. ",
|
printf( "Node =%6d. Try =%9d. Try3 =%10d. Used =%7d. R =%6.2f. ",
|
||||||
Amap_ManNodeNum(p), p->nCutsTried, p->nCutsTried3, p->nCutsUsed,
|
Amap_ManNodeNum(p), p->nCutsTried, p->nCutsTried3, p->nCutsUsed,
|
||||||
1.0*p->nCutsUsed/Amap_ManNodeNum(p) );
|
1.0*p->nCutsUsed/Amap_ManNodeNum(p) );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue