diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-04-30 17:00:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 17:00:34 +0200 |
commit | d9d50b0b0c4da21c9bf2b0f1499297368b808491 (patch) | |
tree | 6a926310738ae81a1b98f74066e79f423310b33b /kernel | |
parent | 727eec04c53c6863b18883a5afd7cee1cb52a157 (diff) | |
parent | 58e991a0eb36f0a5a23170e6818338efa7445a44 (diff) | |
download | yosys-d9d50b0b0c4da21c9bf2b0f1499297368b808491.tar.gz yosys-d9d50b0b0c4da21c9bf2b0f1499297368b808491.tar.bz2 yosys-d9d50b0b0c4da21c9bf2b0f1499297368b808491.zip |
Merge branch 'master' into eddie/refactor_synth_xilinx
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/driver.cc | 4 | ||||
-rw-r--r-- | kernel/rtlil.cc | 2 | ||||
-rw-r--r-- | kernel/yosys.cc | 14 | ||||
-rw-r--r-- | kernel/yosys.h | 1 |
4 files changed, 18 insertions, 3 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc index 1bc7a5935..f273057dd 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -529,13 +529,13 @@ int main(int argc, char **argv) log_error("Can't open dependencies file for writing: %s\n", strerror(errno)); bool first = true; for (auto fn : yosys_output_files) { - fprintf(f, "%s%s", first ? "" : " ", fn.c_str()); + fprintf(f, "%s%s", first ? "" : " ", escape_filename_spaces(fn).c_str()); first = false; } fprintf(f, ":"); for (auto fn : yosys_input_files) { if (yosys_output_files.count(fn) == 0) - fprintf(f, " %s", fn.c_str()); + fprintf(f, " %s", escape_filename_spaces(fn).c_str()); } fprintf(f, "\n"); } diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 7e1159cac..dd6817873 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -3456,7 +3456,7 @@ bool RTLIL::SigSpec::operator ==(const RTLIL::SigSpec &other) const pack(); other.pack(); - if (chunks_.size() != chunks_.size()) + if (chunks_.size() != other.chunks_.size()) return false; updhash(); diff --git a/kernel/yosys.cc b/kernel/yosys.cc index a12355f1d..20d972150 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -482,6 +482,20 @@ void remove_directory(std::string dirname) #endif } +std::string escape_filename_spaces(const std::string& filename) +{ + std::string out; + out.reserve(filename.size()); + for (auto c : filename) + { + if (c == ' ') + out += "\\ "; + else + out.push_back(c); + } + return out; +} + int GetSize(RTLIL::Wire *wire) { return wire->width; diff --git a/kernel/yosys.h b/kernel/yosys.h index 2cf6188b4..82eb069ab 100644 --- a/kernel/yosys.h +++ b/kernel/yosys.h @@ -257,6 +257,7 @@ std::string make_temp_dir(std::string template_str = "/tmp/yosys_XXXXXX"); bool check_file_exists(std::string filename, bool is_exec = false); bool is_absolute_path(std::string filename); void remove_directory(std::string dirname); +std::string escape_filename_spaces(const std::string& filename); template<typename T> int GetSize(const T &obj) { return obj.size(); } int GetSize(RTLIL::Wire *wire); |