diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-06-05 19:15:40 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-06-05 19:15:40 -0700 |
commit | 8a341c200f15988ee37f283924342553029deea6 (patch) | |
tree | 6dbbd4d5842913b1c58f1b406aa63446cadd43b7 | |
parent | 78e09e91197a97cd22f63ad612d5900cd5e02a8b (diff) | |
download | abc-8a341c200f15988ee37f283924342553029deea6.tar.gz abc-8a341c200f15988ee37f283924342553029deea6.tar.bz2 abc-8a341c200f15988ee37f283924342553029deea6.zip |
Adding a feature to collapse hierarhical AIGs.
-rw-r--r-- | src/aig/gia/giaIf.c | 7 | ||||
-rw-r--r-- | src/base/abci/abc.c | 21 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index 4b6095e5..a1541da7 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -1618,7 +1618,12 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized ) } // compute switching for the IF objects if ( pPars->fPower ) - If_ManComputeSwitching( pIfMan ); + { + if ( p->pManTime == NULL ) + If_ManComputeSwitching( pIfMan ); + else + Abc_Print( 0, "Switching activity computation for designs with boxes is disabled.\n" ); + } if ( p->pManTime ) pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, 0 ); if ( !If_ManPerformMapping( pIfMan ) ) diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 05a03aca..812e1820 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -25614,16 +25614,19 @@ usage: int Abc_CommandAbc9Hash( Abc_Frame_t * pAbc, int argc, char ** argv ) { Gia_Man_t * pTemp; - int c; + int c, fCollapse = 0; int fAddStrash = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "ach" ) ) != EOF ) { switch ( c ) { case 'a': fAddStrash ^= 1; break; + case 'c': + fCollapse ^= 1; + break; case 'h': goto usage; default: @@ -25635,14 +25638,24 @@ int Abc_CommandAbc9Hash( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Abc_CommandAbc9Hash(): There is no AIG.\n" ); return 1; } - pTemp = Gia_ManRehash( pAbc->pGia, fAddStrash ); + if ( fCollapse && pAbc->pGia->pAigExtra ) + { + Gia_Man_t * pNew = Gia_ManDupUnnormalize( pAbc->pGia ); + pNew->pManTime = pAbc->pGia->pManTime; + pTemp = Gia_ManDupCollapse( pNew, pAbc->pGia->pAigExtra, NULL ); + pNew->pManTime = NULL; + Gia_ManStop( pNew ); + } + else + pTemp = Gia_ManRehash( pAbc->pGia, fAddStrash ); Abc_FrameUpdateGia( pAbc, pTemp ); return 0; usage: - Abc_Print( -2, "usage: &st [-ah]\n" ); + Abc_Print( -2, "usage: &st [-ach]\n" ); Abc_Print( -2, "\t performs structural hashing\n" ); Abc_Print( -2, "\t-a : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" ); + Abc_Print( -2, "\t-c : toggle collapsing hierarchical AIG [default = %s]\n", fCollapse? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); return 1; } |