diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-07-06 20:41:11 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-07-06 20:41:11 -0700 |
commit | 5008b1a4f3052402c47d954756e750db55743c11 (patch) | |
tree | 275701e5ecb6c7c60142352f2ec8e5f4bc9b77ad /src/base | |
parent | e879f0f6d1dde4ab92deec299998ec6a95baf1cd (diff) | |
download | abc-5008b1a4f3052402c47d954756e750db55743c11.tar.gz abc-5008b1a4f3052402c47d954756e750db55743c11.tar.bz2 abc-5008b1a4f3052402c47d954756e750db55743c11.zip |
Commands &fla_gla/&gla_fla to convert between flop-level and gate-level abstraction.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abci/abc.c | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 5fdf5ace..5e74a943 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -353,6 +353,8 @@ static int Abc_CommandAbc9Gla ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Vta ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Vta2Gla ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Gla2Vta ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9Fla2Gla ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9Gla2Fla ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Reparam ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9BackReach ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Posplit ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -799,6 +801,8 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&vta", Abc_CommandAbc9Vta, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&vta_gla", Abc_CommandAbc9Vta2Gla, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&gla_vta", Abc_CommandAbc9Gla2Vta, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&fla_gla", Abc_CommandAbc9Fla2Gla, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&gla_fla", Abc_CommandAbc9Gla2Fla, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&reparam", Abc_CommandAbc9Reparam, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&back_reach", Abc_CommandAbc9BackReach, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&posplit", Abc_CommandAbc9Posplit, 0 ); @@ -27862,6 +27866,108 @@ usage: SeeAlso [] ***********************************************************************/ +int Abc_CommandAbc9Fla2Gla( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + int c, fVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) + { + switch ( c ) + { + case 'v': + fVerbose ^= 1; + break; + case 'h': + goto usage; + default: + goto usage; + } + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Fla2Gla(): There is no AIG.\n" ); + return 1; + } + if ( pAbc->pGia->vFlopClasses == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Fla2Gla(): There is no gate-level abstraction is defined.\n" ); + return 1; + } + Vec_IntFreeP( &pAbc->pGia->vGateClasses ); + pAbc->pGia->vGateClasses = Gia_FlaConvertToGla( pAbc->pGia, pAbc->pGia->vFlopClasses ); + Vec_IntFreeP( &pAbc->pGia->vFlopClasses ); + return 0; + +usage: + Abc_Print( -2, "usage: &fla_gla [-vh]\n" ); + Abc_Print( -2, "\t maps flop-level into gate-level abstraction\n" ); + Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_CommandAbc9Gla2Fla( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + int c, fVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) + { + switch ( c ) + { + case 'v': + fVerbose ^= 1; + break; + case 'h': + goto usage; + default: + goto usage; + } + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Gla2Fla(): There is no AIG.\n" ); + return 1; + } + if ( pAbc->pGia->vGateClasses == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Gla2Fla(): There is no gate-level abstraction is defined.\n" ); + return 1; + } + Vec_IntFreeP( &pAbc->pGia->vFlopClasses ); + pAbc->pGia->vFlopClasses = Gia_GlaConvertToFla( pAbc->pGia, pAbc->pGia->vGateClasses ); + Vec_IntFreeP( &pAbc->pGia->vGateClasses ); + return 0; + +usage: + Abc_Print( -2, "usage: &gla_fla [-vh]\n" ); + Abc_Print( -2, "\t maps gate-level into flop-level abstraction\n" ); + Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int Abc_CommandAbc9Reparam( Abc_Frame_t * pAbc, int argc, char ** argv ) { Gia_Man_t * pTemp = NULL; |