Commit e7527a47 by Alan Mishchenko

Cleaned up interfaces of genlib/liberty/supergate reading/writing.

parent 1c099166
...@@ -143,11 +143,11 @@ int Map_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -143,11 +143,11 @@ int Map_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
fclose( pFile ); fclose( pFile );
// set the new network // set the new network
pLib = Map_SuperLibCreate( FileName, ExcludeFile, fAlgorithm, fVerbose ); pLib = Map_SuperLibCreate( NULL, FileName, ExcludeFile, fAlgorithm, fVerbose );
if ( pLib == NULL ) if ( pLib == NULL )
{ {
fprintf( pErr, "Reading supergate library has failed.\n" ); fprintf( pErr, "Reading supergate library has failed.\n" );
goto usage; return 1;
} }
// replace the current library // replace the current library
// Map_SuperLibFree( s_pSuperLib ); // Map_SuperLibFree( s_pSuperLib );
......
...@@ -378,7 +378,7 @@ extern void Map_NodeAddFaninFanout( Map_Node_t * pFanin, Map_Node_t ...@@ -378,7 +378,7 @@ extern void Map_NodeAddFaninFanout( Map_Node_t * pFanin, Map_Node_t
extern void Map_NodeRemoveFaninFanout( Map_Node_t * pFanin, Map_Node_t * pFanoutToRemove ); extern void Map_NodeRemoveFaninFanout( Map_Node_t * pFanin, Map_Node_t * pFanoutToRemove );
extern int Map_NodeGetFanoutNum( Map_Node_t * pNode ); extern int Map_NodeGetFanoutNum( Map_Node_t * pNode );
/*=== mapperLib.c ============================================================*/ /*=== mapperLib.c ============================================================*/
extern Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose ); extern Map_SuperLib_t * Map_SuperLibCreate( Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose );
extern void Map_SuperLibFree( Map_SuperLib_t * p ); extern void Map_SuperLibFree( Map_SuperLib_t * p );
/*=== mapperMatch.c ===============================================================*/ /*=== mapperMatch.c ===============================================================*/
extern int Map_MappingMatches( Map_Man_t * p ); extern int Map_MappingMatches( Map_Man_t * p );
...@@ -405,6 +405,8 @@ extern float Map_MappingGetArea( Map_Man_t * pMan, Map_NodeVec_t * v ...@@ -405,6 +405,8 @@ extern float Map_MappingGetArea( Map_Man_t * pMan, Map_NodeVec_t * v
/*=== mapperShow.c =============================================================*/ /*=== mapperShow.c =============================================================*/
extern void Map_MappingShow( Map_Man_t * pMan, char * pFileName ); extern void Map_MappingShow( Map_Man_t * pMan, char * pFileName );
/*=== mapperTree.c ===============================================================*/ /*=== mapperTree.c ===============================================================*/
extern int Map_LibraryDeriveGateInfo( Map_SuperLib_t * pLib, st_table * tExcludeGate );
extern int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Vec_Str_t * vStr, char * pFileName );
extern int Map_LibraryReadTree( Map_SuperLib_t * pLib, char * pFileName, char * pExcludeFile ); extern int Map_LibraryReadTree( Map_SuperLib_t * pLib, char * pFileName, char * pExcludeFile );
extern void Map_LibraryPrintTree( Map_SuperLib_t * pLib ); extern void Map_LibraryPrintTree( Map_SuperLib_t * pLib );
/*=== mapperSuper.c ===============================================================*/ /*=== mapperSuper.c ===============================================================*/
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#endif #endif
#include "mapperInt.h" #include "mapperInt.h"
#include "map/super/super.h"
#include "map/mapper/mapperInt.h"
ABC_NAMESPACE_IMPL_START ABC_NAMESPACE_IMPL_START
...@@ -53,7 +55,7 @@ ABC_NAMESPACE_IMPL_START ...@@ -53,7 +55,7 @@ ABC_NAMESPACE_IMPL_START
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose ) Map_SuperLib_t * Map_SuperLibCreate( Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose )
{ {
Map_SuperLib_t * p; Map_SuperLib_t * p;
clock_t clk; clock_t clk;
...@@ -61,7 +63,7 @@ Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int ...@@ -61,7 +63,7 @@ Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int
// start the supergate library // start the supergate library
p = ABC_ALLOC( Map_SuperLib_t, 1 ); p = ABC_ALLOC( Map_SuperLib_t, 1 );
memset( p, 0, sizeof(Map_SuperLib_t) ); memset( p, 0, sizeof(Map_SuperLib_t) );
p->pName = pFileName; p->pName = Abc_UtilStrsav(pFileName);
p->fVerbose = fVerbose; p->fVerbose = fVerbose;
p->mmSupers = Extra_MmFixedStart( sizeof(Map_Super_t) ); p->mmSupers = Extra_MmFixedStart( sizeof(Map_Super_t) );
p->mmEntries = Extra_MmFixedStart( sizeof(Map_HashEntry_t) ); p->mmEntries = Extra_MmFixedStart( sizeof(Map_HashEntry_t) );
...@@ -74,7 +76,25 @@ Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int ...@@ -74,7 +76,25 @@ Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int
// read the supergate library from file // read the supergate library from file
clk = clock(); clk = clock();
if ( fAlgorithm ) if ( vStr != NULL )
{
// read the supergate library from file
int Status = Map_LibraryReadFileTreeStr( p, vStr, pFileName );
if ( Status == 0 )
{
Map_SuperLibFree( p );
return NULL;
}
// prepare the info about the library
Status = Map_LibraryDeriveGateInfo( p, NULL );
if ( Status == 0 )
{
Map_SuperLibFree( p );
return NULL;
}
assert( p->nVarsMax > 0 );
}
else if ( fAlgorithm )
{ {
if ( !Map_LibraryReadTree( p, pFileName, pExcludeFile ) ) if ( !Map_LibraryReadTree( p, pFileName, pExcludeFile ) )
{ {
...@@ -162,6 +182,7 @@ void Map_SuperLibFree( Map_SuperLib_t * p ) ...@@ -162,6 +182,7 @@ void Map_SuperLibFree( Map_SuperLib_t * p )
Extra_MmFixedStop( p->mmEntries ); Extra_MmFixedStop( p->mmEntries );
Extra_MmFlexStop( p->mmForms ); Extra_MmFlexStop( p->mmForms );
ABC_FREE( p->ppSupers ); ABC_FREE( p->ppSupers );
ABC_FREE( p->pName );
ABC_FREE( p ); ABC_FREE( p );
} }
...@@ -178,15 +199,47 @@ void Map_SuperLibFree( Map_SuperLib_t * p ) ...@@ -178,15 +199,47 @@ void Map_SuperLibFree( Map_SuperLib_t * p )
***********************************************************************/ ***********************************************************************/
int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib, int fVerbose ) int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib, int fVerbose )
{ {
extern void Super_Precompute( Mio_Library_t * pLibGen, int nInputs, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fWriteOldFormat, int fVerbose ); Map_SuperLib_t * pLibSuper;
Abc_Frame_t * pAbc = Abc_FrameGetGlobalFrame();
Vec_Str_t * vStr;
char * pFileName;
if ( pLib == NULL )
return 0;
// compute supergates
vStr = Super_PrecomputeStr( pLib, 5, 1, 100000000, 10000000, 10000000, 100, 1, 0 );
if ( vStr == NULL )
return 0;
// create supergate library
pFileName = Extra_FileNameGenericAppend( Mio_LibraryReadName(pLib), ".super" );
pLibSuper = Map_SuperLibCreate( vStr, pFileName, NULL, 1, 0 );
Vec_StrFree( vStr );
// replace the library
Map_SuperLibFree( (Map_SuperLib_t *)Abc_FrameReadLibSuper() );
Abc_FrameSetLibSuper( pLibSuper );
return 1;
}
/**Function*************************************************************
Synopsis [Derives the library from the genlib library.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Map_SuperLibDeriveFromGenlib2( Mio_Library_t * pLib, int fVerbose )
{
Abc_Frame_t * pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t * pAbc = Abc_FrameGetGlobalFrame();
char * pFileName; char * pFileName;
if ( pLib == NULL ) if ( pLib == NULL )
return 0; return 0;
// compute supergates // compute supergates
Super_Precompute( pLib, 5, 1, 100000000, 10000000, 10000000, 100, 1, 0, 0 );
// assuming that it terminated successfully
pFileName = Extra_FileNameGenericAppend(Mio_LibraryReadName(pLib), ".super"); pFileName = Extra_FileNameGenericAppend(Mio_LibraryReadName(pLib), ".super");
Super_Precompute( pLib, 5, 1, 100000000, 10000000, 10000000, 100, 1, 0, pFileName );
// assuming that it terminated successfully
if ( Cmd_CommandExecute( pAbc, pFileName ) ) if ( Cmd_CommandExecute( pAbc, pFileName ) )
{ {
fprintf( stdout, "Cannot execute command \"read_super %s\".\n", pFileName ); fprintf( stdout, "Cannot execute command \"read_super %s\".\n", pFileName );
...@@ -195,7 +248,6 @@ int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib, int fVerbose ) ...@@ -195,7 +248,6 @@ int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib, int fVerbose )
return 1; return 1;
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// END OF FILE /// /// END OF FILE ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -103,13 +103,13 @@ int Map_LibraryReadFile( Map_SuperLib_t * pLib, FILE * pFile ) ...@@ -103,13 +103,13 @@ int Map_LibraryReadFile( Map_SuperLib_t * pLib, FILE * pFile )
pLibName = strtok( pTemp, " \t\r\n" ); pLibName = strtok( pTemp, " \t\r\n" );
if ( strcmp( pLibName, "GATE" ) == 0 ) if ( strcmp( pLibName, "GATE" ) == 0 )
{ {
printf( "The input file \"%s\" looks like a GENLIB file and not a supergate library file.\n", pLib->pName ); printf( "The input file \"%s\" looks like a genlib file and not a supergate library file.\n", pLib->pName );
return 0; return 0;
} }
pFileGen = fopen( pLibName, "r" ); pFileGen = fopen( pLibName, "r" );
if ( pFileGen == NULL ) if ( pFileGen == NULL )
{ {
printf( "Cannot open the GENLIB file \"%s\".\n", pLibName ); printf( "Cannot open the genlib file \"%s\".\n", pLibName );
return 0; return 0;
} }
fclose( pFileGen ); fclose( pFileGen );
...@@ -118,7 +118,7 @@ int Map_LibraryReadFile( Map_SuperLib_t * pLib, FILE * pFile ) ...@@ -118,7 +118,7 @@ int Map_LibraryReadFile( Map_SuperLib_t * pLib, FILE * pFile )
pLib->pGenlib = Mio_LibraryRead( pLibName, NULL, 0, 0 ); pLib->pGenlib = Mio_LibraryRead( pLibName, NULL, 0, 0 );
if ( pLib->pGenlib == NULL ) if ( pLib->pGenlib == NULL )
{ {
printf( "Cannot read GENLIB file \"%s\".\n", pLibName ); printf( "Cannot read genlib file \"%s\".\n", pLibName );
return 0; return 0;
} }
......
...@@ -40,7 +40,7 @@ static int Mio_CommandWriteGenlib( Abc_Frame_t * pAbc, int argc, char **argv ); ...@@ -40,7 +40,7 @@ static int Mio_CommandWriteGenlib( Abc_Frame_t * pAbc, int argc, char **argv );
static int Mio_CommandPrintGenlib( Abc_Frame_t * pAbc, int argc, char **argv ); static int Mio_CommandPrintGenlib( Abc_Frame_t * pAbc, int argc, char **argv );
/* /*
// internal version of GENLIB library // internal version of genlib library
static char * pMcncGenlib[25] = { static char * pMcncGenlib[25] = {
"GATE inv1 1 O=!a; PIN * INV 1 999 0.9 0.0 0.9 0.0\n", "GATE inv1 1 O=!a; PIN * INV 1 999 0.9 0.0 0.9 0.0\n",
"GATE inv2 2 O=!a; PIN * INV 2 999 1.0 0.0 1.0 0.0\n", "GATE inv2 2 O=!a; PIN * INV 2 999 1.0 0.0 1.0 0.0\n",
...@@ -320,7 +320,7 @@ int Mio_CommandReadGenlib( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -320,7 +320,7 @@ int Mio_CommandReadGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
pLib = Mio_LibraryRead( pFileName, NULL, pExcludeFile, fVerbose ); pLib = Mio_LibraryRead( pFileName, NULL, pExcludeFile, fVerbose );
if ( pLib == NULL ) if ( pLib == NULL )
{ {
fprintf( pErr, "Reading GENLIB library has failed.\n" ); fprintf( pErr, "Reading genlib library has failed.\n" );
return 1; return 1;
} }
// add the fixed number (wire delay) to all delays in the library // add the fixed number (wire delay) to all delays in the library
...@@ -342,14 +342,14 @@ int Mio_CommandReadGenlib( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -342,14 +342,14 @@ int Mio_CommandReadGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
pLib = (Mio_Library_t *)Amap_LibReadAndPrepare( pFileName, NULL, 0, 0 ); pLib = (Mio_Library_t *)Amap_LibReadAndPrepare( pFileName, NULL, 0, 0 );
if ( pLib == NULL ) if ( pLib == NULL )
{ {
fprintf( pErr, "Reading GENLIB library has failed.\n" ); fprintf( pErr, "Reading genlib library has failed.\n" );
return 1; return 1;
} }
// replace the current library // replace the current library
Amap_LibFree( (Amap_Lib_t *)Abc_FrameReadLibGen2() ); Amap_LibFree( (Amap_Lib_t *)Abc_FrameReadLibGen2() );
Abc_FrameSetLibGen2( pLib ); Abc_FrameSetLibGen2( pLib );
if ( fVerbose ) if ( fVerbose )
printf( "Entered GENLIB library with %d gates from file \"%s\".\n", Mio_LibraryReadGateNum(pLib), pFileName ); printf( "Entered genlib library with %d gates from file \"%s\".\n", Mio_LibraryReadGateNum(pLib), pFileName );
return 0; return 0;
usage: usage:
...@@ -425,7 +425,7 @@ int Mio_CommandWriteGenlib( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -425,7 +425,7 @@ int Mio_CommandWriteGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
} }
Mio_WriteLibrary( pFile, (Mio_Library_t *)Abc_FrameReadLibGen(), 0 ); Mio_WriteLibrary( pFile, (Mio_Library_t *)Abc_FrameReadLibGen(), 0 );
fclose( pFile ); fclose( pFile );
printf( "The current GENLIB library is written into file \"%s\".\n", pFileName ); printf( "The current genlib library is written into file \"%s\".\n", pFileName );
return 0; return 0;
usage: usage:
......
...@@ -129,6 +129,7 @@ extern double Mio_PinReadDelayFanoutFall( Mio_Pin_t * pPin ); ...@@ -129,6 +129,7 @@ extern double Mio_PinReadDelayFanoutFall( Mio_Pin_t * pPin );
extern double Mio_PinReadDelayBlockMax ( Mio_Pin_t * pPin ); extern double Mio_PinReadDelayBlockMax ( Mio_Pin_t * pPin );
extern Mio_Pin_t * Mio_PinReadNext ( Mio_Pin_t * pPin ); extern Mio_Pin_t * Mio_PinReadNext ( Mio_Pin_t * pPin );
/*=== mioRead.c =============================================================*/ /*=== mioRead.c =============================================================*/
extern char * Mio_ReadFile( char * FileName, int fAddEnd );
extern Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * ExcludeFile, int fVerbose ); extern Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * ExcludeFile, int fVerbose );
extern int Mio_LibraryReadExclude( char * ExcludeFile, st_table * tExcludeGate ); extern int Mio_LibraryReadExclude( char * ExcludeFile, st_table * tExcludeGate );
/*=== mioFunc.c =============================================================*/ /*=== mioFunc.c =============================================================*/
......
...@@ -89,7 +89,7 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude ...@@ -89,7 +89,7 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude
pLib->pName = Abc_UtilStrsav( Extra_FileNameGenericAppend(FileName, ".genlib") ); pLib->pName = Abc_UtilStrsav( Extra_FileNameGenericAppend(FileName, ".genlib") );
} }
if ( pLib != NULL ) if ( pLib != NULL )
printf ( "Warning: Read extended GENLIB format but ignoring extensions\n" ); printf ( "Warning: Read extended genlib format but ignoring extensions\n" );
} }
if ( tExcludeGate ) if ( tExcludeGate )
st_free_table( tExcludeGate ); st_free_table( tExcludeGate );
...@@ -108,7 +108,7 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude ...@@ -108,7 +108,7 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
char * Mio_ReadFile( char * FileName ) char * Mio_ReadFile( char * FileName, int fAddEnd )
{ {
char * pBuffer; char * pBuffer;
FILE * pFile; FILE * pFile;
...@@ -131,7 +131,8 @@ char * Mio_ReadFile( char * FileName ) ...@@ -131,7 +131,8 @@ char * Mio_ReadFile( char * FileName )
RetValue = fread( pBuffer, nFileSize, 1, pFile ); RetValue = fread( pBuffer, nFileSize, 1, pFile );
// terminate the string with '\0' // terminate the string with '\0'
pBuffer[ nFileSize ] = '\0'; pBuffer[ nFileSize ] = '\0';
strcat( pBuffer, "\n.end\n" ); if ( fAddEnd )
strcat( pBuffer, "\n.end\n" );
// close file // close file
fclose( pFile ); fclose( pFile );
return pBuffer; return pBuffer;
...@@ -201,7 +202,7 @@ Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st_tab ...@@ -201,7 +202,7 @@ Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st_tab
// pBuffer = Io_ReadFileFileContents( FileName, NULL ); // pBuffer = Io_ReadFileFileContents( FileName, NULL );
// we don't use above function but actually do the same thing explicitly // we don't use above function but actually do the same thing explicitly
// to handle open_path expansion correctly // to handle open_path expansion correctly
pBuffer = Mio_ReadFile( FileName ); pBuffer = Mio_ReadFile( FileName, 1 );
if ( pBuffer == NULL ) if ( pBuffer == NULL )
return NULL; return NULL;
pLib = Mio_LibraryReadBuffer( pBuffer, fExtendedFormat, tExcludeGate, fVerbose ); pLib = Mio_LibraryReadBuffer( pBuffer, fExtendedFormat, tExcludeGate, fVerbose );
...@@ -617,7 +618,7 @@ void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib ) ...@@ -617,7 +618,7 @@ void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib )
pLib->pGateBuf = Mio_GateCompare( pLib->pGateBuf, pGate, uFuncBuf ); pLib->pGateBuf = Mio_GateCompare( pLib->pGateBuf, pGate, uFuncBuf );
if ( pLib->pGateBuf == NULL ) if ( pLib->pGateBuf == NULL )
{ {
printf( "Warnings: GENLIB library reader cannot detect the buffer gate.\n" ); printf( "Warnings: genlib library reader cannot detect the buffer gate.\n" );
printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" ); printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" );
} }
...@@ -626,7 +627,7 @@ void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib ) ...@@ -626,7 +627,7 @@ void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib )
pLib->pGateInv = Mio_GateCompare( pLib->pGateInv, pGate, uFuncInv ); pLib->pGateInv = Mio_GateCompare( pLib->pGateInv, pGate, uFuncInv );
if ( pLib->pGateInv == NULL ) if ( pLib->pGateInv == NULL )
{ {
printf( "Warnings: GENLIB library reader cannot detect the invertor gate.\n" ); printf( "Warnings: genlib library reader cannot detect the invertor gate.\n" );
printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" ); printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" );
} }
...@@ -637,7 +638,7 @@ void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib ) ...@@ -637,7 +638,7 @@ void Mio_LibraryDetectSpecialGates( Mio_Library_t * pLib )
pLib->pGateAnd2 = Mio_GateCompare( pLib->pGateAnd2, pGate, uFuncAnd2 ); pLib->pGateAnd2 = Mio_GateCompare( pLib->pGateAnd2, pGate, uFuncAnd2 );
if ( pLib->pGateAnd2 == NULL && pLib->pGateNand2 == NULL ) if ( pLib->pGateAnd2 == NULL && pLib->pGateNand2 == NULL )
{ {
printf( "Warnings: GENLIB library reader cannot detect the AND2 or NAND2 gate.\n" ); printf( "Warnings: genlib library reader cannot detect the AND2 or NAND2 gate.\n" );
printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" ); printf( "Some parts of the supergate-based technology mapper may not work correctly.\n" );
} }
} }
......
...@@ -243,7 +243,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -243,7 +243,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
if ( argc != globalUtilOptind + 1 ) if ( argc != globalUtilOptind + 1 )
{ {
fprintf( pErr, "The GENLIB library file should be given on the command line.\n" ); fprintf( pErr, "The genlib library file should be given on the command line.\n" );
goto usage; goto usage;
} }
...@@ -275,7 +275,8 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -275,7 +275,8 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
} }
// compute the gates // compute the gates
Super_Precompute( pLib, nVarsMax, nLevels, nGatesMax, DelayLimit, AreaLimit, TimeLimit, fSkipInvs, fWriteOldFormat, fVerbose ); FileName = Extra_FileNameGenericAppend(Mio_LibraryReadName(pLib), ".super");
Super_Precompute( pLib, nVarsMax, nLevels, nGatesMax, DelayLimit, AreaLimit, TimeLimit, fSkipInvs, fVerbose, FileName );
// delete the library // delete the library
Mio_LibraryDelete( pLib ); Mio_LibraryDelete( pLib );
...@@ -283,7 +284,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -283,7 +284,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv )
usage: usage:
fprintf( pErr, "usage: super [-ILNT num] [-DA float] [-E file] [-sovh] <genlib_file>\n"); fprintf( pErr, "usage: super [-ILNT num] [-DA float] [-E file] [-sovh] <genlib_file>\n");
fprintf( pErr, "\t precomputes the supergates for the given GENLIB library\n" ); fprintf( pErr, "\t precomputes the supergates for the given genlib library\n" );
fprintf( pErr, "\t-I num : the max number of supergate inputs [default = %d]\n", nVarsMax ); fprintf( pErr, "\t-I num : the max number of supergate inputs [default = %d]\n", nVarsMax );
fprintf( pErr, "\t-L num : the max number of levels of gates [default = %d]\n", nLevels ); fprintf( pErr, "\t-L num : the max number of levels of gates [default = %d]\n", nLevels );
fprintf( pErr, "\t-N num : the limit on the number of considered supergates [default = %d]\n", nGatesMax ); fprintf( pErr, "\t-N num : the limit on the number of considered supergates [default = %d]\n", nGatesMax );
......
...@@ -28,11 +28,8 @@ ...@@ -28,11 +28,8 @@
/// PARAMETERS /// /// PARAMETERS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_HEADER_START ABC_NAMESPACE_HEADER_START
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// STRUCTURE DEFINITIONS /// /// STRUCTURE DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
...@@ -49,14 +46,15 @@ ABC_NAMESPACE_HEADER_START ...@@ -49,14 +46,15 @@ ABC_NAMESPACE_HEADER_START
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/*=== superCore.c =============================================================*/ /*=== superAnd.c =============================================================*/
extern void Super2_Precompute( int nInputs, int nLevels, int fVerbose );
/*=== superGate.c =============================================================*/
extern Vec_Str_t * Super_PrecomputeStr( Mio_Library_t * pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose );
extern void Super_Precompute( Mio_Library_t * pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose, char * pFileName );
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_HEADER_END
#endif #endif
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -54,12 +54,6 @@ ABC_NAMESPACE_HEADER_START ...@@ -54,12 +54,6 @@ ABC_NAMESPACE_HEADER_START
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/*=== superAnd.c =============================================================*/
extern void Super2_Precompute( int nInputs, int nLevels, int fVerbose );
/*=== superGate.c =============================================================*/
extern void Super_Precompute( Mio_Library_t * pLibGen, int nInputs, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fWriteOldFormat, int fVerbose );
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_HEADER_END
......
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