summaryrefslogtreecommitdiffstats
path: root/src/aig/hop
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-01-10 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-01-10 08:01:00 -0800
commit8dfe404863427d5e7b18d055ffd78b453835f959 (patch)
treef0efcc544e0501aa6477948744e4d2788a4fb965 /src/aig/hop
parentbe6a484a997a8477d4c3b03c17f798c1b0061bf1 (diff)
downloadabc-8dfe404863427d5e7b18d055ffd78b453835f959.tar.gz
abc-8dfe404863427d5e7b18d055ffd78b453835f959.tar.bz2
abc-8dfe404863427d5e7b18d055ffd78b453835f959.zip
Version abc70110
Diffstat (limited to 'src/aig/hop')
-rw-r--r--src/aig/hop/hop.h1
-rw-r--r--src/aig/hop/hopUtil.c47
2 files changed, 48 insertions, 0 deletions
diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h
index a5d6e2e5..ce4cdfde 100644
--- a/src/aig/hop/hop.h
+++ b/src/aig/hop/hop.h
@@ -304,6 +304,7 @@ extern void Hop_ObjCollectMulti( Hop_Obj_t * pFunc, Vec_Ptr_t * vSupe
extern int Hop_ObjIsMuxType( Hop_Obj_t * pObj );
extern int Hop_ObjRecognizeExor( Hop_Obj_t * pObj, Hop_Obj_t ** ppFan0, Hop_Obj_t ** ppFan1 );
extern Hop_Obj_t * Hop_ObjRecognizeMux( Hop_Obj_t * pObj, Hop_Obj_t ** ppObjT, Hop_Obj_t ** ppObjE );
+extern void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level );
extern void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level );
extern void Hop_ObjPrintVerbose( Hop_Obj_t * pObj, int fHaig );
extern void Hop_ManPrintVerbose( Hop_Man_t * p, int fHaig );
diff --git a/src/aig/hop/hopUtil.c b/src/aig/hop/hopUtil.c
index 738caa4a..a49e8397 100644
--- a/src/aig/hop/hopUtil.c
+++ b/src/aig/hop/hopUtil.c
@@ -283,6 +283,53 @@ Hop_Obj_t * Hop_ObjRecognizeMux( Hop_Obj_t * pNode, Hop_Obj_t ** ppNodeT, Hop_Ob
/**Function*************************************************************
+ Synopsis [Prints Eqn formula for the AIG rooted at this node.]
+
+ Description [The formula is in terms of PIs, which should have
+ their names assigned in pObj->pData fields.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level )
+{
+ Vec_Ptr_t * vSuper;
+ Hop_Obj_t * pFanin;
+ int fCompl, i;
+ // store the complemented attribute
+ fCompl = Hop_IsComplement(pObj);
+ pObj = Hop_Regular(pObj);
+ // constant case
+ if ( Hop_ObjIsConst1(pObj) )
+ {
+ fprintf( pFile, "%d", !fCompl );
+ return;
+ }
+ // PI case
+ if ( Hop_ObjIsPi(pObj) )
+ {
+ fprintf( pFile, "%s%s", fCompl? "!" : "", pObj->pData );
+ return;
+ }
+ // AND case
+ Vec_VecExpand( vLevels, Level );
+ vSuper = Vec_VecEntry(vLevels, Level);
+ Hop_ObjCollectMulti( pObj, vSuper );
+ fprintf( pFile, "%s", (Level==0? "" : "(") );
+ Vec_PtrForEachEntry( vSuper, pFanin, i )
+ {
+ Hop_ObjPrintEqn( pFile, Hop_NotCond(pFanin, fCompl), vLevels, Level+1 );
+ if ( i < Vec_PtrSize(vSuper) - 1 )
+ fprintf( pFile, " %s ", fCompl? "+" : "*" );
+ }
+ fprintf( pFile, "%s", (Level==0? "" : ")") );
+ return;
+}
+
+/**Function*************************************************************
+
Synopsis [Prints Verilog formula for the AIG rooted at this node.]
Description [The formula is in terms of PIs, which should have