mirror of https://github.com/YosysHQ/abc.git
Adding options to &flow.
This commit is contained in:
parent
a6c81c65df
commit
69519f86cd
|
|
@ -369,7 +369,7 @@ Gia_Man_t * Gia_ManAigSynch2( Gia_Man_t * pInit, void * pPars0, int nLutSize )
|
|||
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];
|
||||
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
|
|||
}
|
||||
}
|
||||
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" );
|
||||
if ( fUseMfs )
|
||||
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&put; mfs2 -W 4 -M 500 -C 7000; &get -m" );
|
||||
if ( fVerbose )
|
||||
{
|
||||
printf( "Mapping final:\n" );
|
||||
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];
|
||||
|
||||
|
|
@ -440,14 +442,14 @@ void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, i
|
|||
}
|
||||
|
||||
// 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" );
|
||||
|
||||
// perform synthesis
|
||||
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&dsdb" );
|
||||
|
||||
// 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" );
|
||||
|
||||
// perform synthesis
|
||||
|
|
@ -458,9 +460,9 @@ void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, i
|
|||
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
|
||||
|
||||
// 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
|
||||
if ( fIsMapped )
|
||||
|
|
@ -471,13 +473,13 @@ void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, in
|
|||
// Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&fraig -c" );
|
||||
|
||||
// perform first round
|
||||
Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fVerbose );
|
||||
Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
|
||||
|
||||
// perform synthesis
|
||||
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb" );
|
||||
|
||||
// perform first round
|
||||
Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fVerbose );
|
||||
Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
|
|||
|
|
@ -30921,13 +30921,14 @@ usage:
|
|||
***********************************************************************/
|
||||
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 nCutNum = 8;
|
||||
int fMinAve = 0;
|
||||
int fUseMfs = 0;
|
||||
int c, fVerbose = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "KCtvh" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "KCtmvh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
|
|
@ -30956,6 +30957,9 @@ int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
case 't':
|
||||
fMinAve ^= 1;
|
||||
break;
|
||||
case 'm':
|
||||
fUseMfs ^= 1;
|
||||
break;
|
||||
case 'v':
|
||||
fVerbose ^= 1;
|
||||
break;
|
||||
|
|
@ -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" );
|
||||
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;
|
||||
|
||||
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-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-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-h : print the command usage\n");
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue