Commit db7852bb by Alan Mishchenko

Improvements to LMS code.

parent 3f7f4973
......@@ -890,10 +890,10 @@ extern float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames,
/*=== giaTruth.c ===========================================================*/
extern word Gia_ObjComputeTruthTable6( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vSupp, Vec_Wrd_t * vTruths );
extern int Gia_ObjCollectInternal( Gia_Man_t * p, Gia_Obj_t * pObj );
extern unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj );
extern word * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj );
extern void Gia_ObjComputeTruthTableStart( Gia_Man_t * p, int nVarsMax );
extern void Gia_ObjComputeTruthTableStop( Gia_Man_t * p );
extern unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vLeaves );
extern word * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vLeaves );
/*=== giaTsim.c ============================================================*/
extern Gia_Man_t * Gia_ManReduceConst( Gia_Man_t * pAig, int fVerbose );
/*=== giaUtil.c ===========================================================*/
......@@ -932,6 +932,7 @@ extern int Gia_ManMarkDangling( Gia_Man_t * p );
extern Vec_Int_t * Gia_ManGetDangling( Gia_Man_t * p );
extern void Gia_ObjPrint( Gia_Man_t * p, Gia_Obj_t * pObj );
extern void Gia_ManPrint( Gia_Man_t * p );
extern void Gia_ManPrintCo( Gia_Man_t * p, Gia_Obj_t * pObj );
extern void Gia_ManInvertConstraints( Gia_Man_t * pAig );
extern int Gia_ManCompare( Gia_Man_t * p1, Gia_Man_t * p2 );
extern void Gia_ManMarkFanoutDrivers( Gia_Man_t * p );
......
......@@ -141,7 +141,7 @@ int Gia_ObjCollectInternal( Gia_Man_t * p, Gia_Obj_t * pObj )
SeeAlso []
***********************************************************************/
unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
word * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
{
Gia_Obj_t * pTemp, * pRoot;
word * pTruth, * pTruthL, * pTruth0, * pTruth1;
......@@ -205,7 +205,7 @@ unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
pTruth = Gla_ObjTruthNode( p, pRoot );
else
pTruth = NULL;
return (unsigned *)Gla_ObjTruthDup( p, Gla_ObjTruthFree2(p), pTruth, Gia_ObjIsCo(pObj) && Gia_ObjFaninC0(pObj) );
return Gla_ObjTruthDup( p, Gla_ObjTruthFree2(p), pTruth, Gia_ObjIsCo(pObj) && Gia_ObjFaninC0(pObj) );
}
/**Function*************************************************************
......@@ -227,7 +227,7 @@ void Gia_ObjComputeTruthTableTest( Gia_Man_t * p )
int i;
Gia_ManForEachPo( p, pObj, i )
{
pTruth = Gia_ObjComputeTruthTable( p, pObj );
pTruth = (unsigned *)Gia_ObjComputeTruthTable( p, pObj );
// Extra_PrintHex( stdout, pTruth, Gia_ManPiNum(p) ); printf( "\n" );
}
Abc_PrintTime( 1, "Time", clock() - clk );
......@@ -316,7 +316,7 @@ void Gia_ObjComputeTruthTableStop( Gia_Man_t * p )
SeeAlso []
***********************************************************************/
unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vLeaves )
word * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vLeaves )
{
Gia_Obj_t * pTemp;
word * pTruth, * pTruthL, * pTruth0, * pTruth1;
......@@ -358,7 +358,7 @@ unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_In
assert( pTemp->fMark0 == 1 );
pTemp->fMark0 = 0;
}
return (unsigned *)Gla_ObjTruthNode( p, pRoot );
return Gla_ObjTruthNode( p, pRoot );
}
////////////////////////////////////////////////////////////////////////
......
......@@ -1109,6 +1109,22 @@ void Gia_ManPrint( Gia_Man_t * p )
Gia_ManForEachObj( p, pObj, i )
Gia_ObjPrint( p, pObj );
}
void Gia_ManPrintCo_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
{
if ( Gia_ObjIsAnd(pObj) )
{
Gia_ManPrintCo_rec( p, Gia_ObjFanin0(pObj) );
Gia_ManPrintCo_rec( p, Gia_ObjFanin1(pObj) );
}
Gia_ObjPrint( p, pObj );
}
void Gia_ManPrintCo( Gia_Man_t * p, Gia_Obj_t * pObj )
{
assert( Gia_ObjIsCo(pObj) );
printf( "TFI cone of CO number %d:\n", Gia_ObjCioId(pObj) );
Gia_ManPrintCo_rec( p, Gia_ObjFanin0(pObj) );
Gia_ObjPrint( p, pObj );
}
/**Function*************************************************************
......
......@@ -1107,7 +1107,7 @@ void Abc_NtkRecStart2( Gia_Man_t * pGia, int nVars, int nCuts, int fTrim )
clk = clock();
// Gia_ManForEachPo( pGia, pObj, i )
// {
// pTruthSrc = Gia_ObjComputeTruthTable(pGia, pObj);
// pTruthSrc = (unsigned *)Gia_ObjComputeTruthTable(pGia, pObj);
// // pTruthDst = (unsigned *)Vec_PtrEntry( p->vTtNodes, Gia_ObjCioId(pObj) );
// // Kit_TruthCopy(pTruthDst, pTruthSrc, p->nVars);
// Rec_MemSetEntry( p, Gia_ObjCioId(pObj), pTruthSrc );
......@@ -1125,7 +1125,7 @@ timeInsert = clock();
assert(pFanin->fMark1 == 0);
pFanin->fMark1 = 1;
// pTruth = (unsigned *)Vec_PtrEntry( p->vTtNodes, Gia_ObjCioId(pObj) );
pTruth = Gia_ObjComputeTruthTable(pGia, pObj);
pTruth = (unsigned *)Gia_ObjComputeTruthTable(pGia, pObj);
//pTruth = Rec_MemReadEntry( p, Gia_ObjCioId(pObj) );
// add the resulting truth table to the hash table
......@@ -1569,7 +1569,7 @@ timeBuild = clock();
}
//assert(pObj);
pObj = Gia_ManObj(pAig, Abc_Lit2Var(iRecObj));
pTruth = Gia_ObjComputeTruthTable(pAig, pObj);
pTruth = (unsigned *)Gia_ObjComputeTruthTable(pAig, pObj);
s_pMan->timeBuild += clock() - timeBuild;
if ( Kit_TruthSupport(pTruth, nInputs) != Kit_BitMask(nLeaves) )
......@@ -2349,7 +2349,7 @@ void Abc_NtkRecAddFromLib2( Gia_Man_t * pGia2, Gia_Obj_t * pRoot, int nVars )
Gia_ObjSetCopyF(pGia2, 0, pAbcObj, Gia_ObjId(pGia,pObj));
}
assert(pObj);
pTruth = Gia_ObjComputeTruthTable(pGia, pObj);
pTruth = (unsigned *)Gia_ObjComputeTruthTable(pGia, pObj);
//pTruth = (unsigned *)Vec_PtrEntry( s_pMan->vTtNodes, Gia_ObjId(pGia, pObj) );
assert ( Kit_TruthSupport(pTruth, nInputs) == Kit_BitMask(nLeaves) );
// compare the truth tables
......
......@@ -2738,7 +2738,7 @@ int IoCommandWriteTruths( Abc_Frame_t * pAbc, int argc, char **argv )
Gia_Obj_t * pObj;
char * pFileName;
FILE * pFile;
unsigned * pTruth;
word * pTruth;
int nBytes;
int fReverse = 0;
int fBinary = 0;
......@@ -2794,7 +2794,7 @@ int IoCommandWriteTruths( Abc_Frame_t * pAbc, int argc, char **argv )
if ( fBinary )
fwrite( pTruth, nBytes, 1, pFile );
else
Extra_PrintHex( pFile, pTruth, Gia_ManPiNum(pAbc->pGia) ), fprintf( pFile, "\n" );
Extra_PrintHex( pFile, (unsigned *)pTruth, Gia_ManPiNum(pAbc->pGia) ), fprintf( pFile, "\n" );
}
fclose( pFile );
return 0;
......
......@@ -665,7 +665,7 @@ void Abs_RpmPerformMark( Gia_Man_t * p, int nCutMax, int fVerbose, int fVeryVerb
nSize0 = Abs_GiaSortNodes( p, vSupp );
assert( nSize0 > 0 && nSize0 <= nCutMax );
// check if truth table has const cofs
pTruth = (word *)Gia_ObjComputeTruthTableCut( p, pObj, vSupp );
pTruth = Gia_ObjComputeTruthTableCut( p, pObj, vSupp );
fHasConst = !Abs_GiaCheckTruth( pTruth, Vec_IntSize(vSupp), nSize0 );
if ( fVeryVerbose )
{
......
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