diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2017-12-03 14:39:11 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2017-12-03 14:39:11 -0800 |
commit | 1743979b75850820f3b8aec29a7191754b1bd2bd (patch) | |
tree | 869bef60dd1d9e1cec5af94740d8a898c168b1d2 /src/aig/hop/hopUtil.c | |
parent | a49dfbcf91d2271fc18b9581309f7362b6272ede (diff) | |
download | abc-1743979b75850820f3b8aec29a7191754b1bd2bd.tar.gz abc-1743979b75850820f3b8aec29a7191754b1bd2bd.tar.bz2 abc-1743979b75850820f3b8aec29a7191754b1bd2bd.zip |
Adding switch -a to 'write_verilog' to write factored forms without XORs and MUXes.
Diffstat (limited to 'src/aig/hop/hopUtil.c')
-rw-r--r-- | src/aig/hop/hopUtil.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/aig/hop/hopUtil.c b/src/aig/hop/hopUtil.c index 8cc7bdde..02cb08e3 100644 --- a/src/aig/hop/hopUtil.c +++ b/src/aig/hop/hopUtil.c @@ -366,7 +366,7 @@ void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int L SeeAlso [] ***********************************************************************/ -void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level ) +void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level, int fOnlyAnds ) { Vec_Ptr_t * vSuper; Hop_Obj_t * pFanin, * pFanin0, * pFanin1, * pFaninC; @@ -387,7 +387,7 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i return; } // EXOR case - if ( Hop_ObjIsExor(pObj) ) + if ( !fOnlyAnds && Hop_ObjIsExor(pObj) ) { Vec_VecExpand( vLevels, Level ); vSuper = Vec_VecEntry( vLevels, Level ); @@ -395,7 +395,7 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i fprintf( pFile, "%s", (Level==0? "" : "(") ); Vec_PtrForEachEntry( Hop_Obj_t *, vSuper, pFanin, i ) { - Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin, (fCompl && i==0)), vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin, (fCompl && i==0)), vLevels, Level+1, fOnlyAnds ); if ( i < Vec_PtrSize(vSuper) - 1 ) fprintf( pFile, " ^ " ); } @@ -403,25 +403,25 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i return; } // MUX case - if ( Hop_ObjIsMuxType(pObj) ) + if ( !fOnlyAnds && Hop_ObjIsMuxType(pObj) ) { if ( Hop_ObjRecognizeExor( pObj, &pFanin0, &pFanin1 ) ) { fprintf( pFile, "%s", (Level==0? "" : "(") ); - Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin0, fCompl), vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin0, fCompl), vLevels, Level+1, fOnlyAnds ); fprintf( pFile, " ^ " ); - Hop_ObjPrintVerilog( pFile, pFanin1, vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, pFanin1, vLevels, Level+1, fOnlyAnds ); fprintf( pFile, "%s", (Level==0? "" : ")") ); } else { pFaninC = Hop_ObjRecognizeMux( pObj, &pFanin1, &pFanin0 ); fprintf( pFile, "%s", (Level==0? "" : "(") ); - Hop_ObjPrintVerilog( pFile, pFaninC, vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, pFaninC, vLevels, Level+1, fOnlyAnds ); fprintf( pFile, " ? " ); - Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin1, fCompl), vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin1, fCompl), vLevels, Level+1, fOnlyAnds ); fprintf( pFile, " : " ); - Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin0, fCompl), vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin0, fCompl), vLevels, Level+1, fOnlyAnds ); fprintf( pFile, "%s", (Level==0? "" : ")") ); } return; @@ -433,7 +433,7 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i fprintf( pFile, "%s", (Level==0? "" : "(") ); Vec_PtrForEachEntry( Hop_Obj_t *, vSuper, pFanin, i ) { - Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin, fCompl), vLevels, Level+1 ); + Hop_ObjPrintVerilog( pFile, Hop_NotCond(pFanin, fCompl), vLevels, Level+1, fOnlyAnds ); if ( i < Vec_PtrSize(vSuper) - 1 ) fprintf( pFile, " %s ", fCompl? "|" : "&" ); } |