Commit 23af7f90 by Alan Mishchenko

Added command &read_blif to read hierarchical BLIF directly into the &-space.

parent be874a7a
......@@ -283,6 +283,49 @@ Gia_Man_t * Abc_NtkDeriveFlatGia( Abc_Ntk_t * pNtk )
return pGia;
}
/**Function*************************************************************
Synopsis [Count the number of instances and I/O pins in the hierarchy.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkCountInstances_rec( Abc_Ntk_t * pNtk, int * pCountInst, int * pCountPins )
{
Vec_Ptr_t * vOrder = (Vec_Ptr_t *)pNtk->pData;
Abc_Obj_t * pObj;
int i;
*pCountInst += 1;
*pCountPins += Abc_NtkPiNum(pNtk) + Abc_NtkPoNum(pNtk);
Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
if ( Abc_ObjIsBox(pObj) )
Abc_NtkCountInstances_rec( (Abc_Ntk_t *)pObj->pData, pCountInst, pCountPins );
}
/**Function*************************************************************
Synopsis [Count the number of instances and I/O pins in the hierarchy.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkCountInstances( Abc_Ntk_t * pNtk )
{
int CountInst = 0, CountPins = 0;
assert( Abc_NtkIsNetlist(pNtk) );
assert( !Abc_NtkLatchNum(pNtk) );
// recursively flatten hierarchy
Abc_NtkCountInstances_rec( pNtk, &CountInst, &CountPins );
printf( "Instances = %10d. I/O pins = %10d.\n", CountInst, CountPins );
}
/**Function*************************************************************
......@@ -332,6 +375,10 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose )
pGia = Abc_NtkDeriveFlatGia( pNtk );
Abc_PrintTime( 1, "Deriving GIA", clock() - clk );
clk = clock();
Abc_NtkCountInstances( pNtk );
Abc_PrintTime( 1, "Gather stats", clock() - clk );
// clean nodes/boxes of all nodes
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
Vec_PtrFree( (Vec_Ptr_t *)pModel->pData );
......
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