diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-19 17:18:11 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-19 17:18:11 -0800 |
commit | 215d62f41f5afee3be1c46819ad05f9997356f46 (patch) | |
tree | 77f01d7b374ee23f5a64fe81eee9a138d0cb35e3 | |
parent | fffd733f948622f39bacd2545100dd799f5a3140 (diff) | |
download | abc-215d62f41f5afee3be1c46819ad05f9997356f46.tar.gz abc-215d62f41f5afee3be1c46819ad05f9997356f46.tar.bz2 abc-215d62f41f5afee3be1c46819ad05f9997356f46.zip |
New hierarchy manager.
-rw-r--r-- | src/base/abc/abcHieNew.c | 29 | ||||
-rw-r--r-- | src/base/abci/abc.c | 21 |
2 files changed, 29 insertions, 21 deletions
diff --git a/src/base/abc/abcHieNew.c b/src/base/abc/abcHieNew.c index 5eaedfaa..9a18f104 100644 --- a/src/base/abc/abcHieNew.c +++ b/src/base/abc/abcHieNew.c @@ -1337,7 +1337,11 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) // select network if ( pModelName ) + { pNtk = Au_ManFindNtkP( pMan, pModelName ); + if ( pNtk == NULL ) + printf( "Could not find module \"%s\".\n", pModelName ); + } if ( pNtk == NULL ) pNtk = (Au_Ntk_t *)pRoot->pData; @@ -1376,13 +1380,11 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) 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; Au_Ntk_t * pNtk, * pNtkClp = NULL; - int clk1 = 0, clk2 = 0, clk3 = 0, clk = clock(); + int clk1 = 0, clk = clock(); // read hierarchical netlist pNtk = Au_NtkParseCBlif( pFileName ); @@ -1411,22 +1413,17 @@ Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, int fVerbose ) if ( pNtkClp == NULL ) pNtkClp = pNtk; + // check if the model is recursive + Au_NtkCheckRecursive( pNtkClp ); - if ( !Au_NtkCheckRecursive(pNtkClp) ); // COMMA!!! - - { - clk1 = clock(); - pGia = Au_NtkDeriveFlatGia( pNtkClp ); - clk3 = clock() - clk1; - } - + // collapse clk1 = clock(); + pGia = Au_NtkDeriveFlatGia( pNtkClp ); + Abc_PrintTime( 1, "Time GIA ", clock() - clk1 ); + + // delete Au_ManDelete( pNtk->pMan ); - clk2 += clock() - clk1; - Abc_PrintTime( 1, "Time all ", clock() - clk ); - Abc_PrintTime( 1, "Time new ", clk2 ); - Abc_PrintTime( 1, "Time GIA ", clk3 ); return pGia; } diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 88d57e40..6022a540 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -24567,18 +24567,28 @@ usage: ***********************************************************************/ 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; FILE * pFile; char ** pArgvNew; char * FileName, * pTemp; + char * pModelName = NULL; int nArgcNew; int c, fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF ) { 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': fVerbose ^= 1; break; @@ -24610,13 +24620,14 @@ int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv ) } fclose( pFile ); - pAig = Abc_NtkHieCecTest2( FileName, fVerbose ); + pAig = Abc_NtkHieCecTest2( FileName, pModelName, fVerbose ); Abc_CommandUpdate9( pAbc, pAig ); return 0; usage: - Abc_Print( -2, "usage: &read_cblif [-vh] <file>\n" ); - Abc_Print( -2, "\t reads the current AIG from a hierarchical CBLIF file\n" ); + Abc_Print( -2, "usage: &read_cblif [-M name] [-vh] <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-h : print the command usage\n"); Abc_Print( -2, "\t<file> : the file name\n"); |