1101 log_header(
"Executing ABC pass (technology mapping using ABC).\n");
1105 std::string script_file, liberty_file, constr_file, clk_str, delay_target;
1106 bool fast_mode =
false, dff_mode =
false, keepff =
false, cleanup =
true;
1115 char pwd [PATH_MAX];
1116 if (!getcwd(pwd,
sizeof(pwd))) {
1120 for (argidx = 1; argidx <
args.size(); argidx++) {
1121 std::string arg =
args[argidx];
1122 if (arg ==
"-exe" && argidx+1 <
args.size()) {
1123 exe_file =
args[++argidx];
1126 if (arg ==
"-script" && argidx+1 <
args.size()) {
1127 script_file =
args[++argidx];
1128 if (!script_file.empty() && script_file[0] !=
'/' && script_file[0] !=
'+')
1129 script_file = std::string(pwd) +
"/" + script_file;
1132 if (arg ==
"-liberty" && argidx+1 <
args.size()) {
1133 liberty_file =
args[++argidx];
1134 if (!liberty_file.empty() && liberty_file[0] !=
'/')
1135 liberty_file = std::string(pwd) +
"/" + liberty_file;
1138 if (arg ==
"-constr" && argidx+1 <
args.size()) {
1139 constr_file =
args[++argidx];
1140 if (!constr_file.empty() && constr_file[0] !=
'/')
1141 constr_file = std::string(pwd) +
"/" + constr_file;
1144 if (arg ==
"-D" && argidx+1 <
args.size()) {
1145 delay_target =
"-D " +
args[++argidx];
1148 if (arg ==
"-lut" && argidx+1 <
args.size()) {
1149 lut_mode = atoi(
args[++argidx].c_str());
1152 if (arg ==
"-fast") {
1156 if (arg ==
"-dff") {
1160 if (arg ==
"-clk" && argidx+1 <
args.size()) {
1161 clk_str =
args[++argidx];
1164 if (arg ==
"-keepff") {
1168 if (arg ==
"-nocleanup") {
1176 if (lut_mode != 0 && !liberty_file.empty())
1177 log_cmd_error(
"Got -lut and -liberty! This two options are exclusive.\n");
1178 if (!constr_file.empty() && liberty_file.empty())
1181 for (
auto &mod_it : design->
modules_)
1182 if (design->
selected(mod_it.second)) {
1183 if (mod_it.second->processes.size() > 0)
1184 log(
"Skipping module %s as it contains processes.\n", mod_it.second->name.c_str());
1186 abc_module(design, mod_it.second, script_file, exe_file, liberty_file, constr_file, cleanup, lut_mode, dff_mode, clk_str, keepff, delay_target, fast_mode);
bool selected(T1 *module) const
void log_header(const char *format,...)
std::string proc_self_dirname()
void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::string script_file, std::string exe_file, std::string liberty_file, std::string constr_file, bool cleanup, int lut_mode, bool dff_mode, std::string clk_str, bool keepff, std::string delay_target, bool fast_mode)
std::vector< gate_t > signal_list
void log_cmd_error(const char *format,...)
bool check_file_exists(std::string filename, bool is_exec)
std::map< RTLIL::SigBit, int > signal_map
std::map< RTLIL::IdString, RTLIL::Module * > modules_
void log(const char *format,...)
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)