summaryrefslogtreecommitdiffstats
path: root/src/aig/ntl/ntlTable.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-12-18 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-12-18 08:01:00 -0800
commit14c01eaccab87d14d1bd0eaa3fc491026349665e (patch)
treebfe2f18a426b347cdb4d0216f5e71fd744b8a9f8 /src/aig/ntl/ntlTable.c
parent126637ddd3c237d9c83f3a7f2b1f3f2722337411 (diff)
downloadabc-14c01eaccab87d14d1bd0eaa3fc491026349665e.tar.gz
abc-14c01eaccab87d14d1bd0eaa3fc491026349665e.tar.bz2
abc-14c01eaccab87d14d1bd0eaa3fc491026349665e.zip
Version abc71218
Diffstat (limited to 'src/aig/ntl/ntlTable.c')
-rw-r--r--src/aig/ntl/ntlTable.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/aig/ntl/ntlTable.c b/src/aig/ntl/ntlTable.c
index 87048f10..b84ac1a5 100644
--- a/src/aig/ntl/ntlTable.c
+++ b/src/aig/ntl/ntlTable.c
@@ -171,6 +171,45 @@ int Ntl_ModelSetNetDriver( Ntl_Obj_t * pObj, Ntl_Net_t * pNet )
return 1;
}
+/**Function*************************************************************
+
+ Synopsis [Returns -1, 0, +1 (when it is PI, not found, or PO).]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Ntl_ModelFindPioNumber( Ntl_Mod_t * p, char * pName, int * pNumber )
+{
+ Ntl_Net_t * pNet;
+ Ntl_Obj_t * pObj;
+ int i;
+ *pNumber = -1;
+ pNet = Ntl_ModelFindNet( p, pName );
+ if ( pNet == NULL )
+ return 0;
+ Ntl_ModelForEachPo( p, pObj, i )
+ {
+ if ( Ntl_ObjFanin0(pObj) == pNet )
+ {
+ *pNumber = i;
+ return 1;
+ }
+ }
+ Ntl_ModelForEachPi( p, pObj, i )
+ {
+ if ( Ntl_ObjFanout0(pObj) == pNet )
+ {
+ *pNumber = i;
+ return -1;
+ }
+ }
+ return 0;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////