/**Function************************************************************* Synopsis [Reads the network from a BENCH file.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ Abc_Ntk_t * Io_ReadBench( char * pFileName, int fCheck ) { Extra_FileReader_t * p; Abc_Ntk_t * pNtk; // start the file p = Extra_FileReaderAlloc( pFileName, "#", "\n\r", " \t,()=" ); if ( p == NULL ) return NULL; // read the network pNtk = Io_ReadBenchNetwork( p ); Extra_FileReaderFree( p ); if ( pNtk == NULL ) return NULL; // make sure that everything is okay with the network structure if ( fCheck && !Abc_NtkCheckRead( pNtk ) ) { printf( "Io_ReadBench: The network check has failed.\n" ); Abc_NtkDelete( pNtk ); return NULL; } return pNtk; }
/**Function************************************************************* Synopsis [Frees the data structure.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Io_ReadBlifFree( Io_ReadBlif_t * p ) { Extra_FileReaderFree( p->pReader ); Vec_PtrFree( p->vNewTokens ); Vec_StrFree( p->vCubes ); ABC_FREE( p ); }