mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-15 13:28:59 +00:00
abc9: if -script value is a file, then source it, otherwise commands
This commit is contained in:
parent
050f03f15b
commit
0696b7bc9e
|
@ -267,16 +267,21 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
|
||||||
abc9_script += stringf("&read %s/input.xaig; &ps; ", tempdir_name.c_str());
|
abc9_script += stringf("&read %s/input.xaig; &ps; ", tempdir_name.c_str());
|
||||||
|
|
||||||
if (!script_file.empty()) {
|
if (!script_file.empty()) {
|
||||||
if (script_file[0] == '+') {
|
if (check_file_exists(script_file))
|
||||||
for (size_t i = 1; i < script_file.size(); i++)
|
|
||||||
if (script_file[i] == '\'')
|
|
||||||
abc9_script += "'\\''";
|
|
||||||
else if (script_file[i] == ',')
|
|
||||||
abc9_script += " ";
|
|
||||||
else
|
|
||||||
abc9_script += script_file[i];
|
|
||||||
} else
|
|
||||||
abc9_script += stringf("source %s", script_file.c_str());
|
abc9_script += stringf("source %s", script_file.c_str());
|
||||||
|
else {
|
||||||
|
if (script_file[0] == '+') {
|
||||||
|
for (size_t i = 1; i < script_file.size(); i++)
|
||||||
|
if (script_file[i] == '\'')
|
||||||
|
abc9_script += "'\\''";
|
||||||
|
else if (script_file[i] == ',')
|
||||||
|
abc9_script += " ";
|
||||||
|
else
|
||||||
|
abc9_script += script_file[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
abc9_script += script_file;
|
||||||
|
}
|
||||||
} else if (!lut_costs.empty() || !lut_file.empty()) {
|
} else if (!lut_costs.empty() || !lut_file.empty()) {
|
||||||
abc9_script += fast_mode ? RTLIL::constpad.at("abc9.script.default.fast")
|
abc9_script += fast_mode ? RTLIL::constpad.at("abc9.script.default.fast")
|
||||||
: RTLIL::constpad.at("abc9.script.default");
|
: RTLIL::constpad.at("abc9.script.default");
|
||||||
|
@ -302,7 +307,7 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
|
||||||
for (size_t pos = abc9_script.find("&mfs"); pos != std::string::npos; pos = abc9_script.find("&mfs", pos))
|
for (size_t pos = abc9_script.find("&mfs"); pos != std::string::npos; pos = abc9_script.find("&mfs", pos))
|
||||||
abc9_script = abc9_script.erase(pos, strlen("&mfs"));
|
abc9_script = abc9_script.erase(pos, strlen("&mfs"));
|
||||||
|
|
||||||
abc9_script += stringf("&ps -l; &write -n %s/output.aig; time", tempdir_name.c_str());
|
abc9_script += stringf("; &ps -l; &write -n %s/output.aig; time", tempdir_name.c_str());
|
||||||
abc9_script = add_echos_to_abc9_cmd(abc9_script);
|
abc9_script = add_echos_to_abc9_cmd(abc9_script);
|
||||||
|
|
||||||
for (size_t i = 0; i+1 < abc9_script.size(); i++)
|
for (size_t i = 0; i+1 < abc9_script.size(); i++)
|
||||||
|
@ -924,7 +929,7 @@ struct Abc9Pass : public Pass {
|
||||||
extra_args(args, argidx, design);
|
extra_args(args, argidx, design);
|
||||||
|
|
||||||
rewrite_filename(script_file);
|
rewrite_filename(script_file);
|
||||||
if (!script_file.empty() && !is_absolute_path(script_file) && script_file[0] != '+')
|
if (!script_file.empty() && !is_absolute_path(script_file) && check_file_exists(script_file))
|
||||||
script_file = std::string(pwd) + "/" + script_file;
|
script_file = std::string(pwd) + "/" + script_file;
|
||||||
|
|
||||||
// handle -lut / -luts args
|
// handle -lut / -luts args
|
||||||
|
|
Loading…
Reference in a new issue