summaryrefslogtreecommitdiff
path: root/passes
diff options
context:
space:
mode:
authorSiesh1oo <siesh1oo@siesh1oo.no>2014-03-12 18:33:37 +0100
committerClifford Wolf <clifford@clifford.at>2014-03-12 23:17:14 +0100
commit8127d5e8c35da6610dc9fd43cca66ff9ca41f078 (patch)
tree2a30bcb08197a4b77234befaa0096bccae52ae73 /passes
parent31528634796c15d0dcdb113ff730fa743663ca07 (diff)
- kernel/register.h, kernel/driver.cc: refactor rewrite_yosys_exe()/get_share_file_name() to portable proc_self_dirname()/proc_share_dirname().
This refactoring improves robustness and allows OSX support with only 7 new lines of code, and easy extension for other systems. - passes/abc/abc.cc, passes/cmds/show.cc, passes/techmap/techmap.cc: use new, refactored semantics.
Diffstat (limited to 'passes')
-rw-r--r--passes/abc/abc.cc2
-rw-r--r--passes/cmds/show.cc3
-rw-r--r--passes/techmap/techmap.cc3
3 files changed, 5 insertions, 3 deletions
diff --git a/passes/abc/abc.cc b/passes/abc/abc.cc
index 286b750c..30e78e58 100644
--- a/passes/abc/abc.cc
+++ b/passes/abc/abc.cc
@@ -969,7 +969,7 @@ struct AbcPass : public Pass {
log_header("Executing ABC pass (technology mapping using ABC).\n");
log_push();
- std::string exe_file = rewrite_yosys_exe("yosys-abc");
+ std::string exe_file = proc_self_dirname() + "yosys-abc";
std::string script_file, liberty_file, constr_file, clk_str;
bool dff_mode = false, keepff = false, cleanup = true;
int lut_mode = 0;
diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc
index fdccb4bc..bf37e5da 100644
--- a/passes/cmds/show.cc
+++ b/passes/cmds/show.cc
@@ -751,7 +751,8 @@ struct ShowPass : public Pass {
log_cmd_error("Shell command failed!\n");
} else
if (format.empty()) {
- std::string cmd = stringf("fuser -s '%s' || '%s' '%s' &", out_file.c_str(), rewrite_yosys_exe("yosys-svgviewer").c_str(), out_file.c_str());
+ std::string svgviewer = proc_self_dirname() + "yosys-svgviewer";
+ std::string cmd = stringf("fuser -s '%s' || '%s' '%s' &", out_file.c_str(), svgviewer.c_str(), out_file.c_str());
log("Exec: %s\n", cmd.c_str());
if (system(cmd.c_str()) != 0)
log_cmd_error("Shell command failed!\n");
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc
index 937f4131..0ca601e3 100644
--- a/passes/techmap/techmap.cc
+++ b/passes/techmap/techmap.cc
@@ -548,13 +548,14 @@ struct TechmapPass : public Pass {
int max_iter = -1;
size_t argidx;
+ std::string proc_share_path = proc_share_dirname();
for (argidx = 1; argidx < args.size(); argidx++) {
if (args[argidx] == "-map" && argidx+1 < args.size()) {
map_files.push_back(args[++argidx]);
continue;
}
if (args[argidx] == "-share_map" && argidx+1 < args.size()) {
- map_files.push_back(get_share_file_name(args[++argidx]));
+ map_files.push_back(proc_share_path + args[++argidx]);
continue;
}
if (args[argidx] == "-max_iter" && argidx+1 < args.size()) {