Commit 79f04c66 by Alan Mishchenko

Experiments with word-level data structures.

parent 48498af8
...@@ -1127,6 +1127,10 @@ SOURCE=.\src\base\wln\wln.h ...@@ -1127,6 +1127,10 @@ SOURCE=.\src\base\wln\wln.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\base\wln\wlnBlast.c
# End Source File
# Begin Source File
SOURCE=.\src\base\wln\wlnMem.c SOURCE=.\src\base\wln\wlnMem.c
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -1143,6 +1147,10 @@ SOURCE=.\src\base\wln\wlnObj.c ...@@ -1143,6 +1147,10 @@ SOURCE=.\src\base\wln\wlnObj.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\base\wln\wlnRead.c
# End Source File
# Begin Source File
SOURCE=.\src\base\wln\wlnRetime.c SOURCE=.\src\base\wln\wlnRetime.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -1086,6 +1086,20 @@ Gia_Man_t * Gia_ManDupAppendNew( Gia_Man_t * pOne, Gia_Man_t * pTwo ) ...@@ -1086,6 +1086,20 @@ Gia_Man_t * Gia_ManDupAppendNew( Gia_Man_t * pOne, Gia_Man_t * pTwo )
Gia_ManSetRegNum( pNew, Gia_ManRegNum(pOne) + Gia_ManRegNum(pTwo) ); Gia_ManSetRegNum( pNew, Gia_ManRegNum(pOne) + Gia_ManRegNum(pTwo) );
return pNew; return pNew;
} }
void Gia_ManDupRebuild( Gia_Man_t * pNew, Gia_Man_t * p, Vec_Int_t * vLits )
{
Gia_Obj_t * pObj; int i;
assert( Vec_IntSize(vLits) == Gia_ManCiNum(p) );
Gia_ManConst0(p)->Value = 0;
Gia_ManForEachCi( p, pObj, i )
pObj->Value = Vec_IntEntry(vLits, i);
Gia_ManForEachAnd( p, pObj, i )
pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
Vec_IntClear( vLits );
Gia_ManForEachCo( p, pObj, i )
Vec_IntPush( vLits, Gia_ObjFanin0Copy(pObj) );
assert( Vec_IntSize(vLits) == Gia_ManCoNum(p) );
}
/**Function************************************************************* /**Function*************************************************************
......
...@@ -1025,9 +1025,9 @@ Vec_Wec_t * Min_ManComputeCexes( Gia_Man_t * p, Vec_Int_t * vOuts0, int nMaxTrie ...@@ -1025,9 +1025,9 @@ Vec_Wec_t * Min_ManComputeCexes( Gia_Man_t * p, Vec_Int_t * vOuts0, int nMaxTrie
if ( fVerbose ) if ( fVerbose )
printf( "Used simulation for %d and SAT for %d outputs (out of %d).\n", nSimOuts, nSatOuts, nOuts ); printf( "Used simulation for %d and SAT for %d outputs (out of %d).\n", nSimOuts, nSatOuts, nOuts );
if ( fVerbose ) if ( fVerbose )
Abc_PrintTime( 1, "Simulation time ", clkSim ); Abc_PrintTime( 1, "Simulation time ", clkSim );
if ( fVerbose ) if ( fVerbose )
Abc_PrintTime( 1, "SAT solving time", clkSat ); Abc_PrintTime( 1, "SAT solving time ", clkSat );
//Vec_WecPrint( vCexes, 0 ); //Vec_WecPrint( vCexes, 0 );
if ( vOuts != vOuts0 ) if ( vOuts != vOuts0 )
Vec_IntFreeP( &vOuts ); Vec_IntFreeP( &vOuts );
......
...@@ -226,6 +226,10 @@ static inline const char * Abc_OperName( int Type ) ...@@ -226,6 +226,10 @@ static inline const char * Abc_OperName( int Type )
if ( Type == ABC_OPER_ZEROPAD ) return "zPad"; if ( Type == ABC_OPER_ZEROPAD ) return "zPad";
if ( Type == ABC_OPER_SIGNEXT ) return "sExt"; if ( Type == ABC_OPER_SIGNEXT ) return "sExt";
if ( Type == ABC_OPER_BIT_MUX ) return "mux";
if ( Type == ABC_OPER_SEL_NMUX ) return "nmux";
if ( Type == ABC_OPER_SEL_SEL ) return "pmux";
if ( Type == ABC_OPER_CONST ) return "const"; if ( Type == ABC_OPER_CONST ) return "const";
if ( Type == ABC_OPER_TABLE ) return "table"; if ( Type == ABC_OPER_TABLE ) return "table";
if ( Type == ABC_OPER_LUT ) return "lut"; if ( Type == ABC_OPER_LUT ) return "lut";
......
...@@ -145,6 +145,7 @@ struct Abc_Frame_t_ ...@@ -145,6 +145,7 @@ struct Abc_Frame_t_
void * pAbc85Delay; void * pAbc85Delay;
void * pAbcWlc; void * pAbcWlc;
Vec_Int_t * pAbcWlcInv; Vec_Int_t * pAbcWlcInv;
void * pAbcRtl;
void * pAbcBac; void * pAbcBac;
void * pAbcCba; void * pAbcCba;
void * pAbcPla; void * pAbcPla;
......
SRC += src/base/wln/wln.c \ SRC += src/base/wln/wln.c \
src/base/wln/wlnBlast.c \
src/base/wln/wlnMem.c \ src/base/wln/wlnMem.c \
src/base/wln/wlnNdr.c \ src/base/wln/wlnNdr.c \
src/base/wln/wlnNtk.c \ src/base/wln/wlnNtk.c \
src/base/wln/wlnObj.c \ src/base/wln/wlnObj.c \
src/base/wln/wlnRead.c \
src/base/wln/wlnRetime.c \ src/base/wln/wlnRetime.c \
src/base/wln/wlnRtl.c \ src/base/wln/wlnRtl.c \
src/base/wln/wlnWlc.c \ src/base/wln/wlnWlc.c \
......
...@@ -251,6 +251,10 @@ extern void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk ); ...@@ -251,6 +251,10 @@ extern void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk );
/*=== wlcWriteVer.c ========================================================*/ /*=== wlcWriteVer.c ========================================================*/
extern void Wln_WriteVer( Wln_Ntk_t * p, char * pFileName ); extern void Wln_WriteVer( Wln_Ntk_t * p, char * pFileName );
/*=== wlcRead.c ========================================================*/
typedef struct Rtl_Lib_t_ Rtl_Lib_t;
extern Rtl_Lib_t * Rtl_LibReadFile( char * pFileName, char * pFileSpec );
extern void Rtl_LibFree( Rtl_Lib_t * p );
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_HEADER_END
......
...@@ -37,21 +37,6 @@ ABC_NAMESPACE_IMPL_START ...@@ -37,21 +37,6 @@ ABC_NAMESPACE_IMPL_START
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Wln_Ntk_t * Wln_ReadRtl( char * pFileName )
{
return NULL;
}
/**Function************************************************************* /**Function*************************************************************
...@@ -96,28 +81,31 @@ int Wln_ConvertToRtl( char * pCommand, char * pFileTemp ) ...@@ -96,28 +81,31 @@ int Wln_ConvertToRtl( char * pCommand, char * pFileTemp )
fclose( pFile ); fclose( pFile );
return 1; return 1;
} }
Wln_Ntk_t * Wln_ReadSystemVerilog( char * pFileName, char * pTopModule, int fVerbose ) Rtl_Lib_t * Wln_ReadSystemVerilog( char * pFileName, char * pTopModule, int fCollapse, int fVerbose )
{ {
Wln_Ntk_t * pNtk = NULL; Rtl_Lib_t * pNtk = NULL;
char Command[1000]; char Command[1000];
char * pFileTemp = "_temp_.rtlil"; char * pFileTemp = "_temp_.rtlil";
int fSVlog = strstr(pFileName, ".sv") != NULL; int fSVlog = strstr(pFileName, ".sv") != NULL;
sprintf( Command, "%s -qp \"read_verilog %s%s; hierarchy %s%s; flatten; proc; write_rtlil %s\"", if ( strstr(pFileName, ".rtl") )
return Rtl_LibReadFile( pFileName, pFileName );
sprintf( Command, "%s -qp \"read_verilog %s%s; hierarchy %s%s; %sproc; write_rtlil %s\"",
Wln_GetYosysName(), fSVlog ? "-sv ":"", pFileName, Wln_GetYosysName(), fSVlog ? "-sv ":"", pFileName,
pTopModule ? "-top " : "-auto-top", pTopModule ? pTopModule : "", pFileTemp ); pTopModule ? "-top " : "-auto-top",
pTopModule ? pTopModule : "",
fCollapse ? "flatten; " : "",
pFileTemp );
if ( fVerbose ) if ( fVerbose )
printf( "%s\n", Command ); printf( "%s\n", Command );
if ( !Wln_ConvertToRtl(Command, pFileTemp) ) if ( !Wln_ConvertToRtl(Command, pFileTemp) )
{
return NULL; return NULL;
} pNtk = Rtl_LibReadFile( pFileTemp, pFileName );
pNtk = Wln_ReadRtl( pFileTemp );
if ( pNtk == NULL ) if ( pNtk == NULL )
{ {
printf( "Dumped the design into file \"%s\".\n", pFileTemp ); printf( "Dumped the design into file \"%s\".\n", pFileTemp );
return NULL; return NULL;
} }
unlink( pFileTemp ); //unlink( pFileTemp );
return pNtk; return pNtk;
} }
Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, int fSkipStrash, int fInvert, int fTechMap, int fVerbose ) Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, int fSkipStrash, int fInvert, int fTechMap, int fVerbose )
...@@ -125,10 +113,16 @@ Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, int fSk ...@@ -125,10 +113,16 @@ Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, int fSk
Gia_Man_t * pGia = NULL; Gia_Man_t * pGia = NULL;
char Command[1000]; char Command[1000];
char * pFileTemp = "_temp_.aig"; char * pFileTemp = "_temp_.aig";
int fSVlog = strstr(pFileName, ".sv") != NULL; int fRtlil = strstr(pFileName, ".rtl") != NULL;
sprintf( Command, "%s -qp \"read_verilog %s%s; hierarchy %s%s; flatten; proc; %saigmap; write_aiger %s\"", int fSVlog = strstr(pFileName, ".sv") != NULL;
Wln_GetYosysName(), fSVlog ? "-sv ":"", pFileName, sprintf( Command, "%s -qp \"%s%s%s; hierarchy %s%s; flatten; proc; %saigmap; write_aiger %s\"",
pTopModule ? "-top " : "-auto-top", pTopModule ? pTopModule : "", fTechMap ? "techmap; setundef -zero; " : "", pFileTemp ); Wln_GetYosysName(),
fRtlil ? "read_rtlil" : "read_verilog",
fSVlog ? " -sv ":" ",
pFileName,
pTopModule ? "-top " : "-auto-top",
pTopModule ? pTopModule : "",
fTechMap ? "techmap; setundef -zero; " : "", pFileTemp );
if ( fVerbose ) if ( fVerbose )
printf( "%s\n", Command ); printf( "%s\n", Command );
if ( !Wln_ConvertToRtl(Command, pFileTemp) ) if ( !Wln_ConvertToRtl(Command, pFileTemp) )
......
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