summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorMathias Soeken <mathias.soeken@gmail.com>2017-02-22 19:00:28 -0800
committerMathias Soeken <mathias.soeken@gmail.com>2017-02-22 19:00:28 -0800
commit28e8e7f3e79d1391a2f3a31cefe3afe234aa3b8e (patch)
tree6b7962dc72653e3bf615c5901854774eca9d23c8 /src/map
parent5af44731bff0061c724912cf76e86dddbb4f2c7a (diff)
parentdd8cc7e9a27e2bd962d612911c6fd9508c6c1e0d (diff)
downloadabc-28e8e7f3e79d1391a2f3a31cefe3afe234aa3b8e.tar.gz
abc-28e8e7f3e79d1391a2f3a31cefe3afe234aa3b8e.tar.bz2
abc-28e8e7f3e79d1391a2f3a31cefe3afe234aa3b8e.zip
Merged alanmi/abc into default
Diffstat (limited to 'src/map')
-rw-r--r--src/map/if/ifDec16.c2
-rw-r--r--src/map/if/ifLibLut.c4
-rw-r--r--src/map/mio/mioUtils.c4
-rw-r--r--src/map/scl/scl.c2
-rw-r--r--src/map/scl/sclLiberty.c14
5 files changed, 15 insertions, 11 deletions
diff --git a/src/map/if/ifDec16.c b/src/map/if/ifDec16.c
index 22de91ba..4b555bf8 100644
--- a/src/map/if/ifDec16.c
+++ b/src/map/if/ifDec16.c
@@ -902,7 +902,7 @@ void If_CluReverseOrder_old( word * pF, int nVars, int * V2P, int * P2V, int iVa
// return the number of cofactors w.r.t. the topmost vars (nBSsize)
int If_CluCountCofs( word * pF, int nVars, int nBSsize, int iShift, word pCofs[3][CLU_WRD_MAX/4] )
{
- word iCofs[128], iCof, Result = 0;
+ word iCofs[128] = {0}, iCof, Result = 0;
word * pCofA, * pCofB;
int nMints = (1 << nBSsize);
int i, c, w, nCofs;
diff --git a/src/map/if/ifLibLut.c b/src/map/if/ifLibLut.c
index 26fa137b..1033cc1f 100644
--- a/src/map/if/ifLibLut.c
+++ b/src/map/if/ifLibLut.c
@@ -75,6 +75,7 @@ If_LibLut_t * If_LibLutRead( char * FileName )
Abc_Print( 1, "Error in the LUT library file \"%s\".\n", FileName );
ABC_FREE( p->pName );
ABC_FREE( p );
+ fclose( pFile );
return NULL;
}
@@ -93,6 +94,7 @@ If_LibLut_t * If_LibLutRead( char * FileName )
ABC_FREE( p->pName );
ABC_FREE( p );
Abc_Print( 1, "LUT %d has too many pins (%d). Max allowed is %d.\n", i, k, i );
+ fclose( pFile );
return NULL;
}
@@ -105,6 +107,7 @@ If_LibLut_t * If_LibLutRead( char * FileName )
ABC_FREE( p->pName );
ABC_FREE( p );
Abc_Print( 1, "Skipping LUTs of size more than %d.\n", i );
+ fclose( pFile );
return NULL;
}
i++;
@@ -136,6 +139,7 @@ If_LibLut_t * If_LibLutRead( char * FileName )
}
}
+ fclose( pFile );
return p;
}
diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c
index 7572b27c..428eb92b 100644
--- a/src/map/mio/mioUtils.c
+++ b/src/map/mio/mioUtils.c
@@ -569,7 +569,7 @@ Mio_Cell_t * Mio_CollectRootsNew( Mio_Library_t * pLib, int nInputs, int * pnGat
if ( ppCells[3].pName == NULL )
{ printf( "Error: Cannot find inverter gate in the library.\n" ); return NULL; }
// sort by delay
- if ( iCell > 1 )
+ if ( iCell > 5 )
{
qsort( (void *)(ppCells + 4), iCell - 4, sizeof(Mio_Cell_t),
(int (*)(const void *, const void *)) Mio_AreaCompare );
@@ -726,7 +726,7 @@ Mio_Cell2_t * Mio_CollectRootsNew2( Mio_Library_t * pLib, int nInputs, int * pnG
if ( ppCells[3].pName == NULL )
{ printf( "Error: Cannot find inverter gate in the library.\n" ); return NULL; }
// sort by delay
- if ( iCell > 1 )
+ if ( iCell > 5 )
{
qsort( (void *)(ppCells + 4), iCell - 4, sizeof(Mio_Cell2_t),
(int (*)(const void *, const void *)) Mio_AreaCompare2 );
diff --git a/src/map/scl/scl.c b/src/map/scl/scl.c
index bd6d1cea..9d4653a7 100644
--- a/src/map/scl/scl.c
+++ b/src/map/scl/scl.c
@@ -259,7 +259,7 @@ usage:
fprintf( pAbc->Err, "\t-d : toggle dumping the parsed library into file \"*_temp.lib\" [default = %s]\n", fDump? "yes": "no" );
fprintf( pAbc->Err, "\t-n : toggle replacing gate/pin names by short strings [default = %s]\n", fShortNames? "yes": "no" );
fprintf( pAbc->Err, "\t-v : toggle writing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pAbc->Err, "\t-v : toggle writing information about skipped gates [default = %s]\n", fVeryVerbose? "yes": "no" );
+ fprintf( pAbc->Err, "\t-w : toggle writing information about skipped gates [default = %s]\n", fVeryVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\t<file> : the name of a file to read\n" );
return 1;
diff --git a/src/map/scl/sclLiberty.c b/src/map/scl/sclLiberty.c
index 50e69d08..b48cfbe1 100644
--- a/src/map/scl/sclLiberty.c
+++ b/src/map/scl/sclLiberty.c
@@ -509,7 +509,7 @@ char * Scl_LibertyFileContents( char * pFileName, int nContents )
{
FILE * pFile = fopen( pFileName, "rb" );
char * pContents = ABC_ALLOC( char, nContents+1 );
- int RetValue;
+ int RetValue = 0;
RetValue = fread( pContents, nContents, 1, pFile );
fclose( pFile );
pContents[nContents] = 0;
@@ -518,7 +518,7 @@ char * Scl_LibertyFileContents( char * pFileName, int nContents )
void Scl_LibertyStringDump( char * pFileName, Vec_Str_t * vStr )
{
FILE * pFile = fopen( pFileName, "wb" );
- int RetValue;
+ int RetValue = 0;
if ( pFile == NULL )
{
printf( "Scl_LibertyStringDump(): The output file is unavailable.\n" );
@@ -583,7 +583,7 @@ Scl_Tree_t * Scl_LibertyParse( char * pFileName, int fVerbose )
return NULL;
pPos = p->pContents;
Scl_LibertyWipeOutComments( p->pContents, p->pContents+p->nContents );
- if ( !Scl_LibertyBuildItem( p, &pPos, p->pContents + p->nContents ) == 0 )
+ if ( (!Scl_LibertyBuildItem( p, &pPos, p->pContents + p->nContents )) == 0 )
{
if ( p->pError ) printf( "%s", p->pError );
printf( "Parsing failed. " );
@@ -765,10 +765,10 @@ Vec_Str_t * Scl_LibertyParseGenlibStr( char * pFileName, int fVerbose )
***********************************************************************/
//#define SCL_DEBUG
#ifdef SCL_DEBUG
-static inline void Vec_StrPutI_( Vec_Str_t * vOut, int Val ) { printf( "%d ", Val ); Vec_StrPutI( vOut, Val ); }
-static inline void Vec_StrPutW_( Vec_Str_t * vOut, word Val ) { printf( "%lu ", Val ); Vec_StrPutW( vOut, Val ); }
-static inline void Vec_StrPutF_( Vec_Str_t * vOut, float Val ) { printf( "%f ", Val ); Vec_StrPutF( vOut, Val ); }
-static inline void Vec_StrPutS_( Vec_Str_t * vOut, char * Val ) { printf( "%s ", Val ); Vec_StrPutS( vOut, Val ); }
+static inline void Vec_StrPutI_( Vec_Str_t * vOut, int Val ) { printf( "%d ", Val ); Vec_StrPutI( vOut, Val ); }
+static inline void Vec_StrPutW_( Vec_Str_t * vOut, word Val ) { printf( "%lu ", (long)Val ); Vec_StrPutW( vOut, Val ); }
+static inline void Vec_StrPutF_( Vec_Str_t * vOut, float Val ) { printf( "%f ", Val ); Vec_StrPutF( vOut, Val ); }
+static inline void Vec_StrPutS_( Vec_Str_t * vOut, char * Val ) { printf( "%s ", Val ); Vec_StrPutS( vOut, Val ); }
static inline void Vec_StrPut_( Vec_Str_t * vOut ) { printf( "\n" ); }
#else
static inline void Vec_StrPutI_( Vec_Str_t * vOut, int Val ) { Vec_StrPutI( vOut, Val ); }