diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-11-18 21:01:30 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-11-18 21:01:30 -0800 |
commit | 12908d3c25254e938737c4f1dd94074e2a1e98ff (patch) | |
tree | f97cda31905d33c681dace42bfbd09499787ad76 /src/base/wlc/wlcAbc.c | |
parent | 33159929201bcf8f2f6ae2e573176f948b8cb865 (diff) | |
download | abc-12908d3c25254e938737c4f1dd94074e2a1e98ff.tar.gz abc-12908d3c25254e938737c4f1dd94074e2a1e98ff.tar.bz2 abc-12908d3c25254e938737c4f1dd94074e2a1e98ff.zip |
Various usability changes.
Diffstat (limited to 'src/base/wlc/wlcAbc.c')
-rw-r--r-- | src/base/wlc/wlcAbc.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/base/wlc/wlcAbc.c b/src/base/wlc/wlcAbc.c index 1836f4ed..e1b06ffd 100644 --- a/src/base/wlc/wlcAbc.c +++ b/src/base/wlc/wlcAbc.c @@ -42,6 +42,58 @@ ABC_NAMESPACE_IMPL_START SeeAlso [] ***********************************************************************/ +void Wlc_NtkPrintInputInfo( Wlc_Ntk_t * pNtk ) +{ + Wlc_Obj_t * pObj; + int i, k, nRange, nBeg, nEnd, nBits = 0; + FILE * output; + + output = fopen("abc_blast_input.info","w"); + + Wlc_NtkForEachCi( pNtk, pObj, i ) + { + nRange = Wlc_ObjRange(pObj); + nBeg = pObj->Beg; + nEnd = pObj->End; + + for ( k = 0; k < nRange; k++ ) + { + int index = nEnd > nBeg ? nBeg + k : nEnd + k; + char c = pObj->Type != WLC_OBJ_FO ? 'i' : pNtk->pInits[nBits + k]; + fprintf(output,"%s[%d] : %c \n", Wlc_ObjName(pNtk, Wlc_ObjId(pNtk, pObj)), index , c ); + } + if (pObj->Type == WLC_OBJ_FO) + nBits += nRange; + } + + Wlc_NtkForEachPo( pNtk, pObj, i ) + { + nRange = Wlc_ObjRange(pObj); + nBeg = pObj->Beg; + nEnd = pObj->End; + + for ( k = 0; k < nRange; k++ ) + { + int index = nEnd > nBeg ? nBeg + k : nEnd + k; + fprintf(output,"%s[%d] : o \n", Wlc_ObjName(pNtk, Wlc_ObjId(pNtk, pObj)), index); + } + } + + fclose(output); + return; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ void Wlc_NtkPrintInvStats( Wlc_Ntk_t * pNtk, Vec_Int_t * vCounts, int fVerbose ) { Wlc_Obj_t * pObj; |