Commit 7ecea8d4 by Alan Mishchenko

Added hierarchical BLIF output for mapping with LUT structures (write_blif -a -S <XYZ>).

parent e9e8f179
......@@ -506,7 +506,8 @@ Gia_Man_t * Gia_ManFromIf( If_Man_t * pIfMan )
// which participate as leaves of some cuts used in the mapping
// such nodes are marked here and skipped when mapping is derived
Counter = Gia_ManMarkDangling(pNew);
if ( pIfMan->pPars->fVerbose && Counter )
// if ( pIfMan->pPars->fVerbose && Counter )
if ( Counter )
printf( "GIA after mapping has %d dangling nodes.\n", Counter );
// create mapping
......@@ -568,7 +569,7 @@ Gia_Man_t * Gia_ManFromIf( If_Man_t * pIfMan )
pNew->pMapping[iOffset-k-1]--;
continue;
}
assert( FaninId != GiaId );
assert( FaninId < GiaId );
pNew->pMapping[iOffset++] = FaninId;
}
pNew->pMapping[iOffset++] = GiaId;
......
......@@ -1654,9 +1654,10 @@ int IoCommandWriteBlif( Abc_Frame_t * pAbc, int argc, char **argv )
char * pFileName;
char * pLutStruct = NULL;
int c, fSpecial = 0;
int fUseHie = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Sjh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "Sjah" ) ) != EOF )
{
switch ( c )
{
......@@ -1677,6 +1678,9 @@ int IoCommandWriteBlif( Abc_Frame_t * pAbc, int argc, char **argv )
case 'j':
fSpecial ^= 1;
break;
case 'a':
fUseHie ^= 1;
break;
case 'h':
goto usage;
default:
......@@ -1694,16 +1698,17 @@ int IoCommandWriteBlif( Abc_Frame_t * pAbc, int argc, char **argv )
pFileName = argv[globalUtilOptind];
// call the corresponding file writer
if ( fSpecial || pLutStruct )
Io_WriteBlifSpecial( pAbc->pNtkCur, pFileName, pLutStruct );
Io_WriteBlifSpecial( pAbc->pNtkCur, pFileName, pLutStruct, fUseHie );
else
Io_Write( pAbc->pNtkCur, pFileName, IO_FILE_BLIF );
return 0;
usage:
fprintf( pAbc->Err, "usage: write_blif [-S str] [-jh] <file>\n" );
fprintf( pAbc->Err, "usage: write_blif [-S str] [-jah] <file>\n" );
fprintf( pAbc->Err, "\t writes the network into a BLIF file\n" );
fprintf( pAbc->Err, "\t-S str : string representing the LUT structure [default = %s]\n", pLutStruct ? pLutStruct : "not used" );
fprintf( pAbc->Err, "\t-j : enables special BLIF writing [default = %s]\n", fSpecial? "yes" : "no" );;
fprintf( pAbc->Err, "\t-a : enables hierarchical BLIF writing for LUT structures [default = %s]\n", fUseHie? "yes" : "no" );;
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .blif)\n" );
return 1;
......
......@@ -106,7 +106,7 @@ extern void Io_WriteBblif( Abc_Ntk_t * pNtk, char * pFileName );
extern void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches );
extern void Io_WriteBlif( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches, int fBb2Wb, int fSeq );
extern void Io_WriteTimingInfo( FILE * pFile, Abc_Ntk_t * pNtk );
extern void Io_WriteBlifSpecial( Abc_Ntk_t * pNtk, char * FileName, char * pLutStruct );
extern void Io_WriteBlifSpecial( Abc_Ntk_t * pNtk, char * FileName, char * pLutStruct, int fUseHie );
/*=== abcWriteBlifMv.c ==========================================================*/
extern void Io_WriteBlifMv( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteBench.c =========================================================*/
......
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