summaryrefslogtreecommitdiffstats
path: root/src/aig
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig')
-rw-r--r--src/aig/gia/gia.h3
-rw-r--r--src/aig/gia/giaDup.c28
2 files changed, 31 insertions, 0 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index 57b25ab0..db8be236 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -450,6 +450,8 @@ static inline int Gia_ObjIsRi( Gia_Man_t * p, Gia_Obj_t * pObj ) {
static inline Gia_Obj_t * Gia_ObjRoToRi( Gia_Man_t * p, Gia_Obj_t * pObj ) { assert( Gia_ObjIsRo(p, pObj) ); return Gia_ManCo(p, Gia_ManCoNum(p) - Gia_ManCiNum(p) + Gia_ObjCioId(pObj)); }
static inline Gia_Obj_t * Gia_ObjRiToRo( Gia_Man_t * p, Gia_Obj_t * pObj ) { assert( Gia_ObjIsRi(p, pObj) ); return Gia_ManCi(p, Gia_ManCiNum(p) - Gia_ManCoNum(p) + Gia_ObjCioId(pObj)); }
+static inline int Gia_ObjRoToRiId( Gia_Man_t * p, int ObjId ) { return Gia_ObjId( p, Gia_ObjRoToRi( p, Gia_ManObj(p, ObjId) ) ); }
+static inline int Gia_ObjRiToRoId( Gia_Man_t * p, int ObjId ) { return Gia_ObjId( p, Gia_ObjRiToRo( p, Gia_ManObj(p, ObjId) ) ); }
static inline int Gia_ObjDiff0( Gia_Obj_t * pObj ) { return pObj->iDiff0; }
static inline int Gia_ObjDiff1( Gia_Obj_t * pObj ) { return pObj->iDiff1; }
@@ -1098,6 +1100,7 @@ extern int Gia_ManConeSize( Gia_Man_t * p, int * pNodes, int nNo
extern Vec_Vec_t * Gia_ManLevelize( Gia_Man_t * p );
extern Vec_Int_t * Gia_ManOrderReverse( Gia_Man_t * p );
/*=== giaDup.c ============================================================*/
+extern void Gia_ManDupRemapLiterals( Vec_Int_t * vLits, Gia_Man_t * p );
extern void Gia_ManDupRemapEquiv( Gia_Man_t * pNew, Gia_Man_t * p );
extern Gia_Man_t * Gia_ManDupOrderDfs( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManDupOrderDfsChoices( Gia_Man_t * p );
diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c
index 73337a15..72fc86c0 100644
--- a/src/aig/gia/giaDup.c
+++ b/src/aig/gia/giaDup.c
@@ -36,6 +36,34 @@ ABC_NAMESPACE_IMPL_START
Synopsis [Removes pointers to the unmarked nodes..]
+ Description [Array vLits contains literals of p. At the same time,
+ each object pObj of p points to a literal of pNew. This procedure
+ remaps literals in array vLits into literals of pNew.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Gia_ManDupRemapLiterals( Vec_Int_t * vLits, Gia_Man_t * p )
+{
+ Gia_Obj_t * pObj;
+ int i, iLit, iLitNew;
+ Vec_IntForEachEntry( vLits, iLit, i )
+ {
+ pObj = Gia_ManObj( p, Abc_Lit2Var(iLit) );
+ if ( ~pObj->Value == 0 )
+ iLitNew = -1;
+ else
+ iLitNew = Abc_LitNotCond( pObj->Value, Abc_LitIsCompl(iLit) );
+ Vec_IntWriteEntry( vLits, i, iLitNew );
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Removes pointers to the unmarked nodes..]
+
Description []
SideEffects []