diff options
author | Ethan Mahintorabi <ethanmoon@google.com> | 2020-10-28 18:59:59 -0700 |
---|---|---|
committer | Ethan Mahintorabi <ethanmoon@google.com> | 2020-10-28 19:00:06 -0700 |
commit | 5c36e7757c4a65c7dc32509534501bda4fb5e35e (patch) | |
tree | c5a3cba20270482867c1322eec4d7835cbc6e013 /passes | |
parent | e2a39bb1e71b97d423a3c2233abce996376e25dd (diff) | |
download | yosys-5c36e7757c4a65c7dc32509534501bda4fb5e35e.tar.gz yosys-5c36e7757c4a65c7dc32509534501bda4fb5e35e.tar.bz2 yosys-5c36e7757c4a65c7dc32509534501bda4fb5e35e.zip |
This patch adds support for defining the ABC location at runtime instead of at compile time. This is helpful in build systems like bazel which do not have stable locations for binaries or directories during the compilation phase.
This change should be backwards compatible with the existing behavior.
Diffstat (limited to 'passes')
-rw-r--r-- | passes/techmap/abc.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index ce50e9a5b..66ac6828f 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -1471,7 +1471,12 @@ struct AbcPass : public Pass { po_map.clear(); #ifdef ABCEXTERNAL - std::string exe_file = ABCEXTERNAL; + std::string exe_file; + if (std::getenv("ABC")) { + exe_file = std::getenv("ABC"); + } else { + exe_file = ABCEXTERNAL; + } #else std::string exe_file = proc_self_dirname() + proc_program_prefix() + "yosys-abc"; #endif |