summaryrefslogtreecommitdiffstats
path: root/src/base/io/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/io/io.c')
-rw-r--r--src/base/io/io.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/base/io/io.c b/src/base/io/io.c
index dec5ee45..5cf74ef9 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -2982,13 +2982,13 @@ usage:
***********************************************************************/
int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
{
- extern void Io_WriteVerilogLut( Abc_Ntk_t * pNtk, char * pFileName, int nLutSize );
+ extern void Io_WriteVerilogLut( Abc_Ntk_t * pNtk, char * pFileName, int nLutSize, int fFixed, int fNoModules );
char * pFileName;
- int c, fOnlyAnds = 0;
+ int c, fFixed = 0, fOnlyAnds = 0, fNoModules = 0;
int nLutSize = -1;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Kah" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Kfamh" ) ) != EOF )
{
switch ( c )
{
@@ -3003,9 +3003,15 @@ int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
if ( nLutSize < 2 || nLutSize > 6 )
goto usage;
break;
+ case 'f':
+ fFixed ^= 1;
+ break;
case 'a':
fOnlyAnds ^= 1;
break;
+ case 'm':
+ fNoModules ^= 1;
+ break;
case 'h':
goto usage;
default:
@@ -3019,6 +3025,8 @@ int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
}
if ( argc != globalUtilOptind + 1 )
goto usage;
+ if ( fFixed )
+ nLutSize = 6;
// get the output file name
pFileName = argv[globalUtilOptind];
// call the corresponding file writer
@@ -3031,16 +3039,18 @@ int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
Abc_NtkDelete( pNtkTemp );
}
else if ( nLutSize >= 2 && nLutSize <= 6 )
- Io_WriteVerilogLut( pAbc->pNtkCur, pFileName, nLutSize );
+ Io_WriteVerilogLut( pAbc->pNtkCur, pFileName, nLutSize, fFixed, fNoModules );
else
Io_Write( pAbc->pNtkCur, pFileName, IO_FILE_VERILOG );
return 0;
usage:
- fprintf( pAbc->Err, "usage: write_verilog [-K num] [-ah] <file>\n" );
+ fprintf( pAbc->Err, "usage: write_verilog [-K num] [-famh] <file>\n" );
fprintf( pAbc->Err, "\t writes the current network in Verilog format\n" );
fprintf( pAbc->Err, "\t-K num : write the network using instances of K-LUTs (2 <= K <= 6) [default = not used]\n" );
+ fprintf( pAbc->Err, "\t-f : toggle using fixed format [default = %s]\n", fFixed? "yes":"no" );
fprintf( pAbc->Err, "\t-a : toggle writing expressions with only ANDs (without XORs and MUXes) [default = %s]\n", fOnlyAnds? "yes":"no" );
+ fprintf( pAbc->Err, "\t-m : toggle writing additional modules [default = %s]\n", !fNoModules? "yes":"no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;