mirror of https://github.com/YosysHQ/abc.git
Added command &read_blif to read hierarchical BLIF directly into the &-space.
This commit is contained in:
parent
be874a7abe
commit
23af7f9036
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in New Issue