30static int Abc_CommandYosys (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
31static int Abc_CommandGraft (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
32static int Abc_CommandHierarchy (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
33static int Abc_CommandCollapse (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
34static int Abc_CommandSolve (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
35static int Abc_CommandPrint (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
38static inline void Wln_AbcFreeRtl(
Abc_Frame_t * pAbc ) {
if ( pAbc->pAbcRtl )
Rtl_LibFree(Wln_AbcGetRtl(pAbc)); }
39static inline void Wln_AbcUpdateRtl(
Abc_Frame_t * pAbc,
Rtl_Lib_t * pLib ) { Wln_AbcFreeRtl(pAbc); pAbc->pAbcRtl = pLib; }
58 Cmd_CommandAdd( pAbc,
"Word level",
"%yosys", Abc_CommandYosys, 0 );
59 Cmd_CommandAdd( pAbc,
"Word level",
"%graft", Abc_CommandGraft, 0 );
60 Cmd_CommandAdd( pAbc,
"Word level",
"%hierarchy", Abc_CommandHierarchy, 0 );
61 Cmd_CommandAdd( pAbc,
"Word level",
"%collapse", Abc_CommandCollapse, 0 );
63 Cmd_CommandAdd( pAbc,
"Word level",
"%print", Abc_CommandPrint, 0 );
79 Wln_AbcUpdateRtl( pAbc, NULL );
93int Abc_CommandYosys(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
96 extern Gia_Man_t *
Wln_BlastSystemVerilog(
char * pFileName,
char * pTopModule,
char * pDefines,
int fSkipStrash,
int fInvert,
int fTechMap,
int fLibInDir,
int fVerbose );
100 char * pFileName = NULL;
101 char * pTopModule= NULL;
102 char * pDefines = NULL;
103 char * pLibrary = NULL;
119 Abc_Print( -1,
"Command line switch \"-T\" should be followed by a file name.\n" );
128 Abc_Print( -1,
"Command line switch \"-D\" should be followed by a file name.\n" );
137 Abc_Print( -1,
"Command line switch \"-L\" should be followed by a file name.\n" );
172 printf(
"Abc_CommandReadWlc(): Input file name should be given on the command line.\n" );
177 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
179 Abc_Print( 1,
"Cannot open input file \"%s\". ", pFileName );
181 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
182 Abc_Print( 1,
"\n" );
197 printf(
"Abc_CommandYosys(): Unknown file extension.\n" );
206 pNew =
Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fLibInDir, fVerbose );
208 pNew =
Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fLibInDir, fVerbose );
210 pNew =
Wln_BlastSystemVerilog( pFileName, pTopModule, pDefines, fSkipStrash, fInvert, fTechMap, fLibInDir, fVerbose );
213 printf(
"Abc_CommandYosys(): Unknown file extension.\n" );
229 printf(
"Abc_CommandYosys(): Unknown file extension.\n" );
232 Wln_AbcUpdateRtl( pAbc, pLib );
236 Abc_Print( -2,
"usage: %%yosys [-T <module>] [-D <defines>] [-L <liberty_file>] [-bismlcvh] <file_name>\n" );
237 Abc_Print( -2,
"\t reads Verilog or SystemVerilog using Yosys\n" );
238 Abc_Print( -2,
"\t-T : specify the top module name (default uses \"-auto-top\")\n" );
239 Abc_Print( -2,
"\t-D : specify defines to be used by Yosys (default \"not used\")\n" );
240 Abc_Print( -2,
"\t-L : specify the Liberty library to read a mapped design (default \"not used\")\n" );
241 Abc_Print( -2,
"\t-b : toggle bit-blasting the design into an AIG using Yosys [default = %s]\n", fBlast?
"yes":
"no" );
242 Abc_Print( -2,
"\t-i : toggle inverting the outputs (useful for miters) [default = %s]\n", fInvert?
"yes":
"no" );
243 Abc_Print( -2,
"\t-s : toggle no structural hashing during bit-blasting [default = %s]\n", fSkipStrash?
"no strash":
"strash" );
244 Abc_Print( -2,
"\t-m : toggle using \"techmap\" to blast operators [default = %s]\n", fTechMap?
"yes":
"no" );
245 Abc_Print( -2,
"\t-l : toggle looking for \"techmap.v\" in the current directory [default = %s]\n", fLibInDir?
"yes":
"no" );
246 Abc_Print( -2,
"\t-c : toggle collapsing design hierarchy using Yosys [default = %s]\n", fCollapse?
"yes":
"no" );
247 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
248 Abc_Print( -2,
"\t-h : print the command usage\n");
263int Abc_CommandGraft(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
267 char ** pArgvNew;
int nArgcNew;
268 int c, fInv = 0, fVerbose = 0;
288 printf(
"The design is not entered.\n" );
293 if ( nArgcNew != 0 && nArgcNew != 2 )
295 Abc_Print( -1,
"Abc_CommandGraft(): This command expects one AIG file name on the command line.\n" );
301 Abc_Print( -2,
"usage: %%graft [-ivh] <module1_name> <module2_name>\n" );
302 Abc_Print( -2,
"\t replace instances of module1 by those of module2\n" );
303 Abc_Print( -2,
"\t-i : toggle using inverse grafting [default = %s]\n", fInv?
"yes":
"no" );
304 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
305 Abc_Print( -2,
"\t-h : print the command usage\n");
320int Abc_CommandHierarchy(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
324 char ** pArgvNew;
int nArgcNew;
342 printf(
"The design is not entered.\n" );
349 Abc_Print( -1,
"Abc_CommandHierarchy(): This command expects one AIG file name on the command line.\n" );
355 Abc_Print( -2,
"usage: %%hierarchy [-vh] <module_name>\n" );
356 Abc_Print( -2,
"\t marks the module whose instances may later be treated as black boxes\n" );
357 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
358 Abc_Print( -2,
"\t-h : print the command usage\n");
373int Abc_CommandCollapse(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
378 char * pTopModule = NULL;
379 int c, fInv = 0, fRev = 0, fVerbose = 0;
388 Abc_Print( -1,
"Command line switch \"-T\" should be followed by a file name.\n" );
411 printf(
"The design is not entered.\n" );
420 Abc_Print( -2,
"usage: %%collapse [-T <module>] [-crvh] <file_name>\n" );
421 Abc_Print( -2,
"\t collapse hierarchical design into an AIG\n" );
422 Abc_Print( -2,
"\t-T : specify the top module of the design [default = none]\n" );
423 Abc_Print( -2,
"\t-c : toggle complementing miter outputs after collapsing [default = %s]\n", fInv?
"yes":
"no" );
424 Abc_Print( -2,
"\t-r : toggle bit order reversal in the word-level IO [default = %s]\n", fRev?
"yes":
"no" );
425 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
426 Abc_Print( -2,
"\t-h : print the command usage\n");
441int Abc_CommandPrint(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
447 int c, fHie = 0, fDesign = 0, fVerbose = 0;
470 printf(
"The design is not entered.\n" );
480 Abc_Print( -2,
"usage: %%print [-pdvh]\n" );
481 Abc_Print( -2,
"\t print statistics about the hierarchical design\n" );
482 Abc_Print( -2,
"\t-p : toggle printing of the hierarchy [default = %s]\n", fHie?
"yes":
"no" );
483 Abc_Print( -2,
"\t-d : toggle printing of the design [default = %s]\n", fDesign?
"yes":
"no" );
484 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
485 Abc_Print( -2,
"\t-h : print the command usage\n");
486 Abc_Print( -2,
"\t<file> : text file name with guidance for solving\n");
501int Abc_CommandSolve(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
510 int c, fOldBlast = 0, fPrepro = 0, fVerbose = 0;
533 printf(
"The design is not entered.\n" );
539 FILE * pFile = fopen( pFileName,
"r" );
542 Abc_Print( -1,
"Cannot open file \"%s\" with the input test patterns.\n", pFileName );
546 printf(
"Using guidance from file \"%s\".\n", pFileName );
551 printf(
"Solving the miter without guidance.\n" );
562 Abc_Print( -2,
"usage: %%solve [-opvh] <file>\n" );
563 Abc_Print( -2,
"\t solving properties for the hierarchical design\n" );
564 Abc_Print( -2,
"\t-o : toggle using old bit-blasting procedure [default = %s]\n", fOldBlast?
"yes":
"no" );
565 Abc_Print( -2,
"\t-p : toggle preprocessing for verification [default = %s]\n", fPrepro?
"yes":
"no" );
566 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
567 Abc_Print( -2,
"\t-h : print the command usage\n");
568 Abc_Print( -2,
"\t<file> : text file name with guidance for solving\n");
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
struct Abc_Ntk_t_ Abc_Ntk_t
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
void Gia_ManInvertPos(Gia_Man_t *pAig)
struct Gia_Man_t_ Gia_Man_t
void Wln_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
void Wln_End(Abc_Frame_t *pAbc)
void Rtl_LibSolve(Rtl_Lib_t *pLib, void *pNtk)
Gia_Man_t * Rtl_LibCollapse(Rtl_Lib_t *p, char *pTopModule, int fRev, int fVerbose)
void Rtl_LibPrintHieStats(Rtl_Lib_t *p)
void Rtl_LibPreprocess(Rtl_Lib_t *pLib)
void Rtl_LibBlast2(Rtl_Lib_t *pLib, Vec_Int_t *vRoots, int fInv)
void Rtl_LibBlast(Rtl_Lib_t *pLib)
void Rtl_LibPrintStats(Rtl_Lib_t *p)
void Rtl_LibPrint(char *pFileName, Rtl_Lib_t *p)
void Wln_LibGraftOne(Rtl_Lib_t *p, char **pModules, int nModules, int fInv, int fVerbose)
void Wln_LibMarkHierarchy(Rtl_Lib_t *p, char **ppModule, int nModules, int fVerbose)
void Wln_SolveWithGuidance(char *pFileName, Rtl_Lib_t *p)
Abc_Ntk_t * Wln_ReadMappedSystemVerilog(char *pFileName, char *pTopModule, char *pDefines, char *pLibrary, int fVerbose)
Gia_Man_t * Wln_BlastSystemVerilog(char *pFileName, char *pTopModule, char *pDefines, int fSkipStrash, int fInvert, int fTechMap, int fLibInDir, int fVerbose)
Rtl_Lib_t * Wln_ReadSystemVerilog(char *pFileName, char *pTopModule, char *pDefines, int fCollapse, int fVerbose)
void Rtl_LibFree(Rtl_Lib_t *p)
struct Rtl_Lib_t_ Rtl_Lib_t