diff options
author | Yen-Sheng Ho <ysho@berkeley.edu> | 2017-06-06 23:16:55 -0700 |
---|---|---|
committer | Yen-Sheng Ho <ysho@berkeley.edu> | 2017-06-06 23:16:55 -0700 |
commit | 584e28e8f4f8beb70e577c38719f8e7b532123e1 (patch) | |
tree | d8a78ae811e2a1cd14f88518d574e90a58d0aed2 /src/base/abci/abc.c | |
parent | 10f5e944c99626d5f8e68aa874e43462569cabf7 (diff) | |
parent | e140ef7e5a45b23823bdf1189070573439966ac8 (diff) | |
download | abc-584e28e8f4f8beb70e577c38719f8e7b532123e1.tar.gz abc-584e28e8f4f8beb70e577c38719f8e7b532123e1.tar.bz2 abc-584e28e8f4f8beb70e577c38719f8e7b532123e1.zip |
merge
Diffstat (limited to 'src/base/abci/abc.c')
-rw-r--r-- | src/base/abci/abc.c | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index f9f2f2e0..7055bf59 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -124,6 +124,7 @@ static int Abc_CommandMfs ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandMfs2 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandMfs3 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandMfse ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandLogicPush ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandTrace ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandGlitch ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandSpeedup ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -781,6 +782,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "Synthesis", "mfs2", Abc_CommandMfs2, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "mfs3", Abc_CommandMfs3, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "mfse", Abc_CommandMfse, 1 ); + Cmd_CommandAdd( pAbc, "Synthesis", "logicpush", Abc_CommandLogicPush, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "trace", Abc_CommandTrace, 0 ); Cmd_CommandAdd( pAbc, "Synthesis", "glitch", Abc_CommandGlitch, 0 ); Cmd_CommandAdd( pAbc, "Synthesis", "speedup", Abc_CommandSpeedup, 1 ); @@ -4151,7 +4153,7 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Empty network.\n" ); return 1; } - if ( Abc_NtkNodeNum(pNtk) == 0 ) + if ( Abc_NtkNodeNum(pNtk) == 0 || Abc_NtkPiNum(pNtk) == 0 ) { Abc_Print( -1, "The network does not have internal nodes.\n" ); return 1; @@ -5807,6 +5809,74 @@ usage: return 1; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_CommandLogicPush( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern Abc_Ntk_t * Abc_NtkOptPush( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose ); + Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); + Abc_Ntk_t * pNtkRes; + int nLutSize = 4; + int fVerbose = 0; + int c; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF ) + { + switch ( c ) + { + case 'K': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" ); + goto usage; + } + nLutSize = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nLutSize < 0 ) + goto usage; + break; + case 'v': + fVerbose ^= 1; + break; + case 'h': + goto usage; + default: + goto usage; + } + } + if ( pNtk == NULL ) + { + Abc_Print( -1, "Empty network.\n" ); + return 1; + } + if ( !Abc_NtkIsLogic(pNtk) ) + { + Abc_Print( -1, "This command can only be applied to a logic network.\n" ); + return 1; + } + nLutSize = Abc_MaxInt( nLutSize, Abc_NtkGetFaninMax(pNtk) ); + Abc_NtkToSop( pNtk, -1, ABC_INFINITY ); + pNtkRes = Abc_NtkOptPush( pNtk, nLutSize, fVerbose ); + Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes ); + return 0; +usage: + Abc_Print( -2, "usage: logicpush [-K num] [-vh]\n" ); + Abc_Print( -2, "\t performs logic pushing to reduce structural bias\n" ); + Abc_Print( -2, "\t-K <num> : the LUT size used in the mapping [default = %d]\n", nLutSize ); + Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + /**Function************************************************************* @@ -18315,7 +18385,7 @@ int Abc_CommandDsdFilter( Abc_Frame_t * pAbc, int argc, char ** argv ) if ( fInvMarks ) If_DsdManInvertMarks( pDsd, fVerbose ); #ifdef ABC_USE_CUDD - else + else if ( nLimit == 0 ) Id_DsdManTuneThresh( pDsd, fUnate, fThresh, fThreshHeuristic, fVerbose ); #endif return 0; |