summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abcStrash.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-04-08 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-04-08 08:01:00 -0700
commitc09d4d499cee70f02e3e9a18226554b8d1d34488 (patch)
tree89ac20b1029dc8407f655224f6ef2b5f431fa453 /src/base/abci/abcStrash.c
parent94112fd22fc6f09ccc488cfc577d43aebeff9c5f (diff)
downloadabc-c09d4d499cee70f02e3e9a18226554b8d1d34488.tar.gz
abc-c09d4d499cee70f02e3e9a18226554b8d1d34488.tar.bz2
abc-c09d4d499cee70f02e3e9a18226554b8d1d34488.zip
Version abc70408
Diffstat (limited to 'src/base/abci/abcStrash.c')
-rw-r--r--src/base/abci/abcStrash.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/base/abci/abcStrash.c b/src/base/abci/abcStrash.c
index 4f48f3bf..b1a0dc5b 100644
--- a/src/base/abci/abcStrash.c
+++ b/src/base/abci/abcStrash.c
@@ -168,6 +168,7 @@ int Abc_NtkAppend( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fAddPos )
// perform strashing
nNewCis = 0;
Abc_NtkCleanCopy( pNtk2 );
+ Abc_AigConst1(pNtk2)->pCopy = Abc_AigConst1(pNtk1);
Abc_NtkForEachCi( pNtk2, pObj, i )
{
pName = Abc_ObjName(pObj);
@@ -196,6 +197,27 @@ int Abc_NtkAppend( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fAddPos )
Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj->pCopy), NULL );
}
}
+ else
+ {
+ Abc_Obj_t * pObjOld, * pDriverOld, * pDriverNew;
+ int fCompl, iNodeId;
+ // OR the choices
+ Abc_NtkForEachCo( pNtk2, pObj, i )
+ {
+ iNodeId = Nm_ManFindIdByNameTwoTypes( pNtk1->pManName, Abc_ObjName(pObj), ABC_OBJ_PO, ABC_OBJ_BI );
+ assert( iNodeId >= 0 );
+ pObjOld = Abc_NtkObj( pNtk1, iNodeId );
+ // derive the new driver
+ pDriverOld = Abc_ObjChild0( pObjOld );
+ pDriverNew = Abc_ObjChild0Copy( pObj );
+ pDriverNew = Abc_AigOr( pNtk1->pManFunc, pDriverOld, pDriverNew );
+ if ( Abc_ObjRegular(pDriverOld) == Abc_ObjRegular(pDriverNew) )
+ continue;
+ // replace the old driver by the new driver
+ fCompl = Abc_ObjRegular(pDriverOld)->fPhase ^ Abc_ObjRegular(pDriverNew)->fPhase;
+ Abc_ObjPatchFanin( pObjOld, Abc_ObjRegular(pDriverOld), Abc_ObjNotCond(Abc_ObjRegular(pDriverNew), fCompl) );
+ }
+ }
// make sure that everything is okay
if ( !Abc_NtkCheck( pNtk1 ) )
{