aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorN. Engelhardt <nak@yosyshq.com>2022-09-09 17:57:57 +0200
committerN. Engelhardt <nakengelhardt@gmail.com>2022-09-13 19:30:40 +0200
commitda614fe13ad2c98a1b02baa07fa304697a78b9ba (patch)
treec59c401fcddba458f94d31f81f1e6d0c8c76750f /passes
parentdd4a0c3034173075fc6510cf52164023a114f560 (diff)
downloadyosys-da614fe13ad2c98a1b02baa07fa304697a78b9ba.tar.gz
yosys-da614fe13ad2c98a1b02baa07fa304697a78b9ba.tar.bz2
yosys-da614fe13ad2c98a1b02baa07fa304697a78b9ba.zip
Fix tmpdir naming when passing -nocleanup option to abc(9) on systems where base_tmpdir isn't /tmp/
Diffstat (limited to 'passes')
-rw-r--r--passes/techmap/abc.cc9
-rw-r--r--passes/techmap/abc9.cc9
2 files changed, 12 insertions, 6 deletions
diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc
index 90efef9cf..da601a856 100644
--- a/passes/techmap/abc.cc
+++ b/passes/techmap/abc.cc
@@ -782,9 +782,12 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin
if (dff_mode && clk_sig.empty())
log_cmd_error("Clock domain %s not found.\n", clk_str.c_str());
- std::string tempdir_name = get_base_tmpdir() + "/" + proc_program_prefix()+ "yosys-abc-XXXXXX";
- if (!cleanup)
- tempdir_name[0] = tempdir_name[4] = '_';
+ std::string tempdir_name;
+ if (cleanup)
+ tempdir_name = get_base_tmpdir() + "/";
+ else
+ tempdir_name = "_tmp_";
+ tempdir_name += proc_program_prefix() + "yosys-abc-XXXXXX";
tempdir_name = make_temp_dir(tempdir_name);
log_header(design, "Extracting gate netlist of module `%s' to `%s/input.blif'..\n",
module->name.c_str(), replace_tempdir(tempdir_name, tempdir_name, show_tempdir).c_str());
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc
index 88fac67e8..876917e56 100644
--- a/passes/techmap/abc9.cc
+++ b/passes/techmap/abc9.cc
@@ -404,9 +404,12 @@ struct Abc9Pass : public ScriptPass
if (!active_design->selected_whole_module(mod))
log_error("Can't handle partially selected module %s!\n", log_id(mod));
- std::string tempdir_name = get_base_tmpdir() + "/" + proc_program_prefix() + "yosys-abc-XXXXXX";
- if (!cleanup)
- tempdir_name[0] = tempdir_name[4] = '_';
+ std::string tempdir_name;
+ if (cleanup)
+ tempdir_name = get_base_tmpdir() + "/";
+ else
+ tempdir_name = "_tmp_";
+ tempdir_name += proc_program_prefix() + "yosys-abc-XXXXXX";
tempdir_name = make_temp_dir(tempdir_name);
if (!lut_mode)