Commit eb270018 by Alan Mishchenko

Esperiments with MO PLA optimization.

parent d7d1978e
......@@ -258,6 +258,7 @@ static inline int Abc_NtkHasBlifMv( Abc_Ntk_t * pNtk ) { return pN
static inline int Abc_NtkHasBlackbox( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLACKBOX; }
static inline int Abc_NtkIsSopNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_NETLIST; }
static inline int Abc_NtkIsBddNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD && pNtk->ntkType == ABC_NTK_NETLIST; }
static inline int Abc_NtkIsAigNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_NETLIST; }
static inline int Abc_NtkIsMappedNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_NETLIST; }
static inline int Abc_NtkIsBlifMvNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV && pNtk->ntkType == ABC_NTK_NETLIST; }
......
......@@ -30,7 +30,7 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
#define ABC_MUX_CUBES 100000
#define ABC_MAX_CUBES 100000
int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
static DdNode * Abc_ConvertAigToBdd( DdManager * dd, Hop_Obj_t * pRoot);
......@@ -307,10 +307,10 @@ char * Abc_ConvertBddToSop( Mem_Flex_t * pMan, DdManager * dd, DdNode * bFuncOn,
assert( 0 );
}
if ( nCubes > ABC_MUX_CUBES )
if ( nCubes > ABC_MAX_CUBES )
{
Cudd_RecursiveDerefZdd( dd, zCover );
printf( "The number of cubes exceeded the predefined limit (%d).\n", ABC_MUX_CUBES );
printf( "The number of cubes exceeded the predefined limit (%d).\n", ABC_MAX_CUBES );
return NULL;
}
......@@ -571,7 +571,7 @@ void Abc_CountZddCubes_rec( DdManager * dd, DdNode * zCover, int * pnCubes )
(*pnCubes)++;
return;
}
if ( (*pnCubes) > ABC_MUX_CUBES )
if ( (*pnCubes) > ABC_MAX_CUBES )
return;
extraDecomposeCover( dd, zCover, &zC0, &zC1, &zC2 );
Abc_CountZddCubes_rec( dd, zC0, pnCubes );
......
......@@ -2479,13 +2479,16 @@ usage:
int IoCommandWritePla( Abc_Frame_t * pAbc, int argc, char **argv )
{
char * pFileName;
int c;
int c, fUseMoPla = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "mh" ) ) != EOF )
{
switch ( c )
{
case 'm':
fUseMoPla ^= 1;
break;
case 'h':
goto usage;
default:
......@@ -2502,12 +2505,13 @@ int IoCommandWritePla( Abc_Frame_t * pAbc, int argc, char **argv )
// get the output file name
pFileName = argv[globalUtilOptind];
// call the corresponding file writer
Io_Write( pAbc->pNtkCur, pFileName, IO_FILE_PLA );
Io_Write( pAbc->pNtkCur, pFileName, fUseMoPla ? IO_FILE_MOPLA : IO_FILE_PLA );
return 0;
usage:
fprintf( pAbc->Err, "usage: write_pla [-h] <file>\n" );
fprintf( pAbc->Err, "usage: write_pla [-mh] <file>\n" );
fprintf( pAbc->Err, "\t writes the collapsed network into a PLA file\n" );
fprintf( pAbc->Err, "\t-m : toggle writing multi-output PLA [default = %s]\n", fUseMoPla? "yes":"no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
......
......@@ -59,6 +59,7 @@ typedef enum {
IO_FILE_GML,
IO_FILE_LIST,
IO_FILE_PLA,
IO_FILE_MOPLA,
IO_FILE_SMV,
IO_FILE_VERILOG,
IO_FILE_UNKNOWN
......@@ -128,6 +129,7 @@ extern void Io_WriteGml( Abc_Ntk_t * pNtk, char * pFileName );
extern void Io_WriteList( Abc_Ntk_t * pNtk, char * pFileName, int fUseHost );
/*=== abcWritePla.c ===========================================================*/
extern int Io_WritePla( Abc_Ntk_t * pNtk, char * FileName );
extern int Io_WriteMoPla( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteSmv.c ===========================================================*/
extern int Io_WriteSmv( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteVerilog.c =======================================================*/
......
......@@ -399,6 +399,10 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
if ( !Abc_NtkToSop( pNtkTemp, 1 ) )
return;
}
else if ( FileType == IO_FILE_MOPLA )
{
pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
}
else if ( FileType == IO_FILE_BENCH )
{
if ( !Abc_NtkIsStrash(pNtk) )
......@@ -444,6 +448,8 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
Io_WriteBook( pNtkTemp, pFileName );
else if ( FileType == IO_FILE_PLA )
Io_WritePla( pNtkTemp, pFileName );
else if ( FileType == IO_FILE_MOPLA )
Io_WriteMoPla( pNtkTemp, pFileName );
else if ( FileType == IO_FILE_EQN )
{
if ( !Abc_NtkHasAig(pNtkTemp) )
......
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