From: Sahand Kashani Date: Sat, 21 Mar 2020 14:57:53 +0000 (+0100) Subject: Strip quotes around fileinfo strings X-Git-Tag: working-ls180~630^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21492914a29a8cbd9ccae6ad275c9ee2f1d98957;p=yosys.git 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. --- 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 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.