diff options
Diffstat (limited to 'src/opt/dau/dauNpn.c')
-rw-r--r-- | src/opt/dau/dauNpn.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/opt/dau/dauNpn.c b/src/opt/dau/dauNpn.c index b57ade67..3740eeaf 100644 --- a/src/opt/dau/dauNpn.c +++ b/src/opt/dau/dauNpn.c @@ -29,7 +29,6 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -//#define USE4VARS 1 //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -46,19 +45,14 @@ ABC_NAMESPACE_IMPL_START SeeAlso [] ***********************************************************************/ -void Dau_TruthEnum() +void Dau_TruthEnum(int nVars) { int fUseTable = 1; abctime clk = Abc_Clock(); -#ifdef USE4VARS - int nVars = 4; - int nSizeW = 1 << 14; - char * pFileName = "tableW14.data"; -#else - int nVars = 5; - int nSizeW = 1 << 30; - char * pFileName = "tableW30.data"; -#endif + int nSizeLog = (1<<nVars) -2; + int nSizeW = 1 << nSizeLog; + char pFileName[20]; + sprintf( pFileName, "tableW%d.data", nSizeLog ); int nPerms = Extra_Factorial( nVars ); int nMints = 1 << nVars; int * pPerm = Extra_PermSchedule( nVars ); @@ -177,20 +171,15 @@ int Dau_AddFunction( word tCur, int nVars, unsigned * pTable, Vec_Int_t * vNpns, } return 0; } -void Dau_NetworkEnum() +void Dau_NetworkEnum(int nVars) { abctime clk = Abc_Clock(); int Limit = 2; int UseTwo = 0; -#ifdef USE4VARS - int nVars = 4; - int nSizeW = 1 << 14; - char * pFileName = "tableW14.data"; -#else - int nVars = 5; - int nSizeW = 1 << 30; - char * pFileName = "tableW30.data"; -#endif + int nSizeLog = (1<<nVars) -2; + int nSizeW = 1 << nSizeLog; + char pFileName[20]; + sprintf( pFileName, "tableW%d.data", nSizeLog ); unsigned * pTable = Dau_ReadFile( pFileName, nSizeW ); Vec_Wec_t * vNpns = Vec_WecStart( 32 ); Vec_Wec_t * vNpns_ = Vec_WecStart( 32 ); @@ -380,8 +369,8 @@ void Dau_NetworkEnum() } void Dau_NetworkEnumTest() { - //Dau_TruthEnum(); - Dau_NetworkEnum(); + //Dau_TruthEnum(3); + Dau_NetworkEnum(4); } |