Trying to fix a mysterious bug in reading the library files.

This commit is contained in:
Alan Mishchenko 2011-05-06 19:27:00 -07:00
parent 80d161afaa
commit a0cc621566
3 changed files with 20 additions and 21 deletions

View File

@ -78,8 +78,8 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, int
// derive the supergate library
if ( Abc_FrameReadLibSuper() == NULL && Abc_FrameReadLibGen() )
{
printf( "A simple supergate library is derived from gate library \"%s\".\n",
Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
// printf( "A simple supergate library is derived from gate library \"%s\".\n",
// Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
Map_SuperLibDeriveFromGenlib( (Mio_Library_t *)Abc_FrameReadLibGen() );
}
@ -432,8 +432,8 @@ Abc_Ntk_t * Abc_NtkSuperChoice( Abc_Ntk_t * pNtk )
// derive the supergate library
if ( Abc_FrameReadLibSuper() == NULL && Abc_FrameReadLibGen() )
{
printf( "A simple supergate library is derived from gate library \"%s\".\n",
Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
// printf( "A simple supergate library is derived from gate library \"%s\".\n",
// Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
Map_SuperLibDeriveFromGenlib( (Mio_Library_t *)Abc_FrameReadLibGen() );
}

View File

@ -67,8 +67,8 @@ Abc_Ntk_t * Seq_MapRetime( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose )
// derive the supergate library
if ( Abc_FrameReadLibSuper() == NULL && Abc_FrameReadLibGen() )
{
printf( "A simple supergate library is derived from gate library \"%s\".\n",
Mio_LibraryReadName(Abc_FrameReadLibGen()) );
// printf( "A simple supergate library is derived from gate library \"%s\".\n",
// Mio_LibraryReadName(Abc_FrameReadLibGen()) );
Map_SuperLibDeriveFromGenlib( Abc_FrameReadLibGen() );
}
p->pSuperLib = Abc_FrameReadLibSuper();

View File

@ -202,7 +202,7 @@ int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib )
pNameGeneric = Extra_FileNameGeneric( Mio_LibraryReadName(pLib) );
sprintf( FileNameSuper, "%s.super", pNameGeneric );
ABC_FREE( pNameGeneric );
sprintf( CommandSuper, "super -l 1 -i 5 -d 10000000 -a 10000000 -t 100 %s", FileNameGenlib );
if ( Cmd_CommandExecute( pAbc, CommandSuper ) )
{
@ -218,15 +218,17 @@ int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib )
//#else
// unlink( FileNameGenlib );
//#endif
printf( "A simple supergate library is derived from gate library \"%s\".\n", Mio_LibraryReadName(pLib) );
fflush( stdout );
sprintf( CommandRead, "read_super %s", FileNameSuper );
if ( Cmd_CommandExecute( pAbc, CommandRead ) )
{
#ifdef WIN32
_unlink( FileNameSuper );
#else
unlink( FileNameSuper );
#endif
//#ifdef WIN32
// _unlink( FileNameSuper );
//#else
// unlink( FileNameSuper );
//#endif
fprintf( stdout, "Cannot execute command \"%s\".\n", CommandRead );
ABC_FREE( FileNameGenlib );
ABC_FREE( FileNameSuper );
@ -234,19 +236,16 @@ int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib )
ABC_FREE( CommandRead );
return 0;
}
/* // don't remove the intermediate file
#ifdef WIN32
_unlink( FileNameSuper );
#else
unlink( FileNameSuper );
#endif
*/
//#ifdef WIN32
// _unlink( FileNameSuper );
//#else
// unlink( FileNameSuper );
//#endif
ABC_FREE( FileNameGenlib );
ABC_FREE( FileNameSuper );
ABC_FREE( CommandSuper );
ABC_FREE( CommandRead );
return 1;
return 1;
}