Commit 8a341c20 by Alan Mishchenko

Adding a feature to collapse hierarhical AIGs.

parent 78e09e91
...@@ -1618,7 +1618,12 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized ) ...@@ -1618,7 +1618,12 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
} }
// compute switching for the IF objects // compute switching for the IF objects
if ( pPars->fPower ) 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 ) if ( p->pManTime )
pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, 0 ); pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, 0 );
if ( !If_ManPerformMapping( pIfMan ) ) if ( !If_ManPerformMapping( pIfMan ) )
......
...@@ -25614,16 +25614,19 @@ usage: ...@@ -25614,16 +25614,19 @@ usage:
int Abc_CommandAbc9Hash( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandAbc9Hash( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
Gia_Man_t * pTemp; Gia_Man_t * pTemp;
int c; int c, fCollapse = 0;
int fAddStrash = 0; int fAddStrash = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "ach" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
case 'a': case 'a':
fAddStrash ^= 1; fAddStrash ^= 1;
break; break;
case 'c':
fCollapse ^= 1;
break;
case 'h': case 'h':
goto usage; goto usage;
default: default:
...@@ -25635,14 +25638,24 @@ int Abc_CommandAbc9Hash( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -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" ); Abc_Print( -1, "Abc_CommandAbc9Hash(): There is no AIG.\n" );
return 1; 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 ); Abc_FrameUpdateGia( pAbc, pTemp );
return 0; return 0;
usage: 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 performs structural hashing\n" );
Abc_Print( -2, "\t-a : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" ); 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"); Abc_Print( -2, "\t-h : print the command usage\n");
return 1; 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