summaryrefslogtreecommitdiffstats
path: root/src/map/mapper
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-07-24 09:54:53 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-07-24 09:54:53 -0700
commit00d023713b68fc554197efeb2c766b14ac3ec4bd (patch)
tree454e35712bc3fc3256dc7e8019f74bc49761d335 /src/map/mapper
parentfadcef9eb91411844bdf5d52e687cdd306c94794 (diff)
downloadabc-00d023713b68fc554197efeb2c766b14ac3ec4bd.tar.gz
abc-00d023713b68fc554197efeb2c766b14ac3ec4bd.tar.bz2
abc-00d023713b68fc554197efeb2c766b14ac3ec4bd.zip
Tuning standard-cell mapping flow.
Diffstat (limited to 'src/map/mapper')
-rw-r--r--src/map/mapper/mapper.c8
-rw-r--r--src/map/mapper/mapperInt.h6
-rw-r--r--src/map/mapper/mapperLib.c10
-rw-r--r--src/map/mapper/mapperTree.c11
4 files changed, 22 insertions, 13 deletions
diff --git a/src/map/mapper/mapper.c b/src/map/mapper/mapper.c
index 17102cec..020ee9f5 100644
--- a/src/map/mapper/mapper.c
+++ b/src/map/mapper/mapper.c
@@ -142,8 +142,14 @@ int Map_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
}
fclose( pFile );
+ if ( Abc_FrameReadLibGen() == NULL )
+ {
+ fprintf( pErr, "Genlib library should be read in first..\n" );
+ return 1;
+ }
+
// set the new network
- pLib = Map_SuperLibCreate( NULL, FileName, ExcludeFile, fAlgorithm, fVerbose );
+ pLib = Map_SuperLibCreate( (Mio_Library_t *)Abc_FrameReadLibGen(), NULL, FileName, ExcludeFile, fAlgorithm, fVerbose );
if ( pLib == NULL )
{
fprintf( pErr, "Reading supergate library has failed.\n" );
diff --git a/src/map/mapper/mapperInt.h b/src/map/mapper/mapperInt.h
index 24017103..c65b8a00 100644
--- a/src/map/mapper/mapperInt.h
+++ b/src/map/mapper/mapperInt.h
@@ -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 int Map_NodeGetFanoutNum( Map_Node_t * pNode );
/*=== mapperLib.c ============================================================*/
-extern Map_SuperLib_t * Map_SuperLibCreate( Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose );
+extern Map_SuperLib_t * Map_SuperLibCreate( Mio_Library_t * pGenlib, Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose );
extern void Map_SuperLibFree( Map_SuperLib_t * p );
/*=== mapperMatch.c ===============================================================*/
extern int Map_MappingMatches( Map_Man_t * p );
@@ -406,8 +406,8 @@ extern float Map_MappingGetArea( Map_Man_t * pMan, Map_NodeVec_t * v
extern void Map_MappingShow( Map_Man_t * pMan, char * pFileName );
/*=== 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_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Mio_Library_t * pGenlib, Vec_Str_t * vStr, char * pFileName );
+extern int Map_LibraryReadTree( Map_SuperLib_t * pLib, Mio_Library_t * pGenlib, char * pFileName, char * pExcludeFile );
extern void Map_LibraryPrintTree( Map_SuperLib_t * pLib );
/*=== mapperSuper.c ===============================================================*/
extern int Map_LibraryRead( Map_SuperLib_t * p, char * pFileName );
diff --git a/src/map/mapper/mapperLib.c b/src/map/mapper/mapperLib.c
index 80c2d610..b98d1492 100644
--- a/src/map/mapper/mapperLib.c
+++ b/src/map/mapper/mapperLib.c
@@ -55,7 +55,7 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
-Map_SuperLib_t * Map_SuperLibCreate( Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose )
+Map_SuperLib_t * Map_SuperLibCreate( Mio_Library_t * pGenlib, Vec_Str_t * vStr, char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose )
{
Map_SuperLib_t * p;
abctime clk;
@@ -79,7 +79,7 @@ clk = Abc_Clock();
if ( vStr != NULL )
{
// read the supergate library from file
- int Status = Map_LibraryReadFileTreeStr( p, vStr, pFileName );
+ int Status = Map_LibraryReadFileTreeStr( p, pGenlib, vStr, pFileName );
if ( Status == 0 )
{
Map_SuperLibFree( p );
@@ -96,7 +96,7 @@ clk = Abc_Clock();
}
else if ( fAlgorithm )
{
- if ( !Map_LibraryReadTree( p, pFileName, pExcludeFile ) )
+ if ( !Map_LibraryReadTree( p, pGenlib, pFileName, pExcludeFile ) )
{
Map_SuperLibFree( p );
return NULL;
@@ -169,7 +169,7 @@ void Map_SuperLibFree( Map_SuperLib_t * p )
if ( p == NULL ) return;
if ( p->pGenlib )
{
- assert( p->pGenlib == Abc_FrameReadLibGen() );
+// assert( p->pGenlib == Abc_FrameReadLibGen() );
// Mio_LibraryDelete( p->pGenlib );
// Abc_FrameSetLibGen( NULL );
p->pGenlib = NULL;
@@ -210,7 +210,7 @@ int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib, int fVerbose )
return 0;
// create supergate library
pFileName = Extra_FileNameGenericAppend( Mio_LibraryReadName(pLib), ".super" );
- pLibSuper = Map_SuperLibCreate( vStr, pFileName, NULL, 1, 0 );
+ pLibSuper = Map_SuperLibCreate( pLib, vStr, pFileName, NULL, 1, 0 );
Vec_StrFree( vStr );
// replace the library
Map_SuperLibFree( (Map_SuperLib_t *)Abc_FrameReadLibSuper() );
diff --git a/src/map/mapper/mapperTree.c b/src/map/mapper/mapperTree.c
index 8c23417c..d4c494ae 100644
--- a/src/map/mapper/mapperTree.c
+++ b/src/map/mapper/mapperTree.c
@@ -142,6 +142,7 @@ Map_Super_t * Map_LibraryReadGateTree( Map_SuperLib_t * pLib, char * pBuffer, in
SeeAlso []
***********************************************************************/
+/*
int Map_LibraryReadFileTree( Map_SuperLib_t * pLib, FILE * pFile, char *pFileName )
{
ProgressBar * pProgress;
@@ -299,6 +300,7 @@ int Map_LibraryReadTree2( Map_SuperLib_t * pLib, char * pFileName, char * pExclu
// prepare the info about the library
return Map_LibraryDeriveGateInfo( pLib, tExcludeGate );
}
+*/
/**Function*************************************************************
@@ -386,7 +388,7 @@ int Map_LibraryCompareLibNames( char * pName1, char * pName2 )
SeeAlso []
***********************************************************************/
-int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Vec_Str_t * vStr, char * pFileName )
+int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Mio_Library_t * pGenlib, Vec_Str_t * vStr, char * pFileName )
{
ProgressBar * pProgress;
char pBuffer[5000];
@@ -410,7 +412,8 @@ int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Vec_Str_t * vStr, char *
}
pLibName = strtok( pTemp, " \t\r\n" );
- pLib->pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen();
+// pLib->pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen();
+ pLib->pGenlib = pGenlib;
// if ( pLib->pGenlib == NULL || strcmp( , pLibName ) )
if ( pLib->pGenlib == NULL || Map_LibraryCompareLibNames(Mio_LibraryReadName(pLib->pGenlib), pLibName) )
{
@@ -519,7 +522,7 @@ int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Vec_Str_t * vStr, char *
pLib->nSupersReal = nCounter;
return 1;
}
-int Map_LibraryReadTree( Map_SuperLib_t * pLib, char * pFileName, char * pExcludeFile )
+int Map_LibraryReadTree( Map_SuperLib_t * pLib, Mio_Library_t * pGenlib, char * pFileName, char * pExcludeFile )
{
char * pBuffer;
Vec_Str_t * vStr;
@@ -554,7 +557,7 @@ int Map_LibraryReadTree( Map_SuperLib_t * pLib, char * pFileName, char * pExclud
fprintf ( Abc_FrameReadOut( pAbc ), "Read %d gates from exclude file\n", num );
}
- Status = Map_LibraryReadFileTreeStr( pLib, vStr, pFileName );
+ Status = Map_LibraryReadFileTreeStr( pLib, pGenlib, vStr, pFileName );
Vec_StrFree( vStr );
if ( Status == 0 )
return 0;