yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ilang_frontend.cc
Go to the documentation of this file.
1 /*
2  * yosys -- Yosys Open SYnthesis Suite
3  *
4  * Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  *
18  * ---
19  *
20  * A very simple and straightforward frontend for the RTLIL text
21  * representation (as generated by the 'ilang' backend).
22  *
23  */
24 
25 #include "ilang_frontend.h"
26 #include "kernel/register.h"
27 #include "kernel/log.h"
28 
29 void rtlil_frontend_ilang_yyerror(char const *s)
30 {
31  YOSYS_NAMESPACE_PREFIX log_error("Parser error in line %d: %s\n", rtlil_frontend_ilang_yyget_lineno(), s);
32 }
33 
35 
36 struct IlangFrontend : public Frontend {
37  IlangFrontend() : Frontend("ilang", "read modules from ilang file") { }
38  virtual void help()
39  {
40  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
41  log("\n");
42  log(" read_ilang [filename]\n");
43  log("\n");
44  log("Load modules from an ilang file to the current design. (ilang is a text\n");
45  log("representation of a design in yosys's internal format.)\n");
46  log("\n");
47  }
48  virtual void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design)
49  {
50  log_header("Executing ILANG frontend.\n");
51  extra_args(f, filename, args, 1);
52  log("Input filename: %s\n", filename.c_str());
53 
60  }
62 
64 
void rtlil_frontend_ilang_yyerror(char const *s)
int rtlil_frontend_ilang_yyparse(void)
void log_header(const char *format,...)
Definition: log.cc:188
#define YOSYS_NAMESPACE_PREFIX
Definition: yosys.h:101
#define YOSYS_NAMESPACE_END
Definition: yosys.h:100
void log_error(const char *format,...)
Definition: log.cc:204
int rtlil_frontend_ilang_yylex_destroy(void)
YOSYS_NAMESPACE_END int rtlil_frontend_ilang_yydebug
int rtlil_frontend_ilang_yyget_lineno(void)
IlangFrontend IlangFrontend
std::istream * lexin
RTLIL::Design * current_design
#define NULL
#define YOSYS_NAMESPACE_BEGIN
Definition: yosys.h:99
virtual void help()
void log(const char *format,...)
Definition: log.cc:180
virtual void execute(std::istream *&f, std::string filename, std::vector< std::string > args, RTLIL::Design *design)
void extra_args(std::istream *&f, std::string &filename, std::vector< std::string > args, size_t argidx)
Definition: register.cc:302
void rtlil_frontend_ilang_yyrestart(FILE *f)