Commit c7e215ca by Alan Mishchenko

New hierarchy manager.

parent 9c409add
......@@ -70,7 +70,7 @@ Gia_Man_t * Gia_ManStart( int nObjsMax )
***********************************************************************/
void Gia_ManStop( Gia_Man_t * p )
{
printf( "Hash table hits = %12u. Hash table misses = %12u.\n", (int)p->nHashHit, (int)p->nHashMiss );
// printf( "Hash table hits = %12u. Hash table misses = %12u.\n", (int)p->nHashHit, (int)p->nHashMiss );
Tim_ManStopP( (Tim_Man_t **)&p->pManTime );
assert( p->pManTime == NULL );
Vec_PtrFreeFree( p->vNamesIn );
......
......@@ -503,11 +503,17 @@ Vec_Ptr_t * Abc_NtkCollectHie( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsNetlist(pNtk) );
assert( !Abc_NtkLatchNum(pNtk) );
vResult = Vec_PtrAlloc( 1000 );
if ( pNtk->pDesign == NULL )
{
Vec_PtrPush( vResult, pNtk );
return vResult;
}
vMods = pNtk->pDesign->vModules;
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
pModel->iStep = -1;
vResult = Vec_PtrAlloc( 1000 );
Abc_NtkCollectHie_rec( pNtk, vResult );
return vResult;
}
......@@ -544,11 +550,15 @@ void Abc_NtkCountInst( Abc_Ntk_t * pNtk )
Abc_Ntk_t * pModel;
int i, Counter;
if ( pNtk->pDesign == NULL )
Counter = Abc_NtkNodeNum(pNtk);
else
{
vMods = pNtk->pDesign->vModules;
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
pModel->iStep = -1;
Counter = Abc_NtkCountInst_rec( pNtk );
}
printf( "Instances = %10d.\n", Counter );
}
......@@ -588,11 +598,15 @@ void Abc_NtkCountNodes( Abc_Ntk_t * pNtk )
double Counter;
int i;
if ( pNtk->pDesign == NULL )
Counter = Abc_NtkNodeNum(pNtk);
else
{
vMods = pNtk->pDesign->vModules;
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
pModel->dTemp = -1;
Counter = Abc_NtkCountNodes_rec( pNtk );
}
printf( "Nodes = %.0f\n", Counter );
}
......@@ -617,6 +631,9 @@ int Abc_NtkCheckRecursive( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsNetlist(pNtk) );
assert( !Abc_NtkLatchNum(pNtk) );
if ( pNtk->pDesign == NULL )
return RetValue;
vMods = pNtk->pDesign->vModules;
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
{
......@@ -662,17 +679,20 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose )
if ( pNtk->pDesign == NULL || pNtk->pDesign->vModules == NULL )
{
printf( "There is no hierarchy information.\n" );
Abc_NtkDelete( pNtk );
return NULL;
// Abc_NtkDelete( pNtk );
// return NULL;
}
Abc_PrintTime( 1, "Reading file", clock() - clk );
assert( Abc_NtkIsNetlist(pNtk) );
assert( !Abc_NtkLatchNum(pNtk) );
if ( pNtk->pDesign != NULL )
{
clk = clock();
Abc_NtkCountNodes( pNtk );
Abc_PrintTime( 1, "Count nodes", clock() - clk );
}
// print stats
if ( fVerbose )
......
......@@ -8928,12 +8928,16 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Aig_ManInterRepar( Aig_Man_t * pMan, int fVerbose );
extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
extern void Aig_ManSupportsTest( Aig_Man_t * pMan );
extern int Aig_SupportSizeTest( Aig_Man_t * pMan );
extern int Abc_NtkSuppSizeTest( Abc_Ntk_t * p );
if ( pNtk )
{
Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
// Aig_ManInterRepar( pAig, 1 );
// Aig_ManInterTest( pAig, 1 );
Aig_ManSupportsTest( pAig );
// Aig_ManSupportsTest( pAig );
// Aig_SupportSizeTest( pAig );
Abc_NtkSuppSizeTest( pNtk );
Aig_ManStop( pAig );
}
}
......@@ -30323,6 +30327,7 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
int fSwitch = 0;
// extern Gia_Man_t * Gia_VtaTest( Gia_Man_t * p );
extern void Gia_VtaTest( Gia_Man_t * p, int nFramesMax, int nConfMax, int nTimeMax, int fVerbose );
extern int Gia_ManSuppSizeTest( Gia_Man_t * p );
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
......@@ -30359,7 +30364,8 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
// pAbc->pGia = Gia_VtaTest( pTemp = pAbc->pGia );
// Gia_ManStopP( &pTemp );
Gia_VtaTest( pAbc->pGia, 100000, 0, 0, 1 );
// Gia_VtaTest( pAbc->pGia, 100000, 0, 0, 1 );
Gia_ManSuppSizeTest( pAbc->pGia );
return 0;
......
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