Strip quotes around fileinfo strings
authorSahand Kashani <sahand.kashani@gmail.com>
Sat, 21 Mar 2020 14:57:53 +0000 (15:57 +0100)
committerSahand Kashani <sahand.kashani@gmail.com>
Sat, 21 Mar 2020 14:57:53 +0000 (15:57 +0100)
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.

backends/firrtl/firrtl.cc

index 7d2da7b00f0ee8f8856da8c80be585a0838cca01..a6cb9cfbee17241dddaf3a7e0acb30345639f07c 100644 (file)
@@ -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.