summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-11-08 21:17:37 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2021-11-08 21:17:37 -0800
commit079a309a0d0bbe89eccfb64cdae55d1db73ca03a (patch)
tree979c02b5c81d79eabe850de25db7fb49f3ac2512 /src/base
parent621d6355f475670cfdba5b685c65ee4dfd4207ea (diff)
downloadabc-079a309a0d0bbe89eccfb64cdae55d1db73ca03a.tar.gz
abc-079a309a0d0bbe89eccfb64cdae55d1db73ca03a.tar.bz2
abc-079a309a0d0bbe89eccfb64cdae55d1db73ca03a.zip
Bug fix in processing NDR.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/wlc/wlcBlast.c2
-rw-r--r--src/base/wlc/wlcNdr.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/base/wlc/wlcBlast.c b/src/base/wlc/wlcBlast.c
index 4ec8d7ff..6e910cd8 100644
--- a/src/base/wlc/wlcBlast.c
+++ b/src/base/wlc/wlcBlast.c
@@ -2110,7 +2110,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
// complement flop inputs whose init state is 1
for ( i = 0; i < nFf2Regs; i++ )
Gia_ManAppendCo( pNew, Gia_ManAppendCi(pNew) );
- //Gia_ManSetRegNum( pNew, nFf2Regs );
+ Gia_ManSetRegNum( pNew, nFf2Regs );
}
else
{
diff --git a/src/base/wlc/wlcNdr.c b/src/base/wlc/wlcNdr.c
index b06d9357..d401281a 100644
--- a/src/base/wlc/wlcNdr.c
+++ b/src/base/wlc/wlcNdr.c
@@ -368,7 +368,7 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
Ndr_Data_t * p = (Ndr_Data_t *)pData;
Wlc_Obj_t * pObj; Vec_Int_t * vName2Obj, * vFanins = Vec_IntAlloc( 100 );
int Mod = 2, i, k, Obj, * pArray, nDigits, fFound, NameId, NameIdMax;
- Vec_Wrd_t * vTruths = NULL;
+ Vec_Wrd_t * vTruths = NULL; int nTruths[2] = {0};
Wlc_Ntk_t * pTemp, * pNtk = Wlc_NtkAlloc( "top", Ndr_DataObjNum(p, Mod)+1 );
Wlc_NtkCheckIntegrity( pData );
Vec_IntClear( &pNtk->vFfs );
@@ -415,11 +415,14 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
Vec_IntPush( &pNtk->vFfs2, iObj );
if ( Type == ABC_OPER_LUT )
{
+ word * pTruth;
if ( vTruths == NULL )
vTruths = Vec_WrdStart( 1000 );
if ( NameId >= Vec_WrdSize(vTruths) )
Vec_WrdFillExtra( vTruths, 2*NameId, 0 );
- Vec_WrdWriteEntry( vTruths, NameId, *((word *)Ndr_ObjReadBodyP(p, Obj, NDR_FUNCTION)) );
+ pTruth = (word *)Ndr_ObjReadBodyP(p, Obj, NDR_FUNCTION);
+ Vec_WrdWriteEntry( vTruths, NameId, pTruth ? *pTruth : 0 );
+ nTruths[ pTruth != NULL ]++;
}
if ( Type == ABC_OPER_SLICE )
Vec_IntPushTwo( vFanins, End, Beg );
@@ -437,6 +440,8 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
Wlc_ObjFanin1(pNtk, pObj)->Signed = 1;
}
}
+ if ( nTruths[0] )
+ printf( "Warning! The number of LUTs without function is %d (out of %d).\n", nTruths[0], nTruths[0]+nTruths[1] );
// mark primary outputs
Ndr_ModForEachPo( p, Mod, Obj )
{