From ca03fbdc6d156a58a77e3b075d5a9a65964a683d Mon Sep 17 00:00:00 2001 From: Aki Van Ness Date: Thu, 18 Nov 2021 07:35:14 -0500 Subject: [PATCH] pass metadata: some more rough work on dumping the parameters and attributes --- backends/metadata/metadata.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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()); -- 2.30.2