Remove quotes if any from attribute
authorMiodrag Milanovic <mmicko@gmail.com>
Wed, 16 Feb 2022 18:10:13 +0000 (19:10 +0100)
committerMiodrag Milanovic <mmicko@gmail.com>
Wed, 16 Feb 2022 18:10:13 +0000 (19:10 +0100)
frontends/verific/verific.cc

index 17dbed067f15169b03e89fe3ff76c747d7c80580..8c2f7f0da36e4e600aa734e44264b07b73d4e648 100644 (file)
@@ -169,7 +169,10 @@ void VerificImporter::import_attributes(dict<RTLIL::IdString, RTLIL::Const> &att
        FOREACH_ATTRIBUTE(obj, mi, attr) {
                if (attr->Key()[0] == ' ' || attr->Value() == nullptr)
                        continue;
-               attributes[RTLIL::escape_id(attr->Key())] = RTLIL::Const(std::string(attr->Value()));
+               std::string val = std::string(attr->Value());
+               if (val.size()>1 && val[0]=='\"' && val.back()=='\"')
+                       val = val.substr(1,val.size()-2);
+               attributes[RTLIL::escape_id(attr->Key())] = RTLIL::Const(val);
        }
 
        if (nl) {