Commit 22f36299 authored by Alan Mishchenko's avatar Alan Mishchenko

Added an option to keep PI/PO names unchanged in 'short_names'.

parent 2e92256f
......@@ -752,6 +752,7 @@ extern ABC_DLL void Abc_NtkAddDummyPiNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkAddDummyPoNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkAddDummyBoxNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkShortNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkCleanNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkStartNameIds( Abc_Ntk_t * p );
extern ABC_DLL void Abc_NtkTransferNameIds( Abc_Ntk_t * p, Abc_Ntk_t * pNew );
extern ABC_DLL void Abc_NtkUpdateNameIds( Abc_Ntk_t * p );
......
......@@ -606,6 +606,17 @@ void Abc_NtkShortNames( Abc_Ntk_t * pNtk )
Abc_NtkAddDummyPoNames( pNtk );
Abc_NtkAddDummyBoxNames( pNtk );
}
void Abc_NtkCleanNames( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj; int i;
Nm_Man_t * pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
Abc_NtkForEachCi( pNtk, pObj, i )
Nm_ManStoreIdName( pManName, pObj->Id, pObj->Type, Abc_ObjName(pObj), NULL );
Abc_NtkForEachCo( pNtk, pObj, i )
Nm_ManStoreIdName( pManName, pObj->Id, pObj->Type, Abc_ObjName(pObj), NULL );
Nm_ManFree( pNtk->pManName );
pNtk->pManName = pManName;
}
/**Function*************************************************************
......
......@@ -12196,13 +12196,16 @@ usage:
int Abc_CommandShortNames( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int c, fKeepIo = 0;
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "kh" ) ) != EOF )
{
switch ( c )
{
case 'k':
fKeepIo ^= 1;
break;
case 'h':
goto usage;
default:
......@@ -12215,12 +12218,16 @@ int Abc_CommandShortNames( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Empty network.\n" );
return 1;
}
Abc_NtkShortNames( pNtk );
if ( fKeepIo )
Abc_NtkCleanNames( pNtk );
else
Abc_NtkShortNames( pNtk );
return 0;
usage:
Abc_Print( -2, "usage: short_names [-h]\n" );
Abc_Print( -2, "usage: short_names [-kh]\n" );
Abc_Print( -2, "\t replaces PI/PO/latch names by short char strings\n" );
Abc_Print( -2, "\t-k : toggle keeping PI/PO names unchanged [default = %s]\n", fKeepIo? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment