Commit 72f4dfff by Alan Mishchenko

Experiments with functional matching.

parent a1e9f668
...@@ -2527,6 +2527,10 @@ SOURCE=.\src\opt\sfm\sfmInt.h ...@@ -2527,6 +2527,10 @@ SOURCE=.\src\opt\sfm\sfmInt.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\opt\sfm\sfmLib.c
# End Source File
# Begin Source File
SOURCE=.\src\opt\sfm\sfmNtk.c SOURCE=.\src\opt\sfm\sfmNtk.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -10820,11 +10820,11 @@ int Abc_CommandTestColor( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -10820,11 +10820,11 @@ int Abc_CommandTestColor( Abc_Frame_t * pAbc, int argc, char ** argv )
***********************************************************************/ ***********************************************************************/
int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int nCutMax = 1; int nCutMax = 1;
int nLeafMax = 4; int nLeafMax = 4;
int nDivMax = 2; int nDivMax = 2;
int nDecMax = 20; int nDecMax = 70;
int nNumOnes = 4; int nNumOnes = 4;
int fNewAlgo = 0; int fNewAlgo = 0;
int fNewOrder = 0; int fNewOrder = 0;
...@@ -10909,13 +10909,13 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -10909,13 +10909,13 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage; goto usage;
} }
} }
/*
if ( pNtk == NULL ) if ( pNtk == NULL )
{ {
Abc_Print( -1, "Empty network.\n" ); Abc_Print( -1, "Empty network.\n" );
return 1; return 1;
} }
/*
if ( Abc_NtkIsStrash(pNtk) ) if ( Abc_NtkIsStrash(pNtk) )
{ {
Abc_Print( -1, "This command works only for logic networks.\n" ); Abc_Print( -1, "This command works only for logic networks.\n" );
...@@ -11029,9 +11029,11 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -11029,9 +11029,11 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
} }
{ {
extern void Tab_DecomposeTest(); extern void Tab_DecomposeTest();
extern void Sfm_DecTestBench( Abc_Ntk_t * pNtk, int iNode );
//Tab_DecomposeTest(); //Tab_DecomposeTest();
extern void Cnf_AddCardinConstrTest(); extern void Cnf_AddCardinConstrTest();
Cnf_AddCardinConstrTest(); //Cnf_AddCardinConstrTest();
Sfm_DecTestBench( pNtk, nDecMax );
} }
return 0; return 0;
usage: usage:
SRC += src/opt/sfm/sfmCnf.c \ SRC += src/opt/sfm/sfmCnf.c \
src/opt/sfm/sfmCore.c \ src/opt/sfm/sfmCore.c \
src/opt/sfm/sfmDec.c \ src/opt/sfm/sfmDec.c \
src/opt/sfm/sfmLib.c \
src/opt/sfm/sfmNtk.c \ src/opt/sfm/sfmNtk.c \
src/opt/sfm/sfmSat.c \ src/opt/sfm/sfmSat.c \
src/opt/sfm/sfmWin.c src/opt/sfm/sfmWin.c
/**CFile****************************************************************
FileName [sfmLib.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [SAT-based optimization using internal don't-cares.]
Synopsis [Preprocessing genlib library.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: sfmLib.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "sfmInt.h"
#include "misc/st/st.h"
#include "map/mio/mio.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Sfm_DecCreateCnf( Vec_Int_t * vGateSizes, Vec_Wrd_t * vGateFuncs, Vec_Wec_t * vGateCnfs )
{
Vec_Str_t * vCnf, * vCnfBase;
Vec_Int_t * vCover;
word uTruth;
int i, nCubes;
vCnf = Vec_StrAlloc( 100 );
vCover = Vec_IntAlloc( 100 );
Vec_WrdForEachEntry( vGateFuncs, uTruth, i )
{
nCubes = Sfm_TruthToCnf( uTruth, Vec_IntEntry(vGateSizes, i), vCover, vCnf );
vCnfBase = (Vec_Str_t *)Vec_WecEntry( vGateCnfs, i );
Vec_StrGrow( vCnfBase, Vec_StrSize(vCnf) );
memcpy( Vec_StrArray(vCnfBase), Vec_StrArray(vCnf), Vec_StrSize(vCnf) );
vCnfBase->nSize = Vec_StrSize(vCnf);
}
Vec_IntFree( vCover );
Vec_StrFree( vCnf );
}
/**Function*************************************************************
Synopsis [Preprocess the library.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Sfm_LibPreprocess( Mio_Library_t * pLib, Vec_Int_t * vGateSizes, Vec_Wrd_t * vGateFuncs, Vec_Wec_t * vGateCnfs, Vec_Ptr_t * vGateHands )
{
Mio_Gate_t * pGate;
int nGates = Mio_LibraryReadGateNum(pLib);
Vec_IntGrow( vGateSizes, nGates );
Vec_WrdGrow( vGateFuncs, nGates );
Vec_WecInit( vGateCnfs, nGates );
Vec_PtrGrow( vGateHands, nGates );
Mio_LibraryForEachGate( pLib, pGate )
{
Vec_IntPush( vGateSizes, Mio_GateReadPinNum(pGate) );
Vec_WrdPush( vGateFuncs, Mio_GateReadTruth(pGate) );
Mio_GateSetValue( pGate, Vec_PtrSize(vGateHands) );
Vec_PtrPush( vGateHands, pGate );
}
Sfm_DecCreateCnf( vGateSizes, vGateFuncs, vGateCnfs );
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
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