From 5c36e7757c4a65c7dc32509534501bda4fb5e35e Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 28 Oct 2020 18:59:59 -0700 Subject: [PATCH] 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. --- passes/techmap/abc.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.30.2