summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-08-19 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-08-19 08:01:00 -0700
commit0e4de190ff4e25f5904a571b79a225363d5fc369 (patch)
treea89075fbb01848568534265967c59289c77713a0 /src/base
parentdffcc93b8e8779f443762c71098796b01ea7d409 (diff)
downloadabc-0e4de190ff4e25f5904a571b79a225363d5fc369.tar.gz
abc-0e4de190ff4e25f5904a571b79a225363d5fc369.tar.bz2
abc-0e4de190ff4e25f5904a571b79a225363d5fc369.zip
Version abc50819
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abc.c30
-rw-r--r--src/base/abc/abcAttach.c2
-rw-r--r--src/base/abc/abcRefs.c4
-rw-r--r--src/base/abc/abcRewrite.c4
4 files changed, 22 insertions, 18 deletions
diff --git a/src/base/abc/abc.c b/src/base/abc/abc.c
index be813996..dfe2f4d4 100644
--- a/src/base/abc/abc.c
+++ b/src/base/abc/abc.c
@@ -1323,34 +1323,26 @@ int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t * pNtk;
int c;
bool fVerbose;
+ bool fPrecompute;
// external functions
- extern void * Abc_NtkManRwrStart( char * pFileName );
- extern void Abc_NtkManRwrStop( void * p );
+ extern void Rwr_Precompute();
extern int Abc_NtkRewrite( Abc_Ntk_t * pNtk );
-/*
- {
- void * p;
- int fFlag = 0;
- if ( fFlag )
- p = Abc_NtkManRwrStart( NULL );
- else
- p = Abc_NtkManRwrStart( "data.aaa" );
- Abc_NtkManRwrStop( p );
- return 0;
- }
-*/
pNtk = Abc_FrameReadNet(pAbc);
pOut = Abc_FrameReadOut(pAbc);
pErr = Abc_FrameReadErr(pAbc);
// set defaults
- fVerbose = 0;
+ fVerbose = 0;
+ fPrecompute = 0;
util_getopt_reset();
- while ( ( c = util_getopt( argc, argv, "vh" ) ) != EOF )
+ while ( ( c = util_getopt( argc, argv, "zvh" ) ) != EOF )
{
switch ( c )
{
+ case 'z':
+ fPrecompute ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -1361,6 +1353,12 @@ int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
+ if ( fPrecompute )
+ {
+ Rwr_Precompute();
+ return 0;
+ }
+
if ( pNtk == NULL )
{
fprintf( pErr, "Empty network.\n" );
diff --git a/src/base/abc/abcAttach.c b/src/base/abc/abcAttach.c
index 950ecc1d..47e911c9 100644
--- a/src/base/abc/abcAttach.c
+++ b/src/base/abc/abcAttach.c
@@ -144,7 +144,7 @@ int Abc_NtkAttach( Abc_Ntk_t * pNtk )
pNode->pData = pNode->pCopy, pNode->pCopy = NULL;
pNtk->Type = ABC_NTK_LOGIC_MAP;
Extra_MmFlexStop( pNtk->pManFunc, 0 );
- pNtk->pManFunc = NULL;
+ pNtk->pManFunc = pGenlib;
printf( "Library gates are successfully attached to the nodes.\n" );
diff --git a/src/base/abc/abcRefs.c b/src/base/abc/abcRefs.c
index 764dc165..c3561028 100644
--- a/src/base/abc/abcRefs.c
+++ b/src/base/abc/abcRefs.c
@@ -46,6 +46,8 @@ int Abc_NodeMffcSize( Abc_Obj_t * pNode )
int nConeSize1, nConeSize2;
assert( !Abc_ObjIsComplement( pNode ) );
assert( Abc_ObjIsNode( pNode ) );
+ if ( Abc_ObjFaninNum(pNode) == 0 )
+ return 0;
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0 ); // dereference
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 0 ); // reference
assert( nConeSize1 == nConeSize2 );
@@ -69,6 +71,8 @@ int Abc_NodeMffcLabel( Abc_Obj_t * pNode )
int nConeSize1, nConeSize2;
assert( !Abc_ObjIsComplement( pNode ) );
assert( Abc_ObjIsNode( pNode ) );
+ if ( Abc_ObjFaninNum(pNode) == 0 )
+ return 0;
nConeSize1 = Abc_NodeRefDeref( pNode, 0, 0 ); // dereference
nConeSize2 = Abc_NodeRefDeref( pNode, 1, 1 ); // reference
assert( nConeSize1 == nConeSize2 );
diff --git a/src/base/abc/abcRewrite.c b/src/base/abc/abcRewrite.c
index 437448de..2c4c8c55 100644
--- a/src/base/abc/abcRewrite.c
+++ b/src/base/abc/abcRewrite.c
@@ -50,7 +50,9 @@ int Abc_NtkRewrite( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsAig(pNtk) );
// start the rewriting manager
- p = Rwr_ManStart( "data.aaa" );
+ p = Rwr_ManStart( 0 );
+ if ( p == NULL )
+ return 0;
Rwr_ManPrepareNetwork( p, pNtk );
// resynthesize each node once