diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2019-11-20 21:47:30 +0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2019-11-20 21:47:30 +0800 |
commit | 30e2b727a1b941bdc968da3e09ed7655124b217b (patch) | |
tree | 7ea305225114a11619f8de32734fca6d55ab60b3 /src/base | |
parent | 3699f8beb9dc543f2774de32896594df1a65d36d (diff) | |
download | abc-30e2b727a1b941bdc968da3e09ed7655124b217b.tar.gz abc-30e2b727a1b941bdc968da3e09ed7655124b217b.tar.bz2 abc-30e2b727a1b941bdc968da3e09ed7655124b217b.zip |
Bug fix in printing truth table in Verilog.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/wlc/wlcWriteVer.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/base/wlc/wlcWriteVer.c b/src/base/wlc/wlcWriteVer.c index c6763e93..8821d7ea 100644 --- a/src/base/wlc/wlcWriteVer.c +++ b/src/base/wlc/wlcWriteVer.c @@ -144,6 +144,16 @@ void Wlc_WriteVerIntVec( FILE * pFile, Wlc_Ntk_t * p, Vec_Int_t * vVec, int Star NameCounter++; } } + +int Wlc_ObjFaninBitNum( Wlc_Ntk_t * p, Wlc_Obj_t * pObj ) +{ + Wlc_Obj_t * pFanin; + int i, Count = 0; + Wlc_ObjForEachFaninObj( p, pObj, pFanin, i ) + Count += Wlc_ObjRange(pFanin); + return Count; +} + void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops ) { Wlc_Obj_t * pObj; @@ -215,7 +225,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops ) { word Truth = Vec_WrdEntry( p->vLutTruths, Wlc_ObjId(p, pObj) ); fprintf( pFile, " ; // TT = " ); - Extra_PrintHex( pFile, (unsigned *)&Truth, Wlc_ObjFaninNum(pObj) ); + Extra_PrintHex( pFile, (unsigned *)&Truth, Wlc_ObjFaninBitNum(p, pObj) ); } } else if ( pObj->Type == WLC_OBJ_CONST ) |