summaryrefslogtreecommitdiffstats
path: root/src/aig/ntl
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/ntl')
-rw-r--r--src/aig/ntl/ntl.h2
-rw-r--r--src/aig/ntl/ntlFraig.c4
-rw-r--r--src/aig/ntl/ntlInsert.c9
-rw-r--r--src/aig/ntl/ntlObj.c2
-rw-r--r--src/aig/ntl/ntlReadBlif.c2
-rw-r--r--src/aig/ntl/ntlWriteBlif.c2
6 files changed, 16 insertions, 5 deletions
diff --git a/src/aig/ntl/ntl.h b/src/aig/ntl/ntl.h
index 659f6c60..55581026 100644
--- a/src/aig/ntl/ntl.h
+++ b/src/aig/ntl/ntl.h
@@ -52,7 +52,7 @@ typedef enum {
NTL_OBJ_NONE, // 0: non-existent object
NTL_OBJ_PI, // 1: primary input
NTL_OBJ_PO, // 2: primary output
- NTL_OBJ_LATCH, // 3: latch node
+ NTL_OBJ_LATCH, // 3: latch
NTL_OBJ_NODE, // 4: logic node
NTL_OBJ_LUT1, // 5: inverter/buffer
NTL_OBJ_BOX, // 6: white box or black box
diff --git a/src/aig/ntl/ntlFraig.c b/src/aig/ntl/ntlFraig.c
index 767ea6e4..a723c981 100644
--- a/src/aig/ntl/ntlFraig.c
+++ b/src/aig/ntl/ntlFraig.c
@@ -76,6 +76,8 @@ Aig_Obj_t ** Ntl_ManFraigDeriveClasses( Aig_Man_t * pAig, Ntl_Man_t * pNew, Aig_
if ( Aig_ObjIsPo(pObj) )
continue;
pObjCol = pObj->pData;
+ if ( pObjCol == NULL )
+ continue;
if ( pMapBack[pObjCol->Id] == NULL )
pMapBack[pObjCol->Id] = pObj;
}
@@ -89,6 +91,8 @@ Aig_Obj_t ** Ntl_ManFraigDeriveClasses( Aig_Man_t * pAig, Ntl_Man_t * pNew, Aig_
continue;
// get the collapsed node
pObjCol = pObj->pData;
+ if ( pObjCol == NULL )
+ continue;
// get the representative of the collapsed node
pObjColRepr = pAigCol->pReprs[pObjCol->Id];
if ( pObjColRepr == NULL )
diff --git a/src/aig/ntl/ntlInsert.c b/src/aig/ntl/ntlInsert.c
index 3e9f82d6..3cd9470b 100644
--- a/src/aig/ntl/ntlInsert.c
+++ b/src/aig/ntl/ntlInsert.c
@@ -82,6 +82,8 @@ Ntl_Man_t * Ntl_ManInsertMapping( Ntl_Man_t * p, Vec_Ptr_t * vMapping, Aig_Man_t
Ntl_ObjSetFanin( pNode, pNet, k );
}
}
+ else
+ pNode->nFanins = 0;
sprintf( Buffer, "lut%0*d", nDigits, i );
if ( (pNet = Ntl_ModelFindNet( pRoot, Buffer )) )
{
@@ -302,6 +304,8 @@ Ntl_Man_t * Ntl_ManInsertNtk( Ntl_Man_t * p, Nwk_Man_t * pNtk )
Ntl_ObjSetFanin( pNode, pNet, k );
}
}
+ else
+ pNode->nFanins = 0;
sprintf( Buffer, "lut%0*d", nDigits, i );
if ( (pNet = Ntl_ModelFindNet( pRoot, Buffer )) )
{
@@ -341,13 +345,16 @@ Ntl_Man_t * Ntl_ManInsertNtk( Ntl_Man_t * p, Nwk_Man_t * pNtk )
if ( !Ntl_ModelSetNetDriver( pNode, pNetCo ) )
{
printf( "Ntl_ManInsertNtk(): Internal error: PO net has more than one fanin.\n" );
- return 0;
+ return NULL;
}
}
// clean CI/CO marks
Ntl_ManUnmarkCiCoNets( p );
if ( !Ntl_ManCheck( p ) )
+ {
printf( "Ntl_ManInsertNtk: The check has failed for design %s.\n", p->pName );
+ return NULL;
+ }
return p;
}
diff --git a/src/aig/ntl/ntlObj.c b/src/aig/ntl/ntlObj.c
index c86ab47b..10bfbbb7 100644
--- a/src/aig/ntl/ntlObj.c
+++ b/src/aig/ntl/ntlObj.c
@@ -103,7 +103,7 @@ Ntl_Obj_t * Ntl_ModelCreateLatch( Ntl_Mod_t * pModel )
Vec_PtrPush( pModel->vObjs, p );
p->pModel = pModel;
p->Type = NTL_OBJ_LATCH;
- p->nFanins = 2;
+ p->nFanins = 1;
p->nFanouts = 1;
pModel->nObjs[NTL_OBJ_LATCH]++;
return p;
diff --git a/src/aig/ntl/ntlReadBlif.c b/src/aig/ntl/ntlReadBlif.c
index cac53058..3574b61e 100644
--- a/src/aig/ntl/ntlReadBlif.c
+++ b/src/aig/ntl/ntlReadBlif.c
@@ -825,7 +825,7 @@ static int Ioa_ReadParseLineLatch( Ioa_ReadMod_t * p, char * pLine )
{
pToken = Vec_PtrEntry(vTokens,Vec_PtrSize(vTokens)-2);
pNetLi = Ntl_ModelFindOrCreateNet( p->pNtk, pToken );
- pObj->pFanio[1] = pNetLi;
+// pObj->pFanio[1] = pNetLi;
}
return 1;
}
diff --git a/src/aig/ntl/ntlWriteBlif.c b/src/aig/ntl/ntlWriteBlif.c
index 9814ed5d..51d41c26 100644
--- a/src/aig/ntl/ntlWriteBlif.c
+++ b/src/aig/ntl/ntlWriteBlif.c
@@ -28,7 +28,7 @@
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
-
+
/**Function*************************************************************
Synopsis [Writes one model into the BLIF file.]