diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-05-16 15:52:08 +0900 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-05-16 15:52:08 +0900 |
commit | eb027885eeaaf9969b4dbeff5f31d5bbcec98529 (patch) | |
tree | b73eae93c06b47154b272419a0a84560b2b66c31 /src | |
parent | 03b17916f88c728ec79adabe504a6f6f2625c752 (diff) | |
download | abc-eb027885eeaaf9969b4dbeff5f31d5bbcec98529.tar.gz abc-eb027885eeaaf9969b4dbeff5f31d5bbcec98529.tar.bz2 abc-eb027885eeaaf9969b4dbeff5f31d5bbcec98529.zip |
Supporting wide MUX in NDR.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/wlc/wlcNdr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/base/wlc/wlcNdr.c b/src/base/wlc/wlcNdr.c index cc1b93f8..0822cbb5 100644 --- a/src/base/wlc/wlcNdr.c +++ b/src/base/wlc/wlcNdr.c @@ -69,6 +69,7 @@ int Ndr_TypeNdr2Wlc( int Type ) if ( Type == ABC_OPER_LOGIC_AND ) return WLC_OBJ_LOGIC_AND; // 28: logic AND if ( Type == ABC_OPER_LOGIC_OR ) return WLC_OBJ_LOGIC_OR; // 29: logic OR if ( Type == ABC_OPER_LOGIC_XOR ) return WLC_OBJ_LOGIC_XOR; // 30: logic XOR + if ( Type == ABC_OPER_SEL_NMUX ) return WLC_OBJ_MUX; // 08: multiplexer if ( Type == ABC_OPER_COMP_EQU ) return WLC_OBJ_COMP_EQU; // 31: compare equal if ( Type == ABC_OPER_COMP_NOTEQU ) return WLC_OBJ_COMP_NOTEQU; // 32: compare not equal if ( Type == ABC_OPER_COMP_LESS ) return WLC_OBJ_COMP_LESS; // 33: compare less @@ -183,7 +184,7 @@ char * Ndr_ObjWriteConstant( unsigned * pBits, int nBits ) void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk ) { Wlc_Obj_t * pObj; - int i, k, iFanin, iOutId; + int i, k, iFanin, iOutId, Type; // create a new module void * pDesign = Ndr_Create( 1 ); int ModId = Ndr_AddModule( pDesign, 1 ); @@ -207,7 +208,11 @@ void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk ) Vec_IntPush( vFanins, iFanin ); if ( pObj->Type == WLC_OBJ_CONST ) pFunction = Ndr_ObjWriteConstant( (unsigned *)Wlc_ObjFanins(pObj), Wlc_ObjRange(pObj) ); - Ndr_AddObject( pDesign, ModId, Ndr_TypeWlc2Ndr(pObj->Type), 0, + if ( pObj->Type == WLC_OBJ_MUX && Wlc_ObjRange(Wlc_ObjFanin0(pNtk, pObj)) > 1 ) + Type = ABC_OPER_SEL_NMUX; + else + Type = Ndr_TypeWlc2Ndr(pObj->Type); + Ndr_AddObject( pDesign, ModId, Type, 0, pObj->End, pObj->Beg, pObj->Signed, Vec_IntSize(vFanins), Vec_IntArray(vFanins), 1, &iOutId, pFunction ); } |