28 bool check_label(
bool &active, std::string run_from, std::string run_to, std::string label)
30 if (!run_from.empty() && run_from == run_to) {
31 active = (label == run_from);
33 if (label == run_from)
47 log(
" synth [options]\n");
49 log(
"This command runs the default synthesis script. This command does not operate\n");
50 log(
"on partly selected designs.\n");
52 log(
" -top <module>\n");
53 log(
" use the specified module as top module (default='top')\n");
55 log(
" -run <from_label>[:<to_label>]\n");
56 log(
" only run the commands between the labels (see below). an empty\n");
57 log(
" from label is synonymous to 'begin', and empty to label is\n");
58 log(
" synonymous to the end of the command list.\n");
61 log(
"The following commands are executed by this synthesis command:\n");
64 log(
" hierarchy -check [-top <top>]\n");
75 log(
" memory -nomap\n");
79 log(
" opt -fast -full\n");
84 #ifdef YOSYS_ENABLE_ABC
94 std::string top_module;
95 std::string run_from, run_to;
98 for (argidx = 1; argidx < args.size(); argidx++)
100 if (args[argidx] ==
"-top" && argidx+1 < args.size()) {
101 top_module = args[++argidx];
104 if (args[argidx] ==
"-run" && argidx+1 < args.size()) {
105 size_t pos = args[argidx+1].find(
':');
106 if (pos == std::string::npos) {
107 run_from = args[++argidx];
108 run_to = args[argidx];
110 run_from = args[++argidx].substr(0, pos);
111 run_to = args[argidx].substr(pos+1);
120 log_cmd_error(
"This comannd only operates on fully selected designs!\n");
122 bool active = run_from.empty();
127 if (
check_label(active, run_from, run_to,
"begin"))
129 if (top_module.empty())
135 if (
check_label(active, run_from, run_to,
"coarse"))
158 #ifdef YOSYS_ENABLE_ABC
std::string stringf(const char *fmt,...)
void log_header(const char *format,...)
USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN bool check_label(bool &active, std::string run_from, std::string run_to, std::string label)
bool full_selection() const
#define PRIVATE_NAMESPACE_BEGIN
#define PRIVATE_NAMESPACE_END
void log_cmd_error(const char *format,...)
#define USING_YOSYS_NAMESPACE
virtual void execute(std::vector< std::string > args, RTLIL::Design *design)
void log(const char *format,...)
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
static void call(RTLIL::Design *design, std::string command)