summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2010-11-28 22:44:54 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2010-11-28 22:44:54 -0800
commitc2c9a5cf8dbef8e01253d483fb3114c9cf0c330a (patch)
treeda7294d7291ab1fa5ef4a02cc56c57722caf41dc
parenta17a4e5ca4d01220912fd3e85f9db2f6dc119254 (diff)
downloadabc-c2c9a5cf8dbef8e01253d483fb3114c9cf0c330a.tar.gz
abc-c2c9a5cf8dbef8e01253d483fb3114c9cf0c330a.tar.bz2
abc-c2c9a5cf8dbef8e01253d483fb3114c9cf0c330a.zip
Added command "swappos".
-rw-r--r--src/base/abc/abcNtk.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/base/abc/abcNtk.c b/src/base/abc/abcNtk.c
index 602ad548..a4bdaa0f 100644
--- a/src/base/abc/abcNtk.c
+++ b/src/base/abc/abcNtk.c
@@ -1470,6 +1470,36 @@ void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput )
Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput )
+{
+ Abc_Obj_t * pObj1, * pObj2;
+ Abc_Obj_t * pChild1Old, * pChild2Old;
+ Abc_Obj_t * pChild1, * pChild2;
+ if ( iOutput == 0 )
+ return;
+ pObj1 = Abc_NtkPo( pNtk, 0 );
+ pObj2 = Abc_NtkPo( pNtk, iOutput );
+ pChild1Old = Abc_ObjChild0( pObj1 );
+ pChild2Old = Abc_ObjChild0( pObj2 );
+ pChild1 = Abc_ObjNotCond( pChild1Old, Abc_ObjFaninC0(pObj2) );
+ pChild2 = Abc_ObjNotCond( pChild2Old, Abc_ObjFaninC0(pObj1) );
+ Abc_ObjPatchFanin( pObj1, Abc_ObjFanin0(pObj1), pChild2 );
+ Abc_ObjPatchFanin( pObj2, Abc_ObjFanin0(pObj2), pChild1 );
+ assert( Abc_ObjChild0(pObj1) == pChild2Old );
+ assert( Abc_ObjChild0(pObj2) == pChild1Old );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///