diff options
author | Sahand Kashani <sahand.kashani@gmail.com> | 2020-03-21 15:57:53 +0100 |
---|---|---|
committer | Sahand Kashani <sahand.kashani@gmail.com> | 2020-03-21 15:57:53 +0100 |
commit | 21492914a29a8cbd9ccae6ad275c9ee2f1d98957 (patch) | |
tree | 4496f331112727efee91b9292d021489d0883897 | |
parent | c0b2a9af2efab6eadc63b4152303018366a82aa2 (diff) | |
download | yosys-21492914a29a8cbd9ccae6ad275c9ee2f1d98957.tar.gz yosys-21492914a29a8cbd9ccae6ad275c9ee2f1d98957.tar.bz2 yosys-21492914a29a8cbd9ccae6ad275c9ee2f1d98957.zip |
Strip quotes around fileinfo strings
Yosys puts quotes around the string that represents the fileinfo whereas
firrtl does not. So when firrtl sees quotes, it escapes them with an extra
backslash which makes it hard to read afterwards.
-rw-r--r-- | backends/firrtl/firrtl.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/backends/firrtl/firrtl.cc b/backends/firrtl/firrtl.cc index 7d2da7b00..a6cb9cfbe 100644 --- a/backends/firrtl/firrtl.cc +++ b/backends/firrtl/firrtl.cc @@ -106,7 +106,11 @@ std::string getFileinfo(dict<RTLIL::IdString, RTLIL::Const> attributes) fileinfo << "]"; } } - return fileinfo.str(); + + std::string fileinfo_str = fileinfo.str(); + fileinfo_str.erase(std::remove(fileinfo_str.begin(), fileinfo_str.end(), '\"'), fileinfo_str.end()); + + return fileinfo_str; } // Get a port direction with respect to a specific module. |