Commit b79fd69f by Alan Mishchenko

Making sure the names are transfered when &get -n is used.

parent 3a15f343
......@@ -2038,6 +2038,11 @@ void Gia_ManTransferTiming( Gia_Man_t * p, Gia_Man_t * pGia )
p->DefInArrs = pGia->DefInArrs;
p->DefOutReqs = pGia->DefOutReqs;
}
if ( pGia->vNamesIn || pGia->vNamesOut )
{
p->vNamesIn = pGia->vNamesIn; pGia->vNamesIn = NULL;
p->vNamesOut = pGia->vNamesOut; pGia->vNamesOut = NULL;
}
if ( pGia->pManTime == NULL || p == pGia )
return;
p->pManTime = pGia->pManTime; pGia->pManTime = NULL;
......
......@@ -507,20 +507,10 @@ void Abc_NtkShortNames( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld )
void Abc_NtkRedirectCiCo( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj, * pObjCi, * pFanin; int i, Count = 0;
Nm_ManFree( pNtk->pManName );
pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
Abc_NtkForEachPi( pNtk, pObj, i )
Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPi(pOld, i)), NULL );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPo(pOld, i)), NULL );
Abc_NtkForEachLatch( pNtk, pObj, i )
{
Abc_ObjAssignName( Abc_ObjFanin0(pObj), Abc_ObjName(Abc_ObjFanin0(Abc_NtkBox(pOld, i))), NULL );
Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjName(Abc_ObjFanout0(Abc_NtkBox(pOld, i))), NULL );
}
Abc_Obj_t * pObj, * pObjCi, * pFanin;
int i, Count = 0;
// if CO points to CI with the same name, remove buffer between them
Abc_NtkForEachCo( pNtk, pObj, i )
{
......@@ -541,6 +531,22 @@ void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld )
if ( Count )
printf( "Redirected %d POs from buffers to PIs with the same name.\n", Count );
}
void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld )
{
Abc_Obj_t * pObj; int i;
Nm_ManFree( pNtk->pManName );
pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
Abc_NtkForEachPi( pNtk, pObj, i )
Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPi(pOld, i)), NULL );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPo(pOld, i)), NULL );
Abc_NtkForEachLatch( pNtk, pObj, i )
{
Abc_ObjAssignName( Abc_ObjFanin0(pObj), Abc_ObjName(Abc_ObjFanin0(Abc_NtkBox(pOld, i))), NULL );
Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjName(Abc_ObjFanout0(Abc_NtkBox(pOld, i))), NULL );
}
Abc_NtkRedirectCiCo( pNtk );
}
/**Function*************************************************************
......
......@@ -26003,6 +26003,8 @@ usage:
int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
extern void Abc_NtkRedirectCiCo( Abc_Ntk_t * pNtk );
Aig_Man_t * pMan;
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c, fVerbose = 0;
......@@ -26086,6 +26088,11 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
}
// decouple CI/CO with the same name
if ( pAbc->pGia->vNamesIn || pAbc->pGia->vNamesOut )
Abc_NtkRedirectCiCo( pNtk );
// transfer timing information
if ( pAbc->pGia->vInArrs || pAbc->pGia->vOutReqs )
{
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