summaryrefslogtreecommitdiffstats
path: root/src/misc/nm
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/nm')
-rw-r--r--src/misc/nm/nm.h1
-rw-r--r--src/misc/nm/nmApi.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/src/misc/nm/nm.h b/src/misc/nm/nm.h
index 89a9efac..c6344bbf 100644
--- a/src/misc/nm/nm.h
+++ b/src/misc/nm/nm.h
@@ -77,6 +77,7 @@ extern void Nm_ManDeleteIdName( Nm_Man_t * p, int ObjId );
extern char * Nm_ManCreateUniqueName( Nm_Man_t * p, int ObjId );
extern char * Nm_ManFindNameById( Nm_Man_t * p, int ObjId );
extern int Nm_ManFindIdByName( Nm_Man_t * p, char * pName, int Type );
+extern int Nm_ManFindIdByNameTwoTypes( Nm_Man_t * p, char * pName, int Type1, int Type2 );
extern Vec_Int_t * Nm_ManReturnNameIds( Nm_Man_t * p );
#ifdef __cplusplus
diff --git a/src/misc/nm/nmApi.c b/src/misc/nm/nmApi.c
index c46866d5..9165922f 100644
--- a/src/misc/nm/nmApi.c
+++ b/src/misc/nm/nmApi.c
@@ -222,6 +222,29 @@ int Nm_ManFindIdByName( Nm_Man_t * p, char * pName, int Type )
/**Function*************************************************************
+ Synopsis [Returns ID of the object if its name is known.]
+
+ Description [This procedure may return two IDs because POs and latches
+ may have the same name (the only allowed case of name duplication).]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Nm_ManFindIdByNameTwoTypes( Nm_Man_t * p, char * pName, int Type1, int Type2 )
+{
+ int iNodeId;
+ iNodeId = Nm_ManFindIdByName( p, pName, Type1 );
+ if ( iNodeId == -1 )
+ iNodeId = Nm_ManFindIdByName( p, pName, Type2 );
+ if ( iNodeId == -1 )
+ return -1;
+ return iNodeId;
+}
+
+/**Function*************************************************************
+
Synopsis [Return the IDs of objects with names.]
Description []