diff options
Diffstat (limited to 'src/base/io')
-rw-r--r-- | src/base/io/io.c | 73 | ||||
-rw-r--r-- | src/base/io/io.h | 6 | ||||
-rw-r--r-- | src/base/io/ioReadBlif.c | 16 | ||||
-rw-r--r-- | src/base/io/ioReadBlifMv.c | 38 | ||||
-rw-r--r-- | src/base/io/ioUtil.c | 122 | ||||
-rw-r--r-- | src/base/io/ioWriteBlif.c | 22 | ||||
-rw-r--r-- | src/base/io/ioWriteBlifMv.c | 3 |
7 files changed, 237 insertions, 43 deletions
diff --git a/src/base/io/io.c b/src/base/io/io.c index 8d5b8ad6..64451118 100644 --- a/src/base/io/io.c +++ b/src/base/io/io.c @@ -40,6 +40,7 @@ static int IoCommandReadVer ( Abc_Frame_t * pAbc, int argc, char **argv ); static int IoCommandReadVerLib ( Abc_Frame_t * pAbc, int argc, char **argv ); static int IoCommandWrite ( Abc_Frame_t * pAbc, int argc, char **argv ); +static int IoCommandWriteHie ( Abc_Frame_t * pAbc, int argc, char **argv ); static int IoCommandWriteAiger ( Abc_Frame_t * pAbc, int argc, char **argv ); static int IoCommandWriteBaf ( Abc_Frame_t * pAbc, int argc, char **argv ); static int IoCommandWriteBlif ( Abc_Frame_t * pAbc, int argc, char **argv ); @@ -75,7 +76,7 @@ extern Abc_Lib_t * Ver_ParseFile( char * pFileName, Abc_Lib_t * pGateLib, int fC void Io_Init( Abc_Frame_t * pAbc ) { Cmd_CommandAdd( pAbc, "I/O", "read", IoCommandRead, 1 ); - Cmd_CommandAdd( pAbc, "I/O", "rh", IoCommandReadHie, 1 ); + Cmd_CommandAdd( pAbc, "I/O", "read_hie", IoCommandReadHie, 1 ); Cmd_CommandAdd( pAbc, "I/O", "read_aiger", IoCommandReadAiger, 1 ); Cmd_CommandAdd( pAbc, "I/O", "read_baf", IoCommandReadBaf, 1 ); Cmd_CommandAdd( pAbc, "I/O", "read_blif", IoCommandReadBlif, 1 ); @@ -89,6 +90,7 @@ void Io_Init( Abc_Frame_t * pAbc ) // Cmd_CommandAdd( pAbc, "I/O", "read_verlib", IoCommandReadVerLib, 0 ); Cmd_CommandAdd( pAbc, "I/O", "write", IoCommandWrite, 0 ); + Cmd_CommandAdd( pAbc, "I/O", "write_hie", IoCommandWriteHie, 0 ); Cmd_CommandAdd( pAbc, "I/O", "write_aiger", IoCommandWriteAiger, 0 ); Cmd_CommandAdd( pAbc, "I/O", "write_baf", IoCommandWriteBaf, 0 ); Cmd_CommandAdd( pAbc, "I/O", "write_blif", IoCommandWriteBlif, 0 ); @@ -169,6 +171,7 @@ usage: fprintf( pAbc->Err, "usage: read [-ch] <file>\n" ); fprintf( pAbc->Err, "\t replaces the current network by the network read from <file>\n" ); fprintf( pAbc->Err, "\t by calling the parser that matches the extension of <file>\n" ); + fprintf( pAbc->Err, "\t (to read a hierarchical design, use \"read_hie\")\n" ); fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" ); fprintf( pAbc->Err, "\t-h : prints the command summary\n" ); fprintf( pAbc->Err, "\tfile : the name of a file to read\n" ); @@ -190,7 +193,7 @@ int IoCommandReadHie( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk; char * pFileName; - int fCheck, fBlifMv; + int fCheck; int c; fCheck = 1; @@ -213,18 +216,7 @@ int IoCommandReadHie( Abc_Frame_t * pAbc, int argc, char ** argv ) // get the input file name pFileName = argv[globalUtilOptind]; // read the file using the corresponding file reader -// pNtk = Io_Read( pFileName, Io_ReadFileType(pFileName), fCheck ); - if ( Io_ReadFileType(pFileName) == IO_FILE_BLIFMV ) - fBlifMv = 1; - else if ( Io_ReadFileType(pFileName) == IO_FILE_BLIF ) - fBlifMv = 0; - else - { - printf( "Wrong file type.\n" ); - return 1; - } - Io_ReadBlifMv( pFileName, fBlifMv, fCheck ); - pNtk = NULL; + pNtk = Io_ReadHie( pFileName, Io_ReadFileType(pFileName), fCheck ); if ( pNtk == NULL ) return 0; // replace the current network @@ -232,7 +224,7 @@ int IoCommandReadHie( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - fprintf( pAbc->Err, "usage: rh [-ch] <file>\n" ); + fprintf( pAbc->Err, "usage: read_hie [-ch] <file>\n" ); fprintf( pAbc->Err, "\t reads hierarchical design represented in BLIF or BLIF-MV\n" ); fprintf( pAbc->Err, "\t by calling the parser that matches the extension of <file>\n" ); fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" ); @@ -820,7 +812,7 @@ int IoCommandReadVer( Abc_Frame_t * pAbc, int argc, char ** argv ) // derive root design pNtk = Abc_LibDeriveRoot( pDesign ); - Abc_LibFree( pDesign ); + Abc_LibFree( pDesign, NULL ); if ( pNtk == NULL ) { fprintf( pAbc->Err, "Deriving root module has failed.\n" ); @@ -910,7 +902,7 @@ int IoCommandReadVerLib( Abc_Frame_t * pAbc, int argc, char ** argv ) printf( "The library contains %d gates.\n", st_count(pLibrary->tModules) ); // free old library if ( Abc_FrameReadLibVer() ) - Abc_LibFree( Abc_FrameReadLibVer() ); + Abc_LibFree( Abc_FrameReadLibVer(), NULL ); // read new library Abc_FrameSetLibVer( pLibrary ); return 0; @@ -980,6 +972,53 @@ usage: SeeAlso [] ***********************************************************************/ +int IoCommandWriteHie( Abc_Frame_t * pAbc, int argc, char **argv ) +{ + char * pBaseName, * pFileName; + int c; + + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF ) + { + switch ( c ) + { + case 'h': + goto usage; + default: + goto usage; + } + } + if ( argc != globalUtilOptind + 2 ) + goto usage; + // get the output file name + pBaseName = argv[globalUtilOptind]; + pFileName = argv[globalUtilOptind+1]; + // call the corresponding file writer +// Io_Write( pAbc->pNtkCur, pFileName, Io_ReadFileType(pFileName) ); + Io_WriteHie( pAbc->pNtkCur, pFileName, Io_ReadFileType(pFileName), pBaseName ); + return 0; + +usage: + fprintf( pAbc->Err, "usage: write_hie [-h] <orig> <file>\n" ); + fprintf( pAbc->Err, "\t writes the current network into <file> by calling\n" ); + fprintf( pAbc->Err, "\t the hierarchical writer that matches the extension of <file>\n" ); + fprintf( pAbc->Err, "\t-h : print the help massage\n" ); + fprintf( pAbc->Err, "\torig : the name of the original file with the hierarchical design\n" ); + fprintf( pAbc->Err, "\tfile : the name of the file to write\n" ); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int IoCommandWriteAiger( Abc_Frame_t * pAbc, int argc, char **argv ) { char * pFileName; diff --git a/src/base/io/io.h b/src/base/io/io.h index 78bc4563..91be5ee5 100644 --- a/src/base/io/io.h +++ b/src/base/io/io.h @@ -75,7 +75,7 @@ extern Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck ); /*=== abcReadBlif.c ===========================================================*/ extern Abc_Ntk_t * Io_ReadBlif( char * pFileName, int fCheck ); /*=== abcReadBlifMv.c =========================================================*/ -extern Abc_Lib_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ); +extern Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ); /*=== abcReadBench.c ==========================================================*/ extern Abc_Ntk_t * Io_ReadBench( char * pFileName, int fCheck ); /*=== abcReadEdif.c ===========================================================*/ @@ -92,7 +92,7 @@ extern void Io_WriteAiger( Abc_Ntk_t * pNtk, char * pFileName ); extern void Io_WriteBaf( Abc_Ntk_t * pNtk, char * pFileName ); /*=== abcWriteBlif.c ==========================================================*/ extern void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches ); -extern void Io_WriteBlifNetlist( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches ); +extern void Io_WriteBlif( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches ); extern void Io_WriteTimingInfo( FILE * pFile, Abc_Ntk_t * pNtk ); /*=== abcWriteBlifMv.c ==========================================================*/ extern void Io_WriteBlifMvDesign( Abc_Lib_t * pLib, char * FileName ); @@ -119,7 +119,9 @@ extern void Io_WriteVerilog( Abc_Ntk_t * pNtk, char * FileName, in extern Io_FileType_t Io_ReadFileType( char * pFileName ); extern Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck ); extern Abc_Ntk_t * Io_Read( char * pFileName, Io_FileType_t FileType, int fCheck ); +extern Abc_Ntk_t * Io_ReadHie( char * pFileName, Io_FileType_t FileType, int fCheck ); extern void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType ); +extern void Io_WriteHie( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType, char * pBaseName ); extern Abc_Obj_t * Io_ReadCreatePi( Abc_Ntk_t * pNtk, char * pName ); extern Abc_Obj_t * Io_ReadCreatePo( Abc_Ntk_t * pNtk, char * pName ); extern Abc_Obj_t * Io_ReadCreateAssert( Abc_Ntk_t * pNtk, char * pName ); diff --git a/src/base/io/ioReadBlif.c b/src/base/io/ioReadBlif.c index 5eb9a4ce..d0750178 100644 --- a/src/base/io/ioReadBlif.c +++ b/src/base/io/ioReadBlif.c @@ -157,6 +157,7 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p ) p->pNtkMaster = pNtkMaster = pNtk; continue; } +/* // make sure hierarchy does not have the network with this name if ( pNtkMaster->tName2Model && stmm_is_member( pNtkMaster->tName2Model, pNtk->pName ) ) { @@ -172,8 +173,9 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p ) if ( pNtkMaster->tName2Model == NULL ) pNtkMaster->tName2Model = stmm_init_table(strcmp, stmm_strhash); stmm_insert( pNtkMaster->tName2Model, pNtk->pName, (char *)pNtk ); +*/ } - +/* // if there is a hierarchy, connect the boxes if ( pNtkMaster && pNtkMaster->tName2Model ) { @@ -183,7 +185,9 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p ) return NULL; } } - else if ( !p->fError ) + else +*/ + if ( !p->fError ) Abc_NtkFinalizeRead( pNtkMaster ); // return the master network return pNtkMaster; @@ -252,8 +256,8 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p ) fStatus = Io_ReadBlifNetworkInputArrival( p, p->vTokens ); else if ( !strcmp( pDirective, ".default_input_arrival" ) ) fStatus = Io_ReadBlifNetworkDefaultInputArrival( p, p->vTokens ); - else if ( !strcmp( pDirective, ".subckt" ) ) - fStatus = Io_ReadBlifNetworkSubcircuit( p, p->vTokens ); +// else if ( !strcmp( pDirective, ".subckt" ) ) +// fStatus = Io_ReadBlifNetworkSubcircuit( p, p->vTokens ); else if ( !strcmp( pDirective, ".exdc" ) ) break; else if ( !strcmp( pDirective, ".end" ) ) @@ -1064,6 +1068,8 @@ int Io_ReadBlifNetworkConnectBoxesOne( Io_ReadBlif_t * p, Abc_Ntk_t * pNtk, stmm return 0; } +#if 0 + /**Function************************************************************* Synopsis [Connect the boxes in the hierarchy of networks.] @@ -1090,6 +1096,8 @@ int Io_ReadBlifNetworkConnectBoxes( Io_ReadBlif_t * p, Abc_Ntk_t * pNtkMaster ) return 0; } +#endif + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// diff --git a/src/base/io/ioReadBlifMv.c b/src/base/io/ioReadBlifMv.c index e6831dba..99656422 100644 --- a/src/base/io/ioReadBlifMv.c +++ b/src/base/io/ioReadBlifMv.c @@ -119,12 +119,12 @@ extern void Abc_NtkStartMvVars( Abc_Ntk_t * pNtk ); SeeAlso [] ***********************************************************************/ -Abc_Lib_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ) +Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ) { FILE * pFile; Io_MvMan_t * p; - Abc_Lib_t * pDesign; Abc_Ntk_t * pNtk; + Abc_Lib_t * pDesign; char * pDesignName; int i; @@ -171,18 +171,33 @@ Abc_Lib_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ) if ( !Abc_NtkCheckRead( pNtk ) ) { printf( "Io_ReadBlifMv: The network check has failed for network %s.\n", pNtk->pName ); - Abc_LibFree( pDesign ); + Abc_LibFree( pDesign, NULL ); return NULL; } } } // pDesign should be linked to all models of the design -Io_WriteBlifMvDesign( pDesign, "_temp_.mv" ); -Abc_LibPrint( pDesign ); -Abc_LibFree( pDesign ); -return NULL; -// return pDesign; + // extract the master network + pNtk = Vec_PtrEntry( pDesign->vModules, 0 ); + pNtk->pDesign = pDesign; + + // verify the design for cyclic dependence + assert( Vec_PtrSize(pDesign->vModules) > 0 ); + if ( Vec_PtrSize(pDesign->vModules) == 1 ) + { + printf( "Warning: The design is not hierarchical.\n" ); + Abc_LibFree( pDesign, pNtk ); + pNtk->pDesign = NULL; + } + else + Abc_NtkIsAcyclicHierarchy( pNtk ); + +//Io_WriteBlifMvDesign( pDesign, "_temp_.mv" ); +//Abc_LibPrint( pDesign ); +//Abc_LibFree( pDesign ); +//return NULL; + return pNtk; } /**Function************************************************************* @@ -225,7 +240,7 @@ static void Io_MvFree( Io_MvMan_t * p ) Io_MvMod_t * pMod; int i; if ( p->pDesign ) - Abc_LibFree( p->pDesign ); + Abc_LibFree( p->pDesign, NULL ); if ( p->pBuffer ) free( p->pBuffer ); if ( p->vLines ) @@ -899,7 +914,10 @@ static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine ) ppNames = (char **)Vec_PtrArray(vTokens) + 2 + p->pMan->fBlifMv; // create the box with these terminals - pBox = Abc_NtkCreateBlackbox( p->pNtk ); + if ( Abc_NtkHasBlackbox(pModel) ) + pBox = Abc_NtkCreateBlackbox( p->pNtk ); + else + pBox = Abc_NtkCreateWhitebox( p->pNtk ); pBox->pData = pModel; if ( p->pMan->fBlifMv ) Abc_ObjAssignName( pBox, Vec_PtrEntry(vTokens,2), NULL ); diff --git a/src/base/io/ioUtil.c b/src/base/io/ioUtil.c index ed197ab4..ca9f06b4 100644 --- a/src/base/io/ioUtil.c +++ b/src/base/io/ioUtil.c @@ -179,6 +179,69 @@ Abc_Ntk_t * Io_Read( char * pFileName, Io_FileType_t FileType, int fCheck ) /**Function************************************************************* + Synopsis [Read the network from a file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Abc_Ntk_t * Io_ReadHie( char * pFileName, Io_FileType_t FileType, int fCheck ) +{ + Abc_Ntk_t * pNtk, * pTemp; + // detect the file type + + if ( Io_ReadFileType(pFileName) == IO_FILE_BLIF ) + pNtk = Io_ReadBlifMv( pFileName, 0, fCheck ); +// else if ( Io_ReadFileType(pFileName) == IO_FILE_BLIFMV ) +// pNtk = Io_ReadBlifMv( pFileName, 1, fCheck ); + else + { + printf( "Wrong file type.\n" ); + return NULL; + } + if ( pNtk == NULL ) + return NULL; +// printf( "\n" ); + // flatten logic hierarchy + assert( Abc_NtkIsNetlist(pNtk) ); + if ( Abc_NtkWhiteboxNum(pNtk) > 0 ) + { + pNtk = Abc_NtkFlattenLogicHierarchy( pTemp = pNtk ); + Abc_NtkDelete( pTemp ); + if ( pNtk == NULL ) + { + fprintf( stdout, "Flattening logic hierarchy has failed.\n" ); + return NULL; + } + } + // convert blackboxes + if ( Abc_NtkBlackboxNum(pNtk) > 0 ) + { + printf( "Hierarchical parser is converting %d blackboxes.\n", Abc_NtkBlackboxNum(pNtk) ); + pNtk = Abc_NtkConvertBlackboxes( pTemp = pNtk ); + Abc_NtkDelete( pTemp ); + if ( pNtk == NULL ) + { + fprintf( stdout, "Converting blackboxes has failed.\n" ); + return NULL; + } + } + // convert the netlist into the logic network + pNtk = Abc_NtkNetlistToLogic( pTemp = pNtk ); + Abc_NtkDelete( pTemp ); + if ( pNtk == NULL ) + { + fprintf( stdout, "Converting netlist to logic network after reading has failed.\n" ); + return NULL; + } + return pNtk; +} + +/**Function************************************************************* + Synopsis [Write the network into file.] Description [] @@ -269,7 +332,7 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType ) return; } if ( FileType == IO_FILE_BLIF ) - Io_WriteBlifNetlist( pNtkTemp, pFileName, 1 ); + Io_WriteBlif( pNtkTemp, pFileName, 1 ); else if ( FileType == IO_FILE_BENCH ) Io_WriteBench( pNtkTemp, pFileName ); else if ( FileType == IO_FILE_PLA ) @@ -293,6 +356,63 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType ) /**Function************************************************************* + Synopsis [Write the network into file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Io_WriteHie( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType, char * pBaseName ) +{ + Abc_Ntk_t * pNtkTemp, * pNtkBase, * pNtkResult; + // check if the current network is available + if ( pNtk == NULL ) + { + fprintf( stdout, "Empty network.\n" ); + return; + } + // check if the file extension if given + if ( FileType == IO_FILE_NONE || FileType == IO_FILE_UNKNOWN ) + { + fprintf( stdout, "The generic file writer requires a known file extension.\n" ); + return; + } + // write the AIG formats + if ( FileType == IO_FILE_BLIF ) + { + pNtkBase = Io_ReadBlifMv( pBaseName, 0, 1 ); + if ( Abc_NtkWhiteboxNum(pNtk) > 0 ) + { + pNtkBase = Abc_NtkFlattenLogicHierarchy( pNtkTemp = pNtkBase ); + Abc_NtkDelete( pNtkTemp ); + } + if ( Abc_NtkBlackboxNum(pNtk) > 0 ) + { + pNtkResult = Abc_NtkLogicToNetlist( pNtk, 0 ); + pNtkResult = Abc_NtkInsertNewLogic( pNtkBase, pNtkTemp = pNtkResult ); + Abc_NtkDelete( pNtkTemp ); + printf( "Hierarchy writer reintroduced %d blackboxes.\n", Abc_NtkBlackboxNum(pNtk) ); + } + else + { + printf( "Warning: The output network does not contain blackboxes.\n" ); + pNtkResult = Abc_NtkLogicToNetlist( pNtk, 0 ); + } + Abc_NtkDelete( pNtkBase ); + if ( pNtkResult == NULL ) + return; + Io_WriteBlif( pNtkResult, pFileName, 0 ); + Abc_NtkDelete( pNtkResult ); + } + else + fprintf( stderr, "Unknown file format.\n" ); +} + +/**Function************************************************************* + Synopsis [Creates PI terminal and net.] Description [] diff --git a/src/base/io/ioWriteBlif.c b/src/base/io/ioWriteBlif.c index 3b8c41fa..7c9db8bb 100644 --- a/src/base/io/ioWriteBlif.c +++ b/src/base/io/ioWriteBlif.c @@ -61,7 +61,7 @@ void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches ) fprintf( stdout, "Writing BLIF has failed.\n" ); return; } - Io_WriteBlifNetlist( pNtkTemp, FileName, fWriteLatches ); + Io_WriteBlif( pNtkTemp, FileName, fWriteLatches ); Abc_NtkDelete( pNtkTemp ); } @@ -76,28 +76,34 @@ void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches ) SeeAlso [] ***********************************************************************/ -void Io_WriteBlifNetlist( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches ) +void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches ) { - stmm_generator * gen; - Abc_Ntk_t * pNtkTemp; FILE * pFile; assert( Abc_NtkIsNetlist(pNtk) ); // start writing the file pFile = fopen( FileName, "w" ); if ( pFile == NULL ) { - fprintf( stdout, "Io_WriteBlifNetlist(): Cannot open the output file.\n" ); + fprintf( stdout, "Io_WriteBlif(): Cannot open the output file.\n" ); return; } fprintf( pFile, "# Benchmark \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() ); // write the master network Io_NtkWrite( pFile, pNtk, fWriteLatches ); + // make sure there is no logic hierarchy + assert( Abc_NtkWhiteboxNum(pNtk) == 0 ); // write the hierarchy if present - if ( pNtk->tName2Model ) + if ( Abc_NtkBlackboxNum(pNtk) > 0 ) { - fprintf( pFile, "\n\n" ); - stmm_foreach_item( pNtk->tName2Model, gen, NULL, (char **)&pNtkTemp ) + Abc_Ntk_t * pNtkTemp; + Abc_Obj_t * pObj; + int i; + Abc_NtkForEachBlackbox( pNtk, pObj, i ) + { + pNtkTemp = pObj->pData; + assert( pNtkTemp != NULL && Abc_NtkHasBlackbox(pNtkTemp) ); Io_NtkWrite( pFile, pNtkTemp, fWriteLatches ); + } } fclose( pFile ); } diff --git a/src/base/io/ioWriteBlifMv.c b/src/base/io/ioWriteBlifMv.c index dc3a8b2d..1c7e7bed 100644 --- a/src/base/io/ioWriteBlifMv.c +++ b/src/base/io/ioWriteBlifMv.c @@ -187,7 +187,8 @@ void Io_NtkWriteBlifMvOne( FILE * pFile, Abc_Ntk_t * pNtk ) } // write the subcircuits - if ( !Abc_NtkBlackboxNum(pNtk) ) + assert( Abc_NtkWhiteboxNum(pNtk) == 0 ); + if ( Abc_NtkBlackboxNum(pNtk) > 0 ) { fprintf( pFile, "\n" ); Abc_NtkForEachBlackbox( pNtk, pNode, i ) |