Commit 69519f86 by Alan Mishchenko

Adding options to &flow.

parent a6c81c65
...@@ -369,7 +369,7 @@ Gia_Man_t * Gia_ManAigSynch2( Gia_Man_t * pInit, void * pPars0, int nLutSize ) ...@@ -369,7 +369,7 @@ Gia_Man_t * Gia_ManAigSynch2( Gia_Man_t * pInit, void * pPars0, int nLutSize )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fMinAve, int fVerbose ) void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fMinAve, int fUseMfs, int fVerbose )
{ {
char Command[200]; char Command[200];
sprintf( Command, "&unmap; &lf -K %d -C %d -k %s; &save", nLutSize, nCutNum, fMinAve?"-t":"" ); sprintf( Command, "&unmap; &lf -K %d -C %d -k %s; &save", nLutSize, nCutNum, fMinAve?"-t":"" );
...@@ -401,13 +401,15 @@ void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fMinAve, int f ...@@ -401,13 +401,15 @@ void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fMinAve, int f
} }
} }
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" );
if ( fUseMfs )
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&put; mfs2 -W 4 -M 500 -C 7000; &get -m" );
if ( fVerbose ) if ( fVerbose )
{ {
printf( "Mapping final:\n" ); printf( "Mapping final:\n" );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
} }
} }
void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fVerbose ) void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fUseMfs, int fVerbose )
{ {
char Command[200]; char Command[200];
...@@ -440,14 +442,14 @@ void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, i ...@@ -440,14 +442,14 @@ void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, i
} }
// perform first round of mapping // perform first round of mapping
Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fMinAve, fVerbose ); Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
// perform synthesis // perform synthesis
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&dsdb" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&dsdb" );
// perform second round of mapping // perform second round of mapping
Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fMinAve, fVerbose ); Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
// perform synthesis // perform synthesis
...@@ -458,9 +460,9 @@ void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, i ...@@ -458,9 +460,9 @@ void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, i
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
// perform third round of mapping // perform third round of mapping
Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fMinAve, fVerbose ); Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
} }
void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fVerbose ) void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fUseMfs, int fVerbose )
{ {
// remove comb equivs // remove comb equivs
if ( fIsMapped ) if ( fIsMapped )
...@@ -471,13 +473,13 @@ void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, in ...@@ -471,13 +473,13 @@ void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, in
// Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&fraig -c" ); // Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&fraig -c" );
// perform first round // perform first round
Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fVerbose ); Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
// perform synthesis // perform synthesis
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb" );
// perform first round // perform first round
Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fVerbose ); Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
} }
/**Function************************************************************* /**Function*************************************************************
......
...@@ -30921,13 +30921,14 @@ usage: ...@@ -30921,13 +30921,14 @@ usage:
***********************************************************************/ ***********************************************************************/
int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
extern void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fVerbose ); extern void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fUseMfs, int fVerbose );
int nLutSize = 6; int nLutSize = 6;
int nCutNum = 8; int nCutNum = 8;
int fMinAve = 0; int fMinAve = 0;
int fUseMfs = 0;
int c, fVerbose = 0; int c, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCtvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "KCtmvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -30956,6 +30957,9 @@ int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -30956,6 +30957,9 @@ int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv )
case 't': case 't':
fMinAve ^= 1; fMinAve ^= 1;
break; break;
case 'm':
fUseMfs ^= 1;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -30970,15 +30974,16 @@ int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -30970,15 +30974,16 @@ int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Flow(): There is no AIG.\n" ); Abc_Print( -1, "Abc_CommandAbc9Flow(): There is no AIG.\n" );
return 1; return 1;
} }
Gia_ManPerformFlow( Gia_ManHasMapping(pAbc->pGia), Gia_ManAndNum(pAbc->pGia), Gia_ManLevelNum(pAbc->pGia), nLutSize, nCutNum, fMinAve, fVerbose ); Gia_ManPerformFlow( Gia_ManHasMapping(pAbc->pGia), Gia_ManAndNum(pAbc->pGia), Gia_ManLevelNum(pAbc->pGia), nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: &flow [-KC num] [-tvh]\n" ); Abc_Print( -2, "usage: &flow [-KC num] [-tmvh]\n" );
Abc_Print( -2, "\t integration optimization and mapping flow\n" ); Abc_Print( -2, "\t integration optimization and mapping flow\n" );
Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize ); Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize );
Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum ); Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
Abc_Print( -2, "\t-t : toggle minimizing average rather than max delay [default = %s]\n", fMinAve? "yes": "no" ); Abc_Print( -2, "\t-t : toggle minimizing average rather than max delay [default = %s]\n", fMinAve? "yes": "no" );
Abc_Print( -2, "\t-m : toggle using \"mfs2\" in the script [default = %s]\n", fUseMfs? "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;
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