Commit 215d62f4 by Alan Mishchenko

New hierarchy manager.

parent fffd733f
...@@ -1337,7 +1337,11 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) ...@@ -1337,7 +1337,11 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot )
// select network // select network
if ( pModelName ) if ( pModelName )
{
pNtk = Au_ManFindNtkP( pMan, pModelName ); pNtk = Au_ManFindNtkP( pMan, pModelName );
if ( pNtk == NULL )
printf( "Could not find module \"%s\".\n", pModelName );
}
if ( pNtk == NULL ) if ( pNtk == NULL )
pNtk = (Au_Ntk_t *)pRoot->pData; pNtk = (Au_Ntk_t *)pRoot->pData;
...@@ -1376,13 +1380,11 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) ...@@ -1376,13 +1380,11 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, int fVerbose ) Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, char * pModelName, int fVerbose )
{ {
// char * pModelName = NULL;
char * pModelName = "path_0_r_x_lhs";
Gia_Man_t * pGia = NULL; Gia_Man_t * pGia = NULL;
Au_Ntk_t * pNtk, * pNtkClp = NULL; Au_Ntk_t * pNtk, * pNtkClp = NULL;
int clk1 = 0, clk2 = 0, clk3 = 0, clk = clock(); int clk1 = 0, clk = clock();
// read hierarchical netlist // read hierarchical netlist
pNtk = Au_NtkParseCBlif( pFileName ); pNtk = Au_NtkParseCBlif( pFileName );
...@@ -1411,22 +1413,17 @@ Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, int fVerbose ) ...@@ -1411,22 +1413,17 @@ Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, int fVerbose )
if ( pNtkClp == NULL ) if ( pNtkClp == NULL )
pNtkClp = pNtk; pNtkClp = pNtk;
// check if the model is recursive
Au_NtkCheckRecursive( pNtkClp );
if ( !Au_NtkCheckRecursive(pNtkClp) ); // COMMA!!! // collapse
{
clk1 = clock();
pGia = Au_NtkDeriveFlatGia( pNtkClp );
clk3 = clock() - clk1;
}
clk1 = clock(); clk1 = clock();
pGia = Au_NtkDeriveFlatGia( pNtkClp );
Abc_PrintTime( 1, "Time GIA ", clock() - clk1 );
// delete
Au_ManDelete( pNtk->pMan ); Au_ManDelete( pNtk->pMan );
clk2 += clock() - clk1;
Abc_PrintTime( 1, "Time all ", clock() - clk ); Abc_PrintTime( 1, "Time all ", clock() - clk );
Abc_PrintTime( 1, "Time new ", clk2 );
Abc_PrintTime( 1, "Time GIA ", clk3 );
return pGia; return pGia;
} }
......
...@@ -24567,18 +24567,28 @@ usage: ...@@ -24567,18 +24567,28 @@ usage:
***********************************************************************/ ***********************************************************************/
int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
extern Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, int fVerbose ); extern Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, char * pModelName, int fVerbose );
Gia_Man_t * pAig; Gia_Man_t * pAig;
FILE * pFile; FILE * pFile;
char ** pArgvNew; char ** pArgvNew;
char * FileName, * pTemp; char * FileName, * pTemp;
char * pModelName = NULL;
int nArgcNew; int nArgcNew;
int c, fVerbose = 0; int c, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
case 'M':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-M\" should be followed by a file name.\n" );
goto usage;
}
pModelName = argv[globalUtilOptind];
globalUtilOptind++;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -24610,13 +24620,14 @@ int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -24610,13 +24620,14 @@ int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
} }
fclose( pFile ); fclose( pFile );
pAig = Abc_NtkHieCecTest2( FileName, fVerbose ); pAig = Abc_NtkHieCecTest2( FileName, pModelName, fVerbose );
Abc_CommandUpdate9( pAbc, pAig ); Abc_CommandUpdate9( pAbc, pAig );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: &read_cblif [-vh] <file>\n" ); Abc_Print( -2, "usage: &read_cblif [-M name] [-vh] <file>\n" );
Abc_Print( -2, "\t reads the current AIG from a hierarchical CBLIF file\n" ); Abc_Print( -2, "\t reads CBLIF file and collapse it into an AIG\n" );
Abc_Print( -2, "\t-M name: module name to collapse [default = <root_module>]\n" );
Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
Abc_Print( -2, "\t<file> : the file name\n"); Abc_Print( -2, "\t<file> : the file name\n");
......
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