mirror of https://github.com/YosysHQ/abc.git
Adding an option to read the RTL elaboration library from the current directory.
This commit is contained in:
parent
d6555f48dd
commit
6d1d52deaa
|
|
@ -92,7 +92,7 @@ void Wln_End( Abc_Frame_t * pAbc )
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int Abc_CommandYosys( Abc_Frame_t * pAbc, int argc, char ** argv )
|
int Abc_CommandYosys( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
{
|
{
|
||||||
extern Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, char * pDefines, int fSkipStrash, int fInvert, int fTechMap, int fVerbose );
|
extern Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, char * pDefines, int fSkipStrash, int fInvert, int fTechMap, int fLibInDir, int fVerbose );
|
||||||
extern Rtl_Lib_t * Wln_ReadSystemVerilog( char * pFileName, char * pTopModule, char * pDefines, int fCollapse, int fVerbose );
|
extern Rtl_Lib_t * Wln_ReadSystemVerilog( char * pFileName, char * pTopModule, char * pDefines, int fCollapse, int fVerbose );
|
||||||
|
|
||||||
FILE * pFile;
|
FILE * pFile;
|
||||||
|
|
@ -102,11 +102,12 @@ int Abc_CommandYosys( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
int fBlast = 0;
|
int fBlast = 0;
|
||||||
int fInvert = 0;
|
int fInvert = 0;
|
||||||
int fTechMap = 1;
|
int fTechMap = 1;
|
||||||
|
int fLibInDir = 0;
|
||||||
int fSkipStrash = 0;
|
int fSkipStrash = 0;
|
||||||
int fCollapse = 0;
|
int fCollapse = 0;
|
||||||
int c, fVerbose = 0;
|
int c, fVerbose = 0;
|
||||||
Extra_UtilGetoptReset();
|
Extra_UtilGetoptReset();
|
||||||
while ( ( c = Extra_UtilGetopt( argc, argv, "TDbismcvh" ) ) != EOF )
|
while ( ( c = Extra_UtilGetopt( argc, argv, "TDbismlcvh" ) ) != EOF )
|
||||||
{
|
{
|
||||||
switch ( c )
|
switch ( c )
|
||||||
{
|
{
|
||||||
|
|
@ -140,6 +141,9 @@ int Abc_CommandYosys( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
case 'm':
|
case 'm':
|
||||||
fTechMap ^= 1;
|
fTechMap ^= 1;
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
fLibInDir ^= 1;
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
fCollapse ^= 1;
|
fCollapse ^= 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -174,11 +178,11 @@ int Abc_CommandYosys( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
{
|
{
|
||||||
Gia_Man_t * pNew = NULL;
|
Gia_Man_t * pNew = NULL;
|
||||||
if ( !strcmp( Extra_FileNameExtension(pFileName), "v" ) )
|
if ( !strcmp( Extra_FileNameExtension(pFileName), "v" ) )
|
||||||
pNew = Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fVerbose );
|
pNew = Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fLibInDir, fVerbose );
|
||||||
else if ( !strcmp( Extra_FileNameExtension(pFileName), "sv" ) )
|
else if ( !strcmp( Extra_FileNameExtension(pFileName), "sv" ) )
|
||||||
pNew = Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fVerbose );
|
pNew = Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fLibInDir, fVerbose );
|
||||||
else if ( !strcmp( Extra_FileNameExtension(pFileName), "rtlil" ) )
|
else if ( !strcmp( Extra_FileNameExtension(pFileName), "rtlil" ) )
|
||||||
pNew = Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fVerbose );
|
pNew = Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fLibInDir, fVerbose );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf( "Abc_CommandYosys(): Unknown file extension.\n" );
|
printf( "Abc_CommandYosys(): Unknown file extension.\n" );
|
||||||
|
|
@ -204,7 +208,7 @@ int Abc_CommandYosys( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
usage:
|
usage:
|
||||||
Abc_Print( -2, "usage: %%yosys [-T <module>] [-D <defines>] [-bismcvh] <file_name>\n" );
|
Abc_Print( -2, "usage: %%yosys [-T <module>] [-D <defines>] [-bismlcvh] <file_name>\n" );
|
||||||
Abc_Print( -2, "\t reads Verilog or SystemVerilog using Yosys\n" );
|
Abc_Print( -2, "\t reads Verilog or SystemVerilog using Yosys\n" );
|
||||||
Abc_Print( -2, "\t-T : specify the top module name (default uses \"-auto-top\")\n" );
|
Abc_Print( -2, "\t-T : specify the top module name (default uses \"-auto-top\")\n" );
|
||||||
Abc_Print( -2, "\t-D : specify defines to be used by Yosys (default \"not used\")\n" );
|
Abc_Print( -2, "\t-D : specify defines to be used by Yosys (default \"not used\")\n" );
|
||||||
|
|
@ -212,6 +216,7 @@ usage:
|
||||||
Abc_Print( -2, "\t-i : toggle inverting the outputs (useful for miters) [default = %s]\n", fInvert? "yes": "no" );
|
Abc_Print( -2, "\t-i : toggle inverting the outputs (useful for miters) [default = %s]\n", fInvert? "yes": "no" );
|
||||||
Abc_Print( -2, "\t-s : toggle no structural hashing during bit-blasting [default = %s]\n", fSkipStrash? "no strash": "strash" );
|
Abc_Print( -2, "\t-s : toggle no structural hashing during bit-blasting [default = %s]\n", fSkipStrash? "no strash": "strash" );
|
||||||
Abc_Print( -2, "\t-m : toggle using \"techmap\" to blast operators [default = %s]\n", fTechMap? "yes": "no" );
|
Abc_Print( -2, "\t-m : toggle using \"techmap\" to blast operators [default = %s]\n", fTechMap? "yes": "no" );
|
||||||
|
Abc_Print( -2, "\t-l : toggle looking for \"techmap.v\" in the current directory [default = %s]\n", fLibInDir? "yes": "no" );
|
||||||
Abc_Print( -2, "\t-c : toggle collapsing design hierarchy using Yosys [default = %s]\n", fCollapse? "yes": "no" );
|
Abc_Print( -2, "\t-c : toggle collapsing design hierarchy using Yosys [default = %s]\n", fCollapse? "yes": "no" );
|
||||||
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "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");
|
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ Rtl_Lib_t * Wln_ReadSystemVerilog( char * pFileName, char * pTopModule, char * p
|
||||||
unlink( pFileTemp );
|
unlink( pFileTemp );
|
||||||
return pNtk;
|
return pNtk;
|
||||||
}
|
}
|
||||||
Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, char * pDefines, int fSkipStrash, int fInvert, int fTechMap, int fVerbose )
|
Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, char * pDefines, int fSkipStrash, int fInvert, int fTechMap, int fLibInDir, int fVerbose )
|
||||||
{
|
{
|
||||||
Gia_Man_t * pGia = NULL;
|
Gia_Man_t * pGia = NULL;
|
||||||
char Command[1000];
|
char Command[1000];
|
||||||
|
|
@ -183,7 +183,7 @@ Gia_Man_t * Wln_BlastSystemVerilog( char * pFileName, char * pTopModule, char *
|
||||||
pFileName,
|
pFileName,
|
||||||
pTopModule ? "-top " : "-auto-top",
|
pTopModule ? "-top " : "-auto-top",
|
||||||
pTopModule ? pTopModule : "",
|
pTopModule ? pTopModule : "",
|
||||||
fTechMap ? "techmap; setundef -zero; " : "", pFileTemp );
|
fTechMap ? (fLibInDir ? "techmap -map techmap.v; setundef -zero; " : "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) )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue