summaryrefslogtreecommitdiffstats
path: root/src/map/mapper
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-03-27 14:17:12 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2011-03-27 14:17:12 -0700
commit6c01e8b9f040d591f72882aff08ed21446fbb567 (patch)
tree71f04dae22291d7321e5bb244462ab1145c47ee6 /src/map/mapper
parent1ec437d04b2fcb42054f068525c2a1b21b69fe53 (diff)
downloadabc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.gz
abc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.bz2
abc-6c01e8b9f040d591f72882aff08ed21446fbb567.zip
Fixed a number of small bugs and memory leaks.
Diffstat (limited to 'src/map/mapper')
-rw-r--r--src/map/mapper/mapperLib.c1
-rw-r--r--src/map/mapper/mapperMatch.c8
-rw-r--r--src/map/mapper/mapperSuper.c2
3 files changed, 10 insertions, 1 deletions
diff --git a/src/map/mapper/mapperLib.c b/src/map/mapper/mapperLib.c
index 9cc8747d..bd7f9b87 100644
--- a/src/map/mapper/mapperLib.c
+++ b/src/map/mapper/mapperLib.c
@@ -86,6 +86,7 @@ clk = clock();
{
if ( pExcludeFile != 0 )
{
+ Map_SuperLibFree( p );
printf ("Error: Exclude file support not present for old format. Stop.\n");
return NULL;
}
diff --git a/src/map/mapper/mapperMatch.c b/src/map/mapper/mapperMatch.c
index 19dd6939..6a2ad74a 100644
--- a/src/map/mapper/mapperMatch.c
+++ b/src/map/mapper/mapperMatch.c
@@ -93,16 +93,23 @@ int Map_MappingMatches( Map_Man_t * p )
// make sure that at least one non-trival cut is present
if ( pNode->pCuts->pNext == NULL )
{
+ Extra_ProgressBarStop( pProgress );
printf( "\nError: A node in the mapping graph does not have feasible cuts.\n" );
return 0;
}
// match negative phase
if ( !Map_MatchNodePhase( p, pNode, 0 ) )
+ {
+ Extra_ProgressBarStop( pProgress );
return 0;
+ }
// match positive phase
if ( !Map_MatchNodePhase( p, pNode, 1 ) )
+ {
+ Extra_ProgressBarStop( pProgress );
return 0;
+ }
// make sure that at least one phase is mapped
if ( pNode->pCutBest[0] == NULL && pNode->pCutBest[1] == NULL )
@@ -110,6 +117,7 @@ int Map_MappingMatches( Map_Man_t * p )
printf( "\nError: Could not match both phases of AIG node %d.\n", pNode->Num );
printf( "Please make sure that the supergate library has equivalents of AND2 or NAND2.\n" );
printf( "If such supergates exist in the library, report a bug.\n" );
+ Extra_ProgressBarStop( pProgress );
return 0;
}
diff --git a/src/map/mapper/mapperSuper.c b/src/map/mapper/mapperSuper.c
index 3be70541..58deddb7 100644
--- a/src/map/mapper/mapperSuper.c
+++ b/src/map/mapper/mapperSuper.c
@@ -89,7 +89,7 @@ int Map_LibraryReadFile( Map_SuperLib_t * pLib, FILE * pFile )
unsigned uCanon[2];
// skip empty and comment lines
- while ( fgets( pBuffer, 5000, pFile ) != NULL )
+ while ( fgets( pBuffer, 2000, pFile ) != NULL )
{
// skip leading spaces
for ( pTemp = pBuffer; *pTemp == ' ' || *pTemp == '\r' || *pTemp == '\n'; pTemp++ );