Skip to content

Commit 1f13c88

Browse files
committed
Creating commands to match popular scripts.
1 parent 291e0a2 commit 1f13c88

File tree

3 files changed

+424
-2
lines changed

3 files changed

+424
-2
lines changed

src/base/abci/abc.c

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ static int Abc_CommandAbc9Times ( Abc_Frame_t * pAbc, int argc, cha
468468
static int Abc_CommandAbc9Frames ( Abc_Frame_t * pAbc, int argc, char ** argv );
469469
static int Abc_CommandAbc9Retime ( Abc_Frame_t * pAbc, int argc, char ** argv );
470470
static int Abc_CommandAbc9Enable ( Abc_Frame_t * pAbc, int argc, char ** argv );
471+
static int Abc_CommandAbc9Resyn3 ( Abc_Frame_t * pAbc, int argc, char ** argv );
472+
static int Abc_CommandAbc9Resyn3rs ( Abc_Frame_t * pAbc, int argc, char ** argv );
473+
static int Abc_CommandAbc9Compress3rs ( Abc_Frame_t * pAbc, int argc, char ** argv );
471474
static int Abc_CommandAbc9Dc2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
472475
static int Abc_CommandAbc9Dsd ( Abc_Frame_t * pAbc, int argc, char ** argv );
473476
static int Abc_CommandAbc9Bidec ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -1299,6 +1302,9 @@ void Abc_Init( Abc_Frame_t * pAbc )
12991302
Cmd_CommandAdd( pAbc, "ABC9", "&frames", Abc_CommandAbc9Frames, 0 );
13001303
Cmd_CommandAdd( pAbc, "ABC9", "&retime", Abc_CommandAbc9Retime, 0 );
13011304
Cmd_CommandAdd( pAbc, "ABC9", "&enable", Abc_CommandAbc9Enable, 0 );
1305+
Cmd_CommandAdd( pAbc, "ABC9", "&resyn3", Abc_CommandAbc9Resyn3, 0 );
1306+
Cmd_CommandAdd( pAbc, "ABC9", "&resyn3rs", Abc_CommandAbc9Resyn3rs, 0 );
1307+
Cmd_CommandAdd( pAbc, "ABC9", "&compress3rs", Abc_CommandAbc9Compress3rs, 0 );
13021308
Cmd_CommandAdd( pAbc, "ABC9", "&dc2", Abc_CommandAbc9Dc2, 0 );
13031309
Cmd_CommandAdd( pAbc, "ABC9", "&dsd", Abc_CommandAbc9Dsd, 0 );
13041310
Cmd_CommandAdd( pAbc, "ABC9", "&bidec", Abc_CommandAbc9Bidec, 0 );
@@ -39197,6 +39203,147 @@ int Abc_CommandAbc9Enable( Abc_Frame_t * pAbc, int argc, char ** argv )
3919739203
return 1;
3919839204
}
3919939205

39206+
/**Function*************************************************************
39207+
39208+
Synopsis []
39209+
39210+
Description []
39211+
39212+
SideEffects []
39213+
39214+
SeeAlso []
39215+
39216+
***********************************************************************/
39217+
int Abc_CommandAbc9Resyn3( Abc_Frame_t * pAbc, int argc, char ** argv )
39218+
{
39219+
extern Gia_Man_t * Gia_ManResyn3( Gia_Man_t * pGia, int fVerbose );
39220+
Gia_Man_t * pTemp;
39221+
int c, fVerbose = 0;
39222+
Extra_UtilGetoptReset();
39223+
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
39224+
{
39225+
switch ( c )
39226+
{
39227+
case 'v':
39228+
fVerbose ^= 1;
39229+
break;
39230+
case 'h':
39231+
goto usage;
39232+
default:
39233+
goto usage;
39234+
}
39235+
}
39236+
if ( pAbc->pGia == NULL )
39237+
{
39238+
Abc_Print( -1, "Abc_CommandAbc9Resyn3(): There is no AIG.\n" );
39239+
return 1;
39240+
}
39241+
pTemp = Gia_ManResyn3( pAbc->pGia, fVerbose );
39242+
Abc_FrameUpdateGia( pAbc, pTemp );
39243+
return 0;
39244+
39245+
usage:
39246+
Abc_Print( -2, "usage: &resyn3 [-vh]\n" );
39247+
Abc_Print( -2, "\t performs rewriting of the AIG while preserving logic level\n" );
39248+
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
39249+
Abc_Print( -2, "\t-h : print the command usage\n");
39250+
return 1;
39251+
}
39252+
39253+
/**Function*************************************************************
39254+
39255+
Synopsis []
39256+
39257+
Description []
39258+
39259+
SideEffects []
39260+
39261+
SeeAlso []
39262+
39263+
***********************************************************************/
39264+
int Abc_CommandAbc9Resyn3rs( Abc_Frame_t * pAbc, int argc, char ** argv )
39265+
{
39266+
extern Gia_Man_t * Gia_ManCompress3rs( Gia_Man_t * pGia, int fUpdateLevel, int fVerbose );
39267+
Gia_Man_t * pTemp;
39268+
int c, fVerbose = 0;
39269+
Extra_UtilGetoptReset();
39270+
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
39271+
{
39272+
switch ( c )
39273+
{
39274+
case 'v':
39275+
fVerbose ^= 1;
39276+
break;
39277+
case 'h':
39278+
goto usage;
39279+
default:
39280+
goto usage;
39281+
}
39282+
}
39283+
if ( pAbc->pGia == NULL )
39284+
{
39285+
Abc_Print( -1, "Abc_CommandAbc9Resyn3rs(): There is no AIG.\n" );
39286+
return 1;
39287+
}
39288+
pTemp = Gia_ManCompress3rs( pAbc->pGia, 1, fVerbose );
39289+
Abc_FrameUpdateGia( pAbc, pTemp );
39290+
return 0;
39291+
39292+
usage:
39293+
Abc_Print( -2, "usage: &resyn3rs [-vh]\n" );
39294+
Abc_Print( -2, "\t performs rewriting of the AIG while preserving logic level\n" );
39295+
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
39296+
Abc_Print( -2, "\t-h : print the command usage\n");
39297+
return 1;
39298+
}
39299+
39300+
/**Function*************************************************************
39301+
39302+
Synopsis []
39303+
39304+
Description []
39305+
39306+
SideEffects []
39307+
39308+
SeeAlso []
39309+
39310+
***********************************************************************/
39311+
int Abc_CommandAbc9Compress3rs( Abc_Frame_t * pAbc, int argc, char ** argv )
39312+
{
39313+
extern Gia_Man_t * Gia_ManCompress3rs( Gia_Man_t * pGia, int fUpdateLevel, int fVerbose );
39314+
Gia_Man_t * pTemp;
39315+
int c, fVerbose = 0;
39316+
Extra_UtilGetoptReset();
39317+
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
39318+
{
39319+
switch ( c )
39320+
{
39321+
case 'v':
39322+
fVerbose ^= 1;
39323+
break;
39324+
case 'h':
39325+
goto usage;
39326+
default:
39327+
goto usage;
39328+
}
39329+
}
39330+
if ( pAbc->pGia == NULL )
39331+
{
39332+
Abc_Print( -1, "Abc_CommandAbc9Compress3rs(): There is no AIG.\n" );
39333+
return 1;
39334+
}
39335+
pTemp = Gia_ManCompress3rs( pAbc->pGia, 0, fVerbose );
39336+
Abc_FrameUpdateGia( pAbc, pTemp );
39337+
return 0;
39338+
39339+
usage:
39340+
Abc_Print( -2, "usage: &compress3rs [-vh]\n" );
39341+
Abc_Print( -2, "\t performs rewriting of the AIG without preserving logic level\n" );
39342+
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
39343+
Abc_Print( -2, "\t-h : print the command usage\n");
39344+
return 1;
39345+
}
39346+
3920039347
/**Function*************************************************************
3920139348

3920239349
Synopsis []

src/base/abci/abcDar.c

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,45 @@ Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan )
662662
}
663663

664664

665+
/**Function*************************************************************
666+
667+
Synopsis []
668+
669+
Description []
670+
671+
SideEffects []
672+
673+
SeeAlso []
674+
675+
***********************************************************************/
676+
Aig_Man_t * Dar_ManResub( Aig_Man_t * pMan, int nCutsMax, int nNodesMax, int fUpdateLevel, int fUseZeros, int fVerbose )
677+
{
678+
extern int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nMinSaved, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose, int Log2Probs, int Log2Divs );
679+
Abc_Ntk_t * pNtk = Abc_NtkFromAigPhase( pMan );
680+
Aig_Man_t * pRes = NULL;
681+
char * pName = NULL, * pSpec = NULL;
682+
int nMinSaved = fUseZeros ? 0 : 1;
683+
if ( pMan->pName )
684+
pName = Abc_UtilStrsav( pMan->pName );
685+
if ( pMan->pSpec )
686+
pSpec = Abc_UtilStrsav( pMan->pSpec );
687+
if ( pName )
688+
{
689+
ABC_FREE( pNtk->pName );
690+
pNtk->pName = pName;
691+
}
692+
if ( pSpec )
693+
{
694+
ABC_FREE( pNtk->pSpec );
695+
pNtk->pSpec = pSpec;
696+
}
697+
if ( !Abc_NtkResubstitute( pNtk, nCutsMax, nNodesMax, nMinSaved, 0, fUpdateLevel, fVerbose, 0, 0, 0 ) )
698+
Abc_Print( 0, "Dar_ManResub(): Resubstitution has failed.\n" );
699+
pRes = Abc_NtkToDar( pNtk, 0, 1 );
700+
Abc_NtkDelete( pNtk );
701+
return pRes;
702+
}
703+
665704
/**Function*************************************************************
666705
667706
Synopsis []
@@ -5181,4 +5220,3 @@ Gia_Man_t * Abc_NtkDarTestFiles()
51815220

51825221
#include "abcDarUnfold2.c"
51835222
ABC_NAMESPACE_IMPL_END
5184-

0 commit comments

Comments
 (0)