48 #include <initializer_list>
63 # error It looks like you are trying to build Yosys without the config defines set. \
64 When building Yosys with a custom make system, make sure you set all the \
65 defines the Yosys Makefile would set for your build configuration.
68 #ifdef YOSYS_ENABLE_TCL
75 # undef YY_NO_UNISTD_H
76 # define YY_NO_UNISTD_H 1
82 # define strtok_r strtok_s
83 # define strdup _strdup
84 # define snprintf _snprintf
85 # define getcwd _getcwd
88 # define pclose _pclose
89 # define PATH_MAX MAX_PATH
92 # define isatty _isatty
93 # define fileno _fileno
97 #define PRIVATE_NAMESPACE_BEGIN namespace {
98 #define PRIVATE_NAMESPACE_END }
99 #define YOSYS_NAMESPACE_BEGIN namespace Yosys {
100 #define YOSYS_NAMESPACE_END }
101 #define YOSYS_NAMESPACE_PREFIX Yosys::
102 #define USING_YOSYS_NAMESPACE using namespace Yosys;
104 #if __cplusplus >= 201103L
105 # define YS_OVERRIDE override
106 # define YS_FINAL final
112 #if defined(__GNUC__) || defined(__clang__)
113 # define YS_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
115 #elif defined(_MSC_VER)
116 # define YS_ATTRIBUTE(...)
117 # define YS_NORETURN __declspec(noreturn)
119 # define YS_ATTRIBUTE(...)
133 std::
string vstringf(const
char *fmt, va_list ap);
134 int readsome(std::istream &f,
char *s,
int n);
135 std::
string next_token(std::
string &text, const
char *sep);
136 bool patmatch(const
char *pattern, const
char *
string);
137 int run_command(const std::
string &command, std::function<
void(const std::
string&)> process_line = std::function<
void(const std::
string&)>());
138 std::
string make_temp_file(std::
string template_str = "/tmp/yosys_XXXXXX");
139 std::
string make_temp_dir(std::
string template_str = "/tmp/yosys_XXXXXX");
143 template<typename T>
int GetSize(const T &obj) {
return obj.size(); }
157 #ifdef YOSYS_ENABLE_TCL
158 Tcl_Interp *yosys_get_tcl_interp();
167 YOSYS_NAMESPACE_PREFIX new_id(__FILE__, __LINE__, __FUNCTION__)
170 ([]() { static YOSYS_NAMESPACE_PREFIX RTLIL::IdString _id(_str); return _id; })()
177 void run_frontend(std::string filename, std::string command,
RTLIL::Design *design, std::string *backend_command, std::string *from_to_label);
192 void load_plugin(std::string filename, std::vector<std::string> aliases);
const char * yosys_version_str
YOSYS_NAMESPACE_END YOSYS_NAMESPACE_BEGIN void yosys_setup()
void run_backend(std::string filename, std::string command, RTLIL::Design *design)
RTLIL::Design * yosys_get_design()
void shell(RTLIL::Design *design)
int GetSize(const T &obj)
#define YOSYS_NAMESPACE_END
void run_frontend(std::string filename, std::string command, RTLIL::Design *design, std::string *backend_command, std::string *from_to_label)
int readsome(std::istream &f, char *s, int n)
RTLIL::Design * yosys_design
int run_command(const std::string &command, std::function< void(const std::string &)> process_line=std::function< void(const std::string &)>())
const char * create_prompt(RTLIL::Design *design, int recursion_counter)
std::string make_temp_file(std::string template_str="/tmp/yosys_XXXXXX")
std::map< std::string, RTLIL::Design * > saved_designs
std::string proc_self_dirname()
std::string std::string vstringf(const char *fmt, va_list ap)
#define YS_ATTRIBUTE(...)
RTLIL::IdString new_id(std::string file, int line, std::string func)
bool patmatch(const char *pattern, const char *string)
void remove_directory(std::string dirname)
std::string make_temp_dir(std::string template_str="/tmp/yosys_XXXXXX")
std::vector< RTLIL::Design * > pushed_designs
std::map< std::string, std::string > loaded_plugin_aliases
#define YOSYS_NAMESPACE_BEGIN
void load_plugin(std::string filename, std::vector< std::string > aliases)
bool check_file_exists(std::string filename, bool is_exec=false)
void run_pass(std::string command, RTLIL::Design *design)
std::string proc_share_dirname()
std::string next_token(std::string &text, const char *sep)
std::string stringf(const char *fmt,...) YS_ATTRIBUTE(format(printf
std::map< std::string, void * > loaded_plugins