From: Aki Van Ness Date: Thu, 18 Nov 2021 12:35:14 +0000 (-0500) Subject: pass metadata: some more rough work on dumping the parameters and attributes X-Git-Tag: smtlib2-expr-support-on-0.13-old~19 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b289a8ed78afa688a286ee7944677dcced120e9;p=yosys.git pass metadata: some more rough work on dumping the parameters and attributes (cherry picked from commit ca03fbdc6d156a58a77e3b075d5a9a65964a683d) --- diff --git a/backends/metadata/metadata.cc b/backends/metadata/metadata.cc index 292329d62..7b2faa181 100644 --- a/backends/metadata/metadata.cc +++ b/backends/metadata/metadata.cc @@ -185,9 +185,9 @@ struct MetadataWriter for (auto& attr : cell->attributes) { if (!first_attr) f << stringf(",\n"); - const auto attr_val = attr.second.decode_string(); - if (attr_val.size() > 0) - f << stringf(" %s: \"%s\"\n", get_string(RTLIL::unescape_id(attr.first)).c_str(), attr_val.c_str()); + const auto attr_val = attr.second; + if (!attr_val.empty()) + f << stringf(" %s: \"%s\"\n", get_string(RTLIL::unescape_id(attr.first)).c_str(), attr_val.decode_string().c_str()); else f << stringf(" %s: true\n", get_string(RTLIL::unescape_id(attr.first)).c_str()); @@ -201,9 +201,9 @@ struct MetadataWriter for (auto& param : cell->parameters) { if (!first_param) f << stringf(",\n"); - const auto param_val = param.second.decode_string(); - if (param_val.size() > 0) - f << stringf(" %s: \"%s\"\n", get_string(RTLIL::unescape_id(param.first)).c_str(), param_val.c_str()); + const auto param_val = param.second; + if (!param_val.empty()) + f << stringf(" %s: \"%s\"\n", get_string(RTLIL::unescape_id(param.first)).c_str(), param_val.decode_string().c_str()); else f << stringf(" %s: true\n", get_string(RTLIL::unescape_id(param.first)).c_str());