Commit a6f8625d by Alan Mishchenko

Experiments with word-level data structures.

parent 6097ac1d
......@@ -539,7 +539,7 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Abc_Print( 1, " %s =%8d", p->pMuxes? "nod" : "and", Gia_ManAndNum(p) );
SetConsoleTextAttribute( hConsole, 13 ); // magenta
Abc_Print( 1, " lev =%5d", Gia_ManLevelNum(p) );
Abc_Print( 1, " (%.2f)", Gia_ManLevelAve(p) );
Abc_Print( 1, " (%7.2f)", Gia_ManLevelAve(p) );
SetConsoleTextAttribute( hConsole, 7 ); // normal
}
#else
......
......@@ -2130,18 +2130,22 @@ int Abc_CommandSolve( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Rtl_LibOrderWires( Rtl_Lib_t * pLib );
extern void Rtl_LibOrderCells( Rtl_Lib_t * pLib );
extern void Rtl_LibBlast( Rtl_Lib_t * pLib );
extern void Rtl_LibBlast2( Rtl_Lib_t * pLib );
extern void Rtl_LibReorderModules( Rtl_Lib_t * pLib );
extern void Rtl_LibSolve( Rtl_Lib_t * pLib );
extern void Rtl_LibPreprocess( Rtl_Lib_t * pLib );
Gia_Man_t * pGia = NULL;
Rtl_Lib_t * pLib = Wlc_AbcGetRtl(pAbc);
int c, fPrepro = 0, fVerbose = 0;
int c, fOldBlast = 0, fPrepro = 0, fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "pvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "opvh" ) ) != EOF )
{
switch ( c )
{
case 'o':
fOldBlast ^= 1;
break;
case 'p':
fPrepro ^= 1;
break;
......@@ -2157,9 +2161,14 @@ int Abc_CommandSolve( Abc_Frame_t * pAbc, int argc, char ** argv )
Rtl_LibPrintStats( pLib );
//Rtl_LibPrint( NULL, pLib );
Rtl_LibOrderWires( pLib );
Rtl_LibOrderCells( pLib );
Rtl_LibBlast( pLib );
if ( fOldBlast )
{
Rtl_LibOrderCells( pLib );
Rtl_LibBlast( pLib );
}
else
Rtl_LibBlast2( pLib );
//Rtl_LibReorderModules( pLib );
//Rtl_LibPrintStats( pLib );
......@@ -2172,8 +2181,9 @@ int Abc_CommandSolve( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_ManStopP( &pGia );
return 0;
usage:
Abc_Print( -2, "usage: %%solve [-pvh]\n" );
Abc_Print( -2, "usage: %%solve [-opvh]\n" );
Abc_Print( -2, "\t experiments with word-level networks\n" );
Abc_Print( -2, "\t-o : toggle using old bit-blasting procedure [default = %s]\n", fOldBlast? "yes": "no" );
Abc_Print( -2, "\t-p : toggle preprocessing for verification [default = %s]\n", fPrepro? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
......
......@@ -49,6 +49,34 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
#define MAX_LINE 1000000
void Rtl_NtkCleanFile( char * pFileName )
{
char * pBuffer, * pFileName2 = "_temp__.rtlil";
FILE * pFile = fopen( pFileName, "rb" );
FILE * pFile2;
if ( pFile == NULL )
{
printf( "Cannot open file \"%s\" for reading.\n", pFileName );
return;
}
pFile2 = fopen( pFileName2, "wb" );
if ( pFile2 == NULL )
{
fclose( pFile );
printf( "Cannot open file \"%s\" for writing.\n", pFileName2 );
return;
}
pBuffer = ABC_ALLOC( char, MAX_LINE );
while ( fgets( pBuffer, MAX_LINE, pFile ) != NULL )
if ( !strstr(pBuffer, "attribute \\src") )
fputs( pBuffer, pFile2 );
ABC_FREE( pBuffer );
fclose( pFile );
fclose( pFile2 );
}
char * Wln_GetYosysName()
{
char * pYosysName = NULL;
......@@ -105,7 +133,8 @@ Rtl_Lib_t * Wln_ReadSystemVerilog( char * pFileName, char * pTopModule, int fCol
printf( "Dumped the design into file \"%s\".\n", pFileTemp );
return NULL;
}
//unlink( pFileTemp );
Rtl_NtkCleanFile( pFileTemp );
unlink( pFileTemp );
return pNtk;
}
Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, int fSkipStrash, int fInvert, int fTechMap, int fVerbose )
......
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