aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/abc9.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-01-09 17:11:09 -0800
committerEddie Hung <eddie@fpgeh.com>2020-01-09 17:11:09 -0800
commitef3e84aac97565caff1f7d9bbce459d1592318ad (patch)
tree53d8c5a79d185ddf4881ddf56c1d4722789efaa9 /passes/techmap/abc9.cc
parent67c9c41f7e566f5604a3e38e7ad402d6b5c80fd8 (diff)
downloadyosys-ef3e84aac97565caff1f7d9bbce459d1592318ad.tar.gz
yosys-ef3e84aac97565caff1f7d9bbce459d1592318ad.tar.bz2
yosys-ef3e84aac97565caff1f7d9bbce459d1592318ad.zip
Revert "abc9: if -script value is a file, then source it, otherwise commands"
This reverts commit 0696b7bc9e4bd86eadd0e0b92696392cc5dc6172.
Diffstat (limited to 'passes/techmap/abc9.cc')
-rw-r--r--passes/techmap/abc9.cc27
1 files changed, 11 insertions, 16 deletions
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc
index 3f05494c7..e8988f699 100644
--- a/passes/techmap/abc9.cc
+++ b/passes/techmap/abc9.cc
@@ -267,21 +267,16 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
abc9_script += stringf("&read %s/input.xaig; &ps; ", tempdir_name.c_str());
if (!script_file.empty()) {
- if (check_file_exists(script_file))
+ 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 += 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()) {
abc9_script += fast_mode ? RTLIL::constpad.at("abc9.script.default.fast")
: RTLIL::constpad.at("abc9.script.default");
@@ -313,7 +308,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))
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);
for (size_t i = 0; i+1 < abc9_script.size(); i++)
@@ -972,7 +967,7 @@ struct Abc9Pass : public Pass {
extra_args(args, argidx, design);
rewrite_filename(script_file);
- if (!script_file.empty() && !is_absolute_path(script_file) && check_file_exists(script_file))
+ if (!script_file.empty() && !is_absolute_path(script_file) && script_file[0] != '+')
script_file = std::string(pwd) + "/" + script_file;
// handle -lut / -luts args