Commit c73c37a9 by Alan Mishchenko

Improvements to LMS code.

parent 4e52703b
......@@ -482,6 +482,13 @@ static inline int Gia_ManAppendXor( Gia_Man_t * p, int iLit0, int iLit1 )
{
return Gia_ManAppendMux( p, iLit0, Abc_LitNot(iLit1), iLit1 );
}
static inline void Gia_ManPatchCoDriver( Gia_Man_t * p, int iCoIndex, int iLit0 )
{
Gia_Obj_t * pObjCo = Gia_ManCo( p, iCoIndex );
assert( Gia_ObjId(p, pObjCo) > Abc_Lit2Var(iLit0) );
pObjCo->iDiff0 = Gia_ObjId(p, pObjCo) - Abc_Lit2Var(iLit0);
pObjCo->fCompl0 = Abc_LitIsCompl(iLit0);
}
#define GIA_ZER 1
#define GIA_ONE 2
......@@ -863,6 +870,7 @@ extern int Sat_ManTest( Gia_Man_t * pGia, Gia_Obj_t * pObj, int
extern int Gia_ManSeqMarkUsed( Gia_Man_t * p );
extern int Gia_ManCombMarkUsed( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManCleanup( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManCleanupOutputs( Gia_Man_t * p, int nOutputs );
extern Gia_Man_t * Gia_ManSeqCleanup( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManSeqStructSweep( Gia_Man_t * p, int fConst, int fEquiv, int fVerbose );
/*=== giaShrink.c ===========================================================*/
......
......@@ -94,6 +94,32 @@ Gia_Man_t * Gia_ManCleanup( Gia_Man_t * p )
return Gia_ManDupMarked( p );
}
/**Function*************************************************************
Synopsis [Skip the first outputs during cleanup.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t * Gia_ManCleanupOutputs( Gia_Man_t * p, int nOutputs )
{
Gia_Obj_t * pObj;
int i;
assert( Gia_ManRegNum(p) == 0 );
assert( nOutputs < Gia_ManCoNum(p) );
Gia_ManCombMarkUsed( p );
Gia_ManForEachCo( p, pObj, i )
if ( i < nOutputs )
pObj->fMark0 = 1;
else
break;
return Gia_ManDupMarked( p );
}
/**Function*************************************************************
......
......@@ -789,7 +789,7 @@ extern ABC_DLL int Abc_NtkRecVarNum();
extern ABC_DLL Vec_Int_t * Abc_NtkRecMemory();
extern ABC_DLL int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTruth, int nVars );
/*=== abcRec2.c ==========================================================*/
extern ABC_DLL void Abc_NtkRecStart2( Gia_Man_t *p, int nVars, int nCuts, int fTrim );
extern ABC_DLL void Abc_NtkRecStart2( Gia_Man_t * p, int nVars, int nCuts, int fTrim );
extern ABC_DLL void Abc_NtkRecStop2();
extern ABC_DLL void Abc_NtkRecAdd2( Abc_Ntk_t * pNtk, int fUseSOPB );
extern ABC_DLL void Abc_NtkRecPs2(int fPrintLib);
......@@ -799,7 +799,7 @@ extern ABC_DLL int Abc_NtkRecIsRunning2();
extern ABC_DLL int Abc_NtkRecIsInTrimMode2();
extern ABC_DLL void Abc_NtkRecFilter2(int nLimit);
/*=== abcRec3.c ==========================================================*/
extern ABC_DLL void Abc_NtkRecStart3( Gia_Man_t *p, int nVars, int nCuts, int fTrim );
extern ABC_DLL void Abc_NtkRecStart3( Gia_Man_t * p, int nVars, int nCuts, int fFuncOnly, int fVerbose );
extern ABC_DLL void Abc_NtkRecStop3();
extern ABC_DLL void Abc_NtkRecAdd3( Abc_Ntk_t * pNtk, int fUseSOPB );
extern ABC_DLL void Abc_NtkRecPs3(int fPrintLib);
......
......@@ -13056,9 +13056,10 @@ int Abc_CommandRecStart3( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_Man_t * pGia = NULL;
int nVars = 6;
int nCuts = 32;
int fTrim = 0;
int fFuncOnly = 0;
int fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCth" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "KCfvh" ) ) != EOF )
{
switch ( c )
{
......@@ -13084,8 +13085,11 @@ int Abc_CommandRecStart3( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nCuts < 1 )
goto usage;
break;
case 't':
fTrim ^= 1;
case 'f':
fFuncOnly ^= 1;
break;
case 'v':
fVerbose ^= 1;
break;
case 'h':
goto usage;
......@@ -13131,16 +13135,17 @@ int Abc_CommandRecStart3( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
}
}
Abc_NtkRecStart3( pGia, nVars, nCuts, fTrim );
Abc_NtkRecStart3( pGia, nVars, nCuts, fFuncOnly, fVerbose );
return 0;
usage:
Abc_Print( -2, "usage: rec_start3 [-K num] [-C num] [-th]\n" );
Abc_Print( -2, "usage: rec_start3 [-K num] [-C num] [-fvh]\n" );
Abc_Print( -2, "\t starts recording AIG subgraphs (should be called for\n" );
Abc_Print( -2, "\t an empty network or after reading in a previous record)\n" );
Abc_Print( -2, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
Abc_Print( -2, "\t-t : toggles the use of trimming [default = %s]\n", fTrim? "yes": "no" );
Abc_Print( -2, "\t-f : toggles recording functions without AIG subgraphs [default = %s]\n", fFuncOnly? "yes": "no" );
Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
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