diff options
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 1 | ||||
-rw-r--r-- | src/aig/gia/giaDup.c | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index 5a87bd7a..d44e4a04 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -760,6 +760,7 @@ extern Gia_Man_t * Gia_ManDupOutputGroup( Gia_Man_t * p, int iOutStart, extern Gia_Man_t * Gia_ManDupOrderAiger( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupFlip( Gia_Man_t * p, int * pInitState ); extern Gia_Man_t * Gia_ManDup( Gia_Man_t * p ); +extern void Gia_ManDupAppend( Gia_Man_t * p, Gia_Man_t * pTwo ); extern Gia_Man_t * Gia_ManDupSelf( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupFlopClass( Gia_Man_t * p, int iClass ); extern Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ); diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 3b8980af..95de5c02 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -430,6 +430,38 @@ Gia_Man_t * Gia_ManDup( Gia_Man_t * p ) /**Function************************************************************* + Synopsis [Appends second AIG without any changes.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Gia_ManDupAppend( Gia_Man_t * pNew, Gia_Man_t * pTwo ) +{ + Gia_Obj_t * pObj; + int i; + if ( pNew->nRegs > 0 ) + pNew->nRegs = 0; + if ( pNew->pHTable == NULL ) + Gia_ManHashAlloc( pNew ); + Gia_ManConst0(pTwo)->Value = 0; + Gia_ManForEachObj1( pTwo, pObj, i ) + { + if ( Gia_ObjIsAnd(pObj) ) + pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); + else if ( Gia_ObjIsCi(pObj) ) + pObj->Value = Gia_ManAppendCi( pNew ); + else if ( Gia_ObjIsCo(pObj) ) + pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) ); + } + return pNew; +} + +/**Function************************************************************* + Synopsis [Duplicates while adding self-loops to the registers.] Description [] |