diff options
Diffstat (limited to 'src/aig/gia')
-rw-r--r-- | src/aig/gia/gia.h | 3 | ||||
-rw-r--r-- | src/aig/gia/giaDup.c | 15 | ||||
-rw-r--r-- | src/aig/gia/giaMan.c | 1 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index 870ac85c..bdb07c4c 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -156,6 +156,7 @@ struct Gia_Man_t_ Vec_Int_t * vUserFfIds; // numbers assigned to FFs by the user Vec_Int_t * vCiNumsOrig; // original CI names Vec_Int_t * vCoNumsOrig; // original CO names + Vec_Int_t * vCofVars; // cofactoring variables Vec_Vec_t * vClockDoms; // clock domains Vec_Flt_t * vTiming; // arrival/required/slack void * pManTime; // the timing manager @@ -1013,7 +1014,7 @@ extern Gia_Man_t * Gia_ManDupFlopClass( Gia_Man_t * p, int iClass ); extern Gia_Man_t * Gia_ManDupMarked( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupTimes( Gia_Man_t * p, int nTimes ); extern Gia_Man_t * Gia_ManDupDfs( Gia_Man_t * p ); -extern Gia_Man_t * Gia_ManDupDfsRehash( Gia_Man_t * p, int nSteps, int Value ); +extern Gia_Man_t * Gia_ManDupCofactor( Gia_Man_t * p, int iVar, int Value ); extern Gia_Man_t * Gia_ManDupDfsSkip( Gia_Man_t * p ); extern Gia_Man_t * Gia_ManDupDfsCone( Gia_Man_t * p, Gia_Obj_t * pObj ); extern Gia_Man_t * Gia_ManDupDfsLitArray( Gia_Man_t * p, Vec_Int_t * vLits ); diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c index 2d294433..0939c091 100644 --- a/src/aig/gia/giaDup.c +++ b/src/aig/gia/giaDup.c @@ -1201,30 +1201,33 @@ Gia_Man_t * Gia_ManDupDfs( Gia_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Gia_ManDupDfsRehash_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj ) +void Gia_ManDupCofactor_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj ) { if ( ~pObj->Value ) return; assert( Gia_ObjIsAnd(pObj) ); - Gia_ManDupDfsRehash_rec( pNew, p, Gia_ObjFanin0(pObj) ); - Gia_ManDupDfsRehash_rec( pNew, p, Gia_ObjFanin1(pObj) ); + Gia_ManDupCofactor_rec( pNew, p, Gia_ObjFanin0(pObj) ); + Gia_ManDupCofactor_rec( pNew, p, Gia_ObjFanin1(pObj) ); pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); } -Gia_Man_t * Gia_ManDupDfsRehash( Gia_Man_t * p, int nSteps, int Value ) +Gia_Man_t * Gia_ManDupCofactor( Gia_Man_t * p, int iVar, int Value ) { Gia_Man_t * pNew, * pTemp; Gia_Obj_t * pObj; int i; + assert( iVar >= 0 && iVar < Gia_ManPiNum(p) ); + assert( Value == 0 || Value == 1 ); pNew = Gia_ManStart( Gia_ManObjNum(p) ); pNew->pName = Abc_UtilStrsav( p->pName ); pNew->pSpec = Abc_UtilStrsav( p->pSpec ); Gia_ManFillValue( p ); Gia_ManConst0(p)->Value = 0; Gia_ManForEachCi( p, pObj, i ) - pObj->Value = i < nSteps ? Value : Gia_ManAppendCi(pNew); + pObj->Value = Gia_ManAppendCi(pNew); + Gia_ManPi( p, iVar )->Value = Value; // modification! Gia_ManHashAlloc( pNew ); Gia_ManForEachCo( p, pObj, i ) - Gia_ManDupDfsRehash_rec( pNew, p, Gia_ObjFanin0(pObj) ); + Gia_ManDupCofactor_rec( pNew, p, Gia_ObjFanin0(pObj) ); Gia_ManForEachCo( p, pObj, i ) Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) ); Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) ); diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index 710886ae..6d5a8e92 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -92,6 +92,7 @@ void Gia_ManStop( Gia_Man_t * p ) Vec_WrdFreeP( &p->vSimsPi ); Vec_FltFreeP( &p->vTiming ); Vec_VecFreeP( &p->vClockDoms ); + Vec_IntFreeP( &p->vCofVars ); Vec_IntFreeP( &p->vLutConfigs ); Vec_IntFreeP( &p->vUserPiIds ); Vec_IntFreeP( &p->vUserPoIds ); |