mirror of https://github.com/YosysHQ/abc.git
New hierarchy manager.
This commit is contained in:
parent
37b8a190ba
commit
b7ba9aa8dc
|
|
@ -277,7 +277,7 @@ Vec_Ptr_t * Aig_ManSupports( Aig_Man_t * pMan )
|
||||||
Part_Man_t * p;
|
Part_Man_t * p;
|
||||||
Part_One_t * pPart0, * pPart1;
|
Part_One_t * pPart0, * pPart1;
|
||||||
Aig_Obj_t * pObj;
|
Aig_Obj_t * pObj;
|
||||||
int i;
|
int i, Counter = 0;
|
||||||
// set the number of PIs/POs
|
// set the number of PIs/POs
|
||||||
Aig_ManForEachPi( pMan, pObj, i )
|
Aig_ManForEachPi( pMan, pObj, i )
|
||||||
pObj->pNext = (Aig_Obj_t *)(long)i;
|
pObj->pNext = (Aig_Obj_t *)(long)i;
|
||||||
|
|
@ -301,6 +301,8 @@ Vec_Ptr_t * Aig_ManSupports( Aig_Man_t * pMan )
|
||||||
assert( pPart1->nRefs > 0 );
|
assert( pPart1->nRefs > 0 );
|
||||||
if ( --pPart1->nRefs == 0 )
|
if ( --pPart1->nRefs == 0 )
|
||||||
Part_ManRecycleEntry( p, pPart1 );
|
Part_ManRecycleEntry( p, pPart1 );
|
||||||
|
if ( ((Part_One_t *)pObj->pData)->nOuts <= 16 )
|
||||||
|
Counter++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( Aig_ObjIsPo(pObj) )
|
if ( Aig_ObjIsPo(pObj) )
|
||||||
|
|
@ -346,9 +348,28 @@ Vec_Ptr_t * Aig_ManSupports( Aig_Man_t * pMan )
|
||||||
printf( "%d ", Vec_IntSize( Vec_VecEntryInt(vSupports, i) ) );
|
printf( "%d ", Vec_IntSize( Vec_VecEntryInt(vSupports, i) ) );
|
||||||
printf( "\n" );
|
printf( "\n" );
|
||||||
*/
|
*/
|
||||||
|
// printf( "%d \n", Counter );
|
||||||
return vSupports;
|
return vSupports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis []
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
void Aig_ManSupportsTest( Aig_Man_t * pMan )
|
||||||
|
{
|
||||||
|
Vec_Ptr_t * vSupps;
|
||||||
|
vSupps = Aig_ManSupports( pMan );
|
||||||
|
Vec_VecFree( (Vec_Vec_t *)vSupps );
|
||||||
|
}
|
||||||
|
|
||||||
/**Function*************************************************************
|
/**Function*************************************************************
|
||||||
|
|
||||||
Synopsis [Computes the set of outputs for each input.]
|
Synopsis [Computes the set of outputs for each input.]
|
||||||
|
|
|
||||||
|
|
@ -552,6 +552,40 @@ void Abc_NtkCountInst( Abc_Ntk_t * pNtk )
|
||||||
printf( "Instances = %10d.\n", Counter );
|
printf( "Instances = %10d.\n", Counter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
Synopsis [Checks if there is a recursive definition.]
|
||||||
|
|
||||||
|
Description []
|
||||||
|
|
||||||
|
SideEffects []
|
||||||
|
|
||||||
|
SeeAlso []
|
||||||
|
|
||||||
|
***********************************************************************/
|
||||||
|
int Abc_NtkCheckRecursive( Abc_Ntk_t * pNtk )
|
||||||
|
{
|
||||||
|
Vec_Ptr_t * vMods;
|
||||||
|
Abc_Ntk_t * pModel;
|
||||||
|
Abc_Obj_t * pObj;
|
||||||
|
int i, k, RetValue = 0;
|
||||||
|
|
||||||
|
assert( Abc_NtkIsNetlist(pNtk) );
|
||||||
|
assert( !Abc_NtkLatchNum(pNtk) );
|
||||||
|
|
||||||
|
vMods = pNtk->pDesign->vModules;
|
||||||
|
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
|
||||||
|
{
|
||||||
|
Abc_NtkForEachObj( pModel, pObj, k )
|
||||||
|
if ( Abc_ObjIsBox(pObj) && pObj->pData == (void *)pModel )
|
||||||
|
{
|
||||||
|
printf( "WARNING: Model \"%s\" contains a recursive defition.\n", Abc_NtkName(pModel) );
|
||||||
|
RetValue = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RetValue;
|
||||||
|
}
|
||||||
|
|
||||||
/**Function*************************************************************
|
/**Function*************************************************************
|
||||||
|
|
||||||
|
|
@ -592,6 +626,9 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose )
|
||||||
assert( Abc_NtkIsNetlist(pNtk) );
|
assert( Abc_NtkIsNetlist(pNtk) );
|
||||||
assert( !Abc_NtkLatchNum(pNtk) );
|
assert( !Abc_NtkLatchNum(pNtk) );
|
||||||
|
|
||||||
|
if ( Abc_NtkCheckRecursive(pNtk) )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
// test the new data-structure
|
// test the new data-structure
|
||||||
if ( fUseTest )
|
if ( fUseTest )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -638,6 +638,8 @@ Au_Ntk_t * Au_NtkDerive( Au_Man_t * pMan, Abc_Ntk_t * pNtk, Vec_Ptr_t * vOrder )
|
||||||
// copy POs
|
// copy POs
|
||||||
Abc_NtkForEachPo( pNtk, pTerm, i )
|
Abc_NtkForEachPo( pNtk, pTerm, i )
|
||||||
Au_NtkCreatePo( p, Abc_ObjFanin0(pTerm)->iTemp );
|
Au_NtkCreatePo( p, Abc_ObjFanin0(pTerm)->iTemp );
|
||||||
|
|
||||||
|
Au_NtkPrintStats( p );
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8927,11 +8927,13 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
// extern void Abs_VfaManTest( Aig_Man_t * pAig, int nFrames, int nConfLimit, int fVerbose );
|
// extern void Abs_VfaManTest( Aig_Man_t * pAig, int nFrames, int nConfLimit, int fVerbose );
|
||||||
extern void Aig_ManInterRepar( Aig_Man_t * pMan, int fVerbose );
|
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 Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
|
||||||
|
extern void Aig_ManSupportsTest( Aig_Man_t * pMan );
|
||||||
if ( pNtk )
|
if ( pNtk )
|
||||||
{
|
{
|
||||||
Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
|
Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
|
||||||
// Aig_ManInterRepar( pAig, 1 );
|
// Aig_ManInterRepar( pAig, 1 );
|
||||||
// Aig_ManInterTest( pAig, 1 );
|
// Aig_ManInterTest( pAig, 1 );
|
||||||
|
Aig_ManSupportsTest( pAig );
|
||||||
Aig_ManStop( pAig );
|
Aig_ManStop( pAig );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue