summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abc.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-09-21 10:22:40 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2021-09-21 10:22:40 -0700
commit1e69e7e7d101cca19dcdca6b61d7ca9a1237283c (patch)
treea8f8330a1978e531bac80ebf96c519db7d0227a7 /src/base/abci/abc.c
parenta36325609845c7114541dd23ccb7dae3137f3fd4 (diff)
downloadabc-1e69e7e7d101cca19dcdca6b61d7ca9a1237283c.tar.gz
abc-1e69e7e7d101cca19dcdca6b61d7ca9a1237283c.tar.bz2
abc-1e69e7e7d101cca19dcdca6b61d7ca9a1237283c.zip
Adding command &reshape.
Diffstat (limited to 'src/base/abci/abc.c')
-rw-r--r--src/base/abci/abc.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 50edfcbf..8ff96d99 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -445,6 +445,7 @@ static int Abc_CommandAbc9Extract ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Balance ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9BalanceLut ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Resub ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Reshape ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Syn2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Syn3 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Syn4 ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -1186,6 +1187,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&b", Abc_CommandAbc9Balance, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&blut", Abc_CommandAbc9BalanceLut, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&resub", Abc_CommandAbc9Resub, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&reshape", Abc_CommandAbc9Reshape, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&syn2", Abc_CommandAbc9Syn2, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&syn3", Abc_CommandAbc9Syn3, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&syn4", Abc_CommandAbc9Syn4, 0 );
@@ -35494,6 +35496,67 @@ usage:
SeeAlso []
***********************************************************************/
+int Abc_CommandAbc9Reshape( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern Gia_Man_t * Gia_ManReshape1( Gia_Man_t * pGia, int fVerbose, int fVeryVerbose );
+ extern Gia_Man_t * Gia_ManReshape2( Gia_Man_t * pGia, int fVerbose, int fVeryVerbose );
+ Gia_Man_t * pTemp;
+ int fUseReshape1 = 0;
+ int c, fVerbose = 0;
+ int fVeryVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "avwh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'a':
+ fUseReshape1 ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'w':
+ fVeryVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Resub(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( fUseReshape1 )
+ pTemp = Gia_ManReshape1( pAbc->pGia, fVerbose, fVeryVerbose );
+ else
+ pTemp = Gia_ManReshape2( pAbc->pGia, fVerbose, fVeryVerbose );
+ Abc_FrameUpdateGia( pAbc, pTemp );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &reshape [-avwh]\n" );
+ Abc_Print( -2, "\t performs AIG resubstitution\n" );
+ Abc_Print( -2, "\t-a : toggles selecting the algorithm [default = %s]\n", fUseReshape1? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggles printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Gia_Man_t * pTemp;