99 #define PRB_(f) printf( #f " = " ); Cudd_bddPrint(dd,f); printf( "\n" )
100 #define PRK(f,n) Cudd_PrintKMap(stdout,dd,(f),Cudd_Not(f),(n),NULL,0); printf( "K-map for function" #f "\n\n" )
101 #define PRK2(f,g,n) Cudd_PrintKMap(stdout,dd,(f),(g),(n),NULL,0); printf( "K-map for function <" #f ", " #g ">\n\n" )
129 int nLutOutputsOrig = 0;
161 p->
nIns = nVarsRem + PrevMulti;
162 p->
nInsP = PrevMulti;
165 p->
Level = nNames-nVarsRem;
175 p->
nInsP = PrevMulti;
178 p->
Level = nNames-nVarsRem;
180 nVarsRem = nVarsRem-(
s_LutSize-PrevMulti);
186 printf(
"The LUT size is too small\n" );
190 nLutOutputsOrig += p->
nMulti;
222 for ( i = 0; i < nLuts; i++ )
240 dd, &aFunc, &(
b1), 1,
244 dd, pLuts[i-1]->paNodes, pLuts[i-1]->pbCodes, pLuts[i-1]->nCols,
258 for ( v = 0; v < nVars; v++ )
264 for ( v = 0; v < nVars; v++ )
301 printf(
"Stage %3d: In = %3d InP = %3d Cols = %5d Multi = %2d Simple = %2d Level = %3d\n",
307 for ( c = 0; c < p->
nCols; c++ )
324 for ( v = 0; v < dd->
size; v++ )
329 for ( v = 0; v < p->
nMulti; v++ )
330 Permute[bCVars[v]->index] = dd->
invperm[v];
336 for ( k = 0; k < p->
nCols; k++ )
345 printf(
"LUTs: Total = %5d. Final = %5d. Simple = %5d. (%6.2f %%) ",
346 nLutsTotal, nLutOutputs, nLutsTotal-nLutOutputs, 100.0*(nLutsTotal-nLutOutputs)/nLutsTotal );
348 printf(
"Memory = %6.2f MB\n", 1.0*nLutOutputs*(1<<nLutSize)/(1<<20) );
356 printf(
"Pure decomposition time = %.2f sec\n", (
float)(
Abc_Clock() - clk1 -
s_EncodingTime)/(
float)(CLOCKS_PER_SEC) );
357 printf(
"Encoding time = %.2f sec\n", (
float)(
s_EncodingTime)/(
float)(CLOCKS_PER_SEC) );
375 pFile = fopen( FileName,
"w" );
376 fprintf( pFile,
".model %s\n", FileName );
378 fprintf( pFile,
".inputs" );
379 for ( i = 0; i < nNames; i++ )
380 fprintf( pFile,
" %s", pNames[i] );
381 fprintf( pFile,
"\n" );
382 fprintf( pFile,
".outputs F" );
383 fprintf( pFile,
"\n" );
388 fprintf( pFile,
".end\n" );
391 printf(
"Output file writing time = %.2f sec\n", (
float)(
Abc_Clock() - clk1)/(
float)(CLOCKS_PER_SEC) );
396 for ( i = 0; i < nLuts; i++ )
399 for ( v = 0; v < p->
nCols; v++ )
421 static char Buffer[100];
422 DdNode * bCube, * bCof, * bFunc;
426 for ( i = 0; i < nLuts; i++ )
437 fprintf( pFile,
"#----------------- LUT #%d ----------------------\n", i );
444 for ( v = 0; v < p->
nInsP; v++ )
446 sprintf( Buffer,
"LUT%02d_%02d", i-1, v );
450 for ( v = 0; v < p->
nIns - p->
nInsP; v++ )
453 for ( v = 0; v < p->
nMulti; v++ )
455 sprintf( Buffer,
"LUT%02d_%02d", i, v );
456 if ( i != nLuts - 1 )
466 sprintf( Buffer,
"L%02d_", i );
472 for ( o = 0; o < p->
nMulti; o++ )
481 sprintf( Buffer,
"L%02d_%02d_", i, o );
492 for ( v = 0; v < dd->
size; v++ )
494 if ( pNamesLocalIn[v] )
496 pNamesLocalIn[v] = NULL;
498 for ( v = 0; v < p->
nMulti; v++ )
DdNode * Cudd_bddNewVar(DdManager *dd)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
#define MAXINPUTS
INCLUDES ///.
#define Cudd_IsConstant(node)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
void WriteLUTSintoBLIFfile(FILE *pFile, DdManager *dd, LUT **pLuts, int nLuts, DdNode **bCVars, char **pNames, int nNames, char *FileName)
static functions ///
#define ABC_ALLOC(type, num)
void WriteDDintoBLIFfile(FILE *pFile, DdNode *Func, char *OutputName, char *Prefix, char **InputNames)
BLIF WRITING FUNCTIONS ///.
DdNode * Cudd_bddIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
static int s_LutSize
static varibles ///
static abctime Abc_Clock()
int CreateDecomposedNetwork(DdManager *dd, DdNode *aFunc, char **pNames, int nNames, char *FileName, int nLutSize, int fCheck, int fVerbose)
EXTERNAL FUNCTIONS ///.
DdNode * Cudd_Cofactor(DdManager *dd, DdNode *f, DdNode *g)
#define ABC_NAMESPACE_IMPL_END
DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube)
#define ABC_NAMESPACE_IMPL_START
void WriteDDintoBLIFfileReorder(DdManager *dd, FILE *pFile, DdNode *Func, char *OutputName, char *Prefix, char **InputNames)
static int Abc_Base2Log(unsigned n)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)