diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-20 11:26:11 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-04-20 11:26:11 -0700 |
commit | 3d7b98335150bc5ffe58e312ea4433311af8b111 (patch) | |
tree | 952505f663a563e9f35651081558a9e551723ad6 /passes/techmap | |
parent | a998a4155d0e8a109bae80c3be24ed8465378b46 (diff) | |
download | yosys-3d7b98335150bc5ffe58e312ea4433311af8b111.tar.gz yosys-3d7b98335150bc5ffe58e312ea4433311af8b111.tar.bz2 yosys-3d7b98335150bc5ffe58e312ea4433311af8b111.zip |
abc9: tolerate ABC nonzero exit code if output.aig; write before &mfs
Re-enable mfs for xilinx/ecp5 speculatively -- if it fails, use pre-mfs
result
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/abc9_exe.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/passes/techmap/abc9_exe.cc b/passes/techmap/abc9_exe.cc index 1aabbd396..bad91a224 100644 --- a/passes/techmap/abc9_exe.cc +++ b/passes/techmap/abc9_exe.cc @@ -222,6 +222,13 @@ void abc9_module(RTLIL::Design *design, std::string script_file, std::string exe if (design->scratchpad_get_bool("abc9.nomfs")) 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")); + else { + auto s = stringf("&write -n %s/output.aig; ", tempdir_name.c_str()); + for (size_t pos = abc9_script.find("&mfs"); pos != std::string::npos; pos = abc9_script.find("&mfs", pos)) { + abc9_script = abc9_script.insert(pos, s); + pos += GetSize(s) + strlen("&mfs"); + } + } abc9_script += stringf("; &ps -l; &write -n %s/output.aig", tempdir_name.c_str()); if (design->scratchpad_get_bool("abc9.verify")) { @@ -276,8 +283,12 @@ void abc9_module(RTLIL::Design *design, std::string script_file, std::string exe free(abc9_argv[2]); free(abc9_argv[3]); #endif - if (ret != 0) - log_error("ABC: execution of command \"%s\" failed: return code %d.\n", buffer.c_str(), ret); + if (ret != 0) { + if (check_file_exists(stringf("%s/output.aig", tempdir_name.c_str()))) + log_warning("ABC: execution of command \"%s\" failed: return code %d.\n", buffer.c_str(), ret); + else + log_error("ABC: execution of command \"%s\" failed: return code %d.\n", buffer.c_str(), ret); + } } struct Abc9ExePass : public Pass { |