summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-04-04 16:15:36 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-04-04 16:15:36 +0700
commitb79fd69fb56d051b4b85dd998daf9a1b07df1fb8 (patch)
treedcfa1287771cd675ad099fbca9eb9ce97fbf23f3
parent3a15f343070e617edb97ebe197f292ff3a4e50f1 (diff)
downloadabc-b79fd69fb56d051b4b85dd998daf9a1b07df1fb8.tar.gz
abc-b79fd69fb56d051b4b85dd998daf9a1b07df1fb8.tar.bz2
abc-b79fd69fb56d051b4b85dd998daf9a1b07df1fb8.zip
Making sure the names are transfered when &get -n is used.
-rw-r--r--src/aig/gia/giaIf.c5
-rw-r--r--src/base/abc/abcNames.c32
-rw-r--r--src/base/abci/abc.c7
3 files changed, 31 insertions, 13 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c
index ba824a5e..487460bd 100644
--- a/src/aig/gia/giaIf.c
+++ b/src/aig/gia/giaIf.c
@@ -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;
diff --git a/src/base/abc/abcNames.c b/src/base/abc/abcNames.c
index cc2d55e6..636b1b95 100644
--- a/src/base/abc/abcNames.c
+++ b/src/base/abc/abcNames.c
@@ -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*************************************************************
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 0e53610d..c254db82 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -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 )
{